Skip to main content
The outerlayer CLI sets up a machine, starts and reads work, records evidence and runs a runner. This page lists every command and the rules the commands share.

Install the CLI

Install the CLI once on each machine. It needs Node.js 22.15 or later.
These pages write outerlayer <command>. For a one-off command on a machine without the install, npx @outerlayer/cli <command> runs the same thing. Two things start outerlayer by name, so they need the global install: init copies the CLI to the machine install in ~/.outerlayer/cli, and the hooks and the status line run that copy. To upgrade, see Upgrade OuterLayer. After an upgrade, restart a running outerlayer daemon and a runner you started by hand. For a service runner, see Upgrading the runner.

Commands

outerlayer <command> --help (or -h) prints the options of a command. outerlayer claude, outerlayer opencode and outerlayer codex pass every argument to the agent, so --help there prints the agent’s own help.

Conventions every command follows

Output and exit status

  • A command prints its result on stdout. Errors, warnings and questions go to stderr.
  • A command exits 0 when it did what you asked.
  • A command exits 1 when it failed or refused. The reason is on stderr, after a ✗.
  • Some commands use other exit statuses, such as 2 and 75. The page of each command lists them.

Options

These commands take --url and --app-id: More on these options:
  • --json. These commands do not take it: logout, daemon, hooks wrap, hooks unwrap, work comments-read, mcp serve, claude, opencode and codex. Of the runner commands, only runner image and runner status take it. On connect, --json moves the text to stderr.
  • --no-color. Color is also off when stdout is not a terminal, when NO_COLOR is set to any non-empty value, or when TERM is dumb. FORCE_COLOR=1 turns it on, even for a pipe or when TERM is dumb. NO_COLOR and --no-color win over FORCE_COLOR.
  • No default gateway. A command with no URL from a flag, the environment or the config file refuses and says so.
  • login with --url and --app-id. Without a piped key, login signs in by browser, refuses both flags and exits 2. See Sign-in and sync commands.
  • The API key. Do not pass it on the command line. Save it with login, or set OUTERLAYER_API_KEY. The deprecated --api-key flag works and prints a warning. Remove it from scripts.
  • The update notice. A command that ends in a terminal can print one line on stderr that names a newer CLI version. It prints none with --json, when CI is set, or for daemon and runner commands. Set OUTERLAYER_NO_UPDATE_NOTICE to any non-empty value to turn it off. See Upgrade OuterLayer.

Credential resolution

A command that calls OuterLayer sends one credential and names one factory. The credential is a factory key or a login:
  • A factory key is an API key made on the factory’s Settings → API keys. It works inside one factory.
  • A login is the token that outerlayer login saves for your account.
A command picks a factory key over a login whenever a key exists, so CI and runners always act as their key. A runner’s key is the exception. outerlayer runner init saves the runner’s key in ~/.outerlayer/config.json, beside the runner’s settings. When that file also holds a login, every command except the runner uses the login. The runner uses its key. A runner’s key works only in requests that the runner signs, so other commands cannot use it. With a factory key. The first hit wins for each value:
  1. The key: OUTERLAYER_API_KEY, then apiKey in ~/.outerlayer/config.json. A runner’s key in that file is skipped when a login is saved there too.
  2. The gateway: --url, then OUTERLAYER_URL, then url in the config file.
  3. The factory: --app-id, then OUTERLAYER_APP_ID, then appId in the config file.
With a login, used when no factory key is used:
  1. The token: accountToken in the config file, written by outerlayer login.
  2. The gateway: --url, then OUTERLAYER_URL, then url in the config file.
  3. The factory: --app-id, then OUTERLAYER_APP_ID, then the repository’s saved connection from outerlayer connect.
A login never sends appId from the config file. That value belongs to a factory key. When a value is still missing, the command refuses and names the flag or variable that supplies it. Outside a repository, a login has no factory unless you pass --app-id or set OUTERLAYER_APP_ID. A key or login saved in the config file is sent only to the gateway it was saved for. If --url or OUTERLAYER_URL names a different address, the command refuses. The message says “the gateway address is not the one your saved credential belongs to”. To call another gateway, set OUTERLAYER_API_KEY as well. See Troubleshoot the CLI.