# Work on the same agent from the CLI

> Use the Apollo CLI alongside the Playground to pull, edit, validate, regress and push the same agent, and keep the two in step.

- Source: https://www.aui.io/help/agent-program/work-from-the-cli
- Section: The agent's program
- Last updated: November 23, 2026

The Apollo CLI is the developer surface for the same agents you work on in the Playground. Both edit the same program and run on the same Apollo-1 runtime, so a change pushed from one is a commit the other sees. Use the CLI when you want to edit the program files in your own editor, have a coding agent such as Claude Code or Cursor author them, or script work in CI.

A common split: developers keep the files, runs and branches in the CLI, while the rest of the team reads conversations, traces and plain-language changes in the Playground. For every command and flag, see the [CLI documentation](https://docs.aui.io/cli/overview).

## A few names differ

Some CLI commands use other names for things you know from the Playground:

| In the Playground | CLI commands |
|---|---|
| workspace | `apollo project` |
| sandbox database | `apollo mockdb` |
| branch, commit | `apollo branch`, also available as `apollo version`. See [Branches and commits](https://www.aui.io/help/branches/branches-and-commits) for how the developer docs name them. |

## Install and sign in

You need Node.js 20 or later.

```bash
npm install -g @aui.io/apollo
apollo login
```

`apollo login` opens the Playground's sign-in page in your browser and returns you to the terminal, so you use the same account and see the same organizations and agents. `apollo doctor` checks the setup if something does not work. See [Installation](https://docs.aui.io/cli/installation) for other ways to sign in.

## The everyday loop

1. Bring the agent into a local folder, called a checkout: `apollo agent import`.
2. Edit the program under `bundle/src/`, yourself or with a coding agent. The checkout includes guidance files that teach coding agents how the program is written.
3. Check the structure: `apollo validate`.
4. Replay the agent's scripted cases to see that nothing broke: `apollo regress --follow`.
5. Save your changes as a new commit on your branch: `apollo push -m "Add the chat convenience fee"`.

A push does not change what customers get. To make a commit live, use **Make live** in the Playground's Branches window or `apollo version live <tag>`. See [Make a commit live, lock a branch, and roll back](https://www.aui.io/help/branches/make-a-commit-live).

The [CLI workflows](https://docs.aui.io/cli/workflows) page covers testing against your local edits, comparing commits, merging branches and running evaluations.

## Pull after the Playground pushes

When someone pushes from the Playground, the new commit is saved on AUI's side and your checkout does not know about it yet. Before you edit files again, run:

```bash
apollo pull
```

If you skip this, your next push is refused because the branch moved on without you. The CLI names the newer commit; bring it in with `apollo merge-from <tag>`, or push yours as a new branch with `apollo push --new-version`.

> [!WARNING]
> If the branch was locked in the Playground, a push there started a new draft branch that your checkout does not point at. Run `apollo version list` to find it, then `apollo pull --tag <tag>` to work on it.

`apollo pull` refuses to overwrite local edits, so push what you have, or set it aside, first.

## See CLI work in the Playground

- Conversations you start with `apollo chat` appear in **All threads**. Filter by **Created from** > **CLI** to find them. See [Find and filter threads](https://www.aui.io/help/testing/threads-and-filters).
- Each conversation a regression or an evaluation runs is an ordinary thread you can open and read turn by turn, with its reasoning.
- `apollo open` opens the Playground on the checkout's agent and commit, and `apollo open --thread <id>` opens one conversation. Add `--print` to print the link instead of opening a browser.

![The Playground in dark mode with the All threads panel open beside the Agent Builder. The panel lists many threads under Today, each with the start of the customer's first message, a commit tag and a time, such as 'Hi, what trips do I have booked?' and 'Show my trips, please.' No filter is applied and no thread is open.](https://www.aui.io/assets/help/agent-program/work-from-the-cli/cli-threads.png)

*The All threads panel lists the agent's conversations.*

## Learn more

- [Hello world](https://docs.aui.io/hello-world): build a first agent end to end with the CLI
- [Command reference](https://docs.aui.io/cli/commands)
- [Workflows](https://docs.aui.io/cli/workflows)
- [Configuration](https://docs.aui.io/cli/configuration)
