# Engines, GitHub and your repository

At the end, the agents think with an AI subscription you already pay for, such as ChatGPT or Claude, the runner can push to GitHub, and your repository is a workspace. All of it is on the runner's page; the sign-ins stay on the box.

## At a glance

**Time:** 10 minutes, 15 with Codex or Claude Code.

**What you need:**

- The runner, started in [Any Linux computer with Docker](any-box.md) and opened from the portal's **Devices** page
- An owner or admin of your org, for every step here
- A ChatGPT or Claude subscription
- A GitHub account with access to your repository

**Steps:**

1. Sign in to pi
2. Add Codex or Claude Code, if you want them
3. Give the runner a GitHub token
4. Add a workspace

Loopgate's image comes with pi, a coding tool that also lets Loopgate's own assistant, the copilot, think.

## Steps

1. **In the workbench, open Settings → Engines and press Sign in with ChatGPT** on pi's row (or **Sign in with Claude**).

2. **Open the address the page shows on your laptop and enter the code it shows.** With Claude, sign in, then paste the code Claude shows (or the address your browser ends on) into the page's box.

   You should see: pi's row says Ready. From now on the copilot thinks on pi's GPT-6 Luna.

3. **For Codex or Claude Code, press Install Codex or Install Claude Code on its row, then Sign in**. Open the address the page shows and enter its code, or paste back the code you are given when the page says **Finish signing in**.

   > Both are optional, install at the version Loopgate tested and survive restarts and updates.

4. **Open Settings → GitHub and press Make a token in GitHub.** In GitHub, give the token access to your repositories, set **Contents** and **Pull requests** to **Read and write** under **Repository permissions**, and copy it.

   > It lets the runner clone private repositories, push and open pull requests. A token for a separate "bot" GitHub user is best, so the runner's work is easy to tell apart.

5. **Paste the token on the page and press Save.** Check the name and email the runner's commits carry, and press **Save identity** if you change them.

   You should see: `Signed in as <the GitHub user>`.

6. **On Tasks, choose Add a workspace, paste your repository's address and press Clone.** Or type a name and press **Create** for an empty folder.

   You should see: `Cloning <repo>…` with git's progress, then the workspace chosen.

## Check

Settings → Engines marks each tool you signed in to Ready, Settings → GitHub says `Signed in as …`, and the sidebar lists your workspace. Type a task on Tasks and press **Run** to see the copilot's proposal.

## Next

[Connect Slack](slack.md).

## If something is off

- **Your teammates' tasks use your subscription.** A box several people share runs every task on whoever signed in there; choosing a subscription per person is not built yet. Many teams sign in with a team account.
- **You would rather pay per use.** Put an API key in `runner.env`, such as `OPENAI_API_KEY=…` or `ANTHROPIC_API_KEY=…`, then restart with `docker compose up -d runner`.
- **The page says `Ask an owner or admin of your org to … on this runner.`** Signing in engines, saving GitHub and adding workspaces on a runner are theirs to do.
- **GitHub refused the token.** Make it again with the two permissions in step 4.

## Doing it by hand

[By hand](by-hand.md) signs in to engines from the terminal and puts the GitHub token in `runner.env`.
