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.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:
- The starter skills, such as
/build. - A host’s runner service. See Set up your first host.
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,opencodeandcodex. Of therunnercommands, onlyrunner imageandrunner statustake it. Onconnect,--jsonmoves the text to stderr.--no-color. Color is also off when stdout is not a terminal, whenNO_COLORis set to any non-empty value, or whenTERMisdumb.FORCE_COLOR=1turns it on, even for a pipe or whenTERMisdumb.NO_COLORand--no-colorwin overFORCE_COLOR.- No default gateway. A command with no URL from a flag, the environment or the config file refuses and says so.
loginwith--urland--app-id. Without a piped key,loginsigns 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 setOUTERLAYER_API_KEY. The deprecated--api-keyflag 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, whenCIis set, or fordaemonandrunnercommands. SetOUTERLAYER_NO_UPDATE_NOTICEto 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 loginsaves for your account.
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:
- The key:
OUTERLAYER_API_KEY, thenapiKeyin~/.outerlayer/config.json. A runner’s key in that file is skipped when a login is saved there too. - The gateway:
--url, thenOUTERLAYER_URL, thenurlin the config file. - The factory:
--app-id, thenOUTERLAYER_APP_ID, thenappIdin the config file.
- The token:
accountTokenin the config file, written byouterlayer login. - The gateway:
--url, thenOUTERLAYER_URL, thenurlin the config file. - The factory:
--app-id, thenOUTERLAYER_APP_ID, then the repository’s saved connection fromouterlayer connect.
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.