> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aui.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Checkout structure, config files, and environment variables for the Apollo CLI.

## Checkout Structure

A **checkout** is a local directory holding one agent. After `apollo agent import` or `apollo agent create`, it looks like this:

```
my-agent/
├── .apollorc                  # org / project / agent / version tag / runtime binding
├── bundle/
│   ├── src/                   # the editable program source — what a push turns into a revision
│   │   ├── program.yaml       # the program manifest
│   │   ├── vocabulary.yaml    # the agent's typed vocabulary
│   │   ├── situations.yaml    # situations the agent recognizes
│   │   ├── sources.yaml       # data & knowledge sources (hub: references)
│   │   ├── derivations.yaml   # derived facts
│   │   ├── connections.yaml   # external connection wiring
│   │   ├── capabilities/      # one directory per capability
│   │   └── policies/          # behavioral policies (e.g. global.yaml)
│   ├── build/                 # the proof — ships as the agent's build bundle
│   │   ├── spec.yaml          # what the agent is for, its test callers, one card per capability
│   │   ├── scenarios.yaml     # the scripted suite `apollo regress` runs
│   │   ├── decisions.yaml     # the decision log
│   │   └── certification.yaml # the latest full regression's verdict (written by pull, never pushed)
│   └── tmp/                   # scratch the CLI writes — never pushed
├── schemas/                   # authoring JSON Schemas for every program file
├── AGENTS.md                  # authoring guide served by the agent's runtime
├── CLAUDE.md                  # the same guide, under the name Claude Code reads
├── .claude/skills/            # authoring skill packs for Claude Code
├── .cursor/skills/            # authoring skill packs for Cursor
└── .apollo/                   # this checkout's CLI state
```

| Path | Purpose |
| - | - |
| `.apollorc` | Binds the directory to an organization, project, agent, version tag, and runtime |
| `bundle/src/` | The program — typed YAML/Markdown files. **Everything that must travel with the program is authored here**; a push mints a revision from this tree alone |
| `bundle/build/` | The proof — the spec and its capability cards, the scripted suite, and the decision log. Ships as the agent's build bundle; never served to callers |
| `bundle/tmp/` | Scratch: revisions you compare with or fetch (`versions/<tag>/`), restore backups (`restored/`), and the last merge's undo |
| `schemas/` | JSON Schemas the CLI validates against, for editor autocomplete too |
| `AGENTS.md` · `CLAUDE.md` | The authoring guide the agent's runtime serves, and an identical copy under the name Claude Code reads |
| `.claude/` · `.cursor/` · `.opencode/` | Coding-agent skill packs installed on import/create (`.opencode/` with `--skills opencode`; skip them with `--no-skills` on pull) |
| `.apollo/` | This checkout's CLI state: the last regression, evaluation, and advisor thread, and which runtime served the skills |
| `tmp/` | Run evidence fetched with `--pull`: `tmp/regressions/<id>/`, `tmp/evaluations/<id>/` |
| `knowledge-data/` | Hub content downloaded with `apollo kb export` — beside `bundle/`, never pushed |

> [!NOTE]
>
> Open the agent folder as your coding-tool project root so the skill packs are discovered. The skill packs, schemas, and `AGENTS.md` come from the runtime the checkout's version runs on: `apollo pull` refreshes them with the program, and `apollo skills update` refreshes them alone (skip them on pull with `--no-skills` / `--no-schemas`).

### The `.apollorc` Binding

```json .apollorc theme={"dark"}
{
  "config_version": 1,
  "org_id": "…",
  "project_id": "…",
  "agent_id": "…",
  "version_tag": "v7.2",
  "runtime_version": "0.8.11"
}
```

Context is positional: the nearest `.apollorc` walking up from your current directory selects the agent. Commands run inside a checkout use its binding for organization, project, agent, version, and runtime.

> [!NOTE]
>
> Don't edit `.apollorc` manually — `apollo agent use / import`, `apollo project use`, `apollo version use`, `apollo pull --tag`, and `apollo runtime use` maintain it, and `apollo push` updates the tag on every push.

***

## User Configuration (`~/.apollo/`)

```
~/.apollo/
├── config.json          # active profile and default projects
├── credentials.json     # tokens (mode 0600)
├── mockdb/              # mock DB keys, one file per agent (mode 0600)
├── checkouts.json       # known-checkouts registry
├── baselines/           # sync hashes for diff/push
└── update-check.json    # the last npm release check
```

The CLI also keeps a few small caches here, such as recent runtime availability and the TUI's copilot sessions.

> [!WARNING]
>
> Never read, print, copy, or commit `~/.apollo/credentials.json` or `~/.apollo/mockdb/` — they hold your access and refresh tokens and your mock DB keys. All other commands need no additional secrets.

***

## Environment Variables

Environment variables override file-based configuration — useful for CI/CD pipelines.

| Variable | Description |
| - | - |
| `APOLLO_TOKEN` | Skip login — authenticate with this token directly (CI auth). The saved login is never read, refreshed, or overwritten, so an expired token fails with `AUTH_ERROR` |
| `APOLLO_PROFILE` | Select the credential profile |
| `APOLLO_ORG_ID` | Organization ID override |
| `APOLLO_PROJECT_ID` | Project ID override |
| `APOLLO_RUNTIME_VERSION` | Override the checkout's pinned runtime version (never written to `.apollorc`) |
| `APOLLO_TIMEOUT_MS` | Request timeout in milliseconds (default `60000`) |
| `APOLLO_TUI` | `0` keeps a bare `apollo` on the CLI welcome instead of the TUI |
| `APOLLO_UPDATE_CHECK` | `0` turns off every update request — a newer CLI, stale skills, an older runtime ([Staying up to date](https://docs.aui.io/cli/installation.md#staying-up-to-date)) |
| `APOLLO_REPORTS` | `0` turns off issue reports: `apollo report` and the CLI's background crash and 5xx reports |
| `APOLLO_REQUIRE_CONFIRM` | `1` makes `version live`, `publish`, and `archive` refuse without `--yes` when there's no terminal |
| `HTTPS_PROXY` · `HTTP_PROXY` | Send requests through this proxy (`http://[user:password@]host:port`) — see [Behind a corporate proxy](https://docs.aui.io/cli/installation.md#behind-a-corporate-proxy) |
| `NO_PROXY` | Hosts that skip the proxy (`localhost,.internal.example.com`) |
| `NODE_EXTRA_CA_CERTS` | A CA certificate (PEM) to trust, for a proxy that inspects HTTPS |
| `MOCKDB_TOKEN` | The mock DB runtime key `apollo mockdb execute` tries before the local key cache (rename with `--token-env`) |
| `APOLLO_ACCOUNT_ID` | The account mock DB calls use when your login and project don't settle it (rarely needed; same as `--account`) |
| `CI` | Any value mutes the update-request lines and skips the install-time shell setup |
| `APOLLO_NO_SHELL_SETUP` | `1` skips the install-time shell setup |
| `NO_COLOR` · `APOLLO_GLYPHS` | A monochrome TUI · `ascii` or `unicode` glyphs in the TUI |
| `APOLLO_*_URL` | Per-service endpoint overrides — use them only when AUI support asks, since they redirect the CLI's traffic |

```bash theme={"dark"}
# Example: authenticate non-interactively in CI
export APOLLO_TOKEN="$CI_APOLLO_TOKEN"
apollo --json validate
```

***

## Output & Exit Codes

With the global `--json` flag, every command emits exactly one envelope on stdout (the one exception, `apollo chat --events`, first streams one JSON line per frame, then the envelope):

```json theme={"dark"}
{ "success": true, "data": { } }
```

```json theme={"dark"}
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "…", "suggestion": "…" } }
```

When a gate says no — `validate` finds errors, a `--follow` run ends red, `push` refuses an invalid program — `error.detail` carries the same object a success would put in `data`. Either envelope can also carry `update`, `skills_update`, and `runtime_update` fields when something is out of date; they're additive, so a consumer that never looks for them sees the envelope it always did.

| Exit code | Meaning |
| - | - |
| `0` | Success |
| `1` | Runtime/API failure |
| `2` | Validation failure — including a red `--follow` run and an unmet `chat --script` expectation |
| `3` | Authentication/configuration failure, or a usage error |
| `130` | Stopped with Ctrl+C (`apollo chat`: the turn may still finish on its thread) |
| `141` | The reader went away (`apollo … \| head`) — stopped quietly, as a Unix tool does |

`--verbose` streams one **redacted** line per API request to stderr (auth/token/key/secret values never appear); the TUI shows the same stream live in its activity drawer.

## Next Steps

> [card] [Command Reference](https://docs.aui.io/cli/commands.md)
>
> Full reference for all CLI commands.

> [card] [Workflows](https://docs.aui.io/cli/workflows.md)
>
> Common development workflows and patterns.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.