CLI reference
Every command and flag of the Standard Agents CLI, with exit codes, credential locations, and build failure recovery
The Standard Agents CLI is the @standardagents/cli package. Its command is agents. You do not need to install it:
npx @standardagents/cli@latest <command>Inside a project that has the package installed, pnpm exec agents <command> or npx agents <command> runs the same program. The examples on this page write agents <command> for both forms.
The CLI supports Node.js 22 (22.12 or newer) and Node.js 24. An older Node.js stops with the version to install. An untested release line above Node.js 22 prints a warning and continues. git-credential skips the version check.
agents --help lists the commands, and agents <command> --help lists the flags of one command. agents --version prints the CLI version. In a terminal, agents with no command opens the home screen of the full-screen app. Without a terminal, it prints the help text on the error stream and exits with code 1.
Full-screen app
On an interactive terminal, agents with no command, agents init, and agents login run as one full-screen app. The app uses the alternate screen of the terminal, so your scrollback is unchanged while it runs.
- The top bar shows the CLI version, the signed-in account, and the current directory.
- The body shows the steps of the run with their state, and one main region for the active step: the sign-in URL, the output of the clone and the install, or the log of the dev server.
- The bottom bar shows what happens now, the elapsed or remaining time, and the keys that work.
| Screen | Keys |
|---|---|
| Home | ↑ ↓ or j k to move, Enter to run the command, q to quit |
| Sign-in | o to open the browser again, c to copy the sign-in URL, Ctrl-C to cancel |
| Clone, install | PgUp PgDn to scroll the output, Ctrl-C to cancel |
| Dev server | o to open the Builder, PgUp PgDn to scroll the log, q or Ctrl-C to stop the server and quit |
| Failure, confirmation | Enter to close |
The home screen lists the commands that work in the current directory. For each one it shows what the command does and the command line that runs it. init and login stay in the app. Every other command runs in line mode after the app closes.
When the app closes, it prints the record of the run in the normal screen: one line per finished step, then the summary or the failure with its next steps. A cancelled run prints the same messages as line mode, and the exit codes are the same.
The app follows the size of the terminal while it runs:
| Terminal size | Layout |
|---|---|
| 140 columns or more | Step list in a left column of 36 cells. The main region is at most 100 cells wide. |
| 100 to 139 columns | Step list in a left column of 30 cells. |
| 80 to 99 columns | One column. The step list is one line, for example Step 3 of 6 · Clone. |
| 60 to 79 columns, or fewer than 20 rows | One column, a top bar with the name and version only, and short key hints. |
A long URL or path is shortened with an ellipsis and stays in its own region. The output of a command keeps at least three rows.
Line mode
Line mode prints each step as a line and draws no screen. The CLI uses line mode in each of these cases:
- You pass
--no-tui, or theNO_TUIenvironment variable has a nonempty value other than0orfalse(case-insensitive). - The standard input or the standard output is not a terminal.
- The
CIenvironment variable is set, orTERMisdumb. - The terminal is smaller than 60 columns by 12 rows.
- The command runs with
--json.
agents init --no-tui
NO_TUI=1 agents loginCommands
| Command | Purpose |
|---|---|
init |
Create a project on the platform, clone it, and start it locally |
login |
Sign in to your account on this machine |
whoami |
Print the account this machine is signed in to |
logout |
Remove and revoke stored credentials |
git-credential |
The Git credential helper that the CLI registers |
scaffold |
Add Standard Agents to an existing Vite project |
support-files |
Write the local support files of a cloned project |
init-chat |
Create a chat front end for a running instance |
deploy |
Push the current branch and follow the platform build |
builds |
Read builds and build logs, and retry a failed build |
rollback |
Make an earlier production build live again |
redeploy |
Deploy the live production build again |
skill |
Install the coding skill for your coding agent |
current-models |
Print the current model guide |
available-models |
List the model IDs of one provider |
pack |
Pack an agent and its dependencies into a package |
unpack |
Unpack a packed agent into editable files |
list-packed |
List the packed agents in a project |
diag |
Diagnose a running instance |
terms |
Read and accept the Standard Agents terms |
Exit codes
| Code | Meaning |
|---|---|
0 |
The command did what it reports. |
1 |
The command failed, or a required step was not completed. The output names the cause and, where there is one, the command to run next. An unknown command or flag also exits with code 1. |
130, 143 |
You stopped init with Ctrl-C (130) or the process received a termination signal (143). |
deploy, builds, rollback, and redeploy share these codes. Their --help output lists them:
| Code | Meaning | Next step |
|---|---|---|
0 |
Done. For a wait: the build was deployed | None |
1 |
The build failed, or the platform refused the request | Read agents builds logs |
2 |
The command line, the checkout, or the named build is not usable | Read the message |
3 |
Not signed in, or the command needs an account sign-in | Run npx @standardagents/cli@latest login |
4 |
The platform needs the terms accepted before it builds | Run terms accept, then agents builds retry |
5 |
The time limit passed while the build was still in progress | Run agents builds status --wait, or raise --timeout |
terms uses codes 2 and 3 with its own meanings: a confirmation is needed and nothing was recorded (2), or you are not signed in (3).
Three results exit with code 0 although the work is not finished. Check the output for them in a script:
deployprintsOnly the push was verifiedwhen it cannot read the build. Seedeploy.deploy --no-waitreturns after the push and does not follow the build.unpackwithout a package name lists the packages and unpacks nothing.
JSON output
Every command writes errors and warnings to stderr, and status lines and results to stdout.
With --json, stdout holds exactly one JSON document, and status lines move to stderr. diag tail --json is the exception: it prints one JSON frame per line.
For available-models, list-packed, and the diag subcommands, a command that exits with a nonzero code prints a document with an error member. error.code and error.message are always present. An unknown command or flag, or a missing argument, prints the same document with the code usage_error whenever --json is among the arguments.
The other commands that accept --json print their own documents. The README of the @standardagents/cli package shows each document and lists the error codes.
Run without a terminal
Scripts, CI jobs, and coding agents have no interactive terminal. In that case a command that needs an answer exits with code 1 and names the flag to pass.
| Command | What to pass without a terminal |
|---|---|
init |
--no-open. The command prints the sign-in URL and waits until a person completes the sign-in in a browser, or until the session expires. |
login |
--bootstrap-stdin with the setup code on the standard input, which needs no browser. --bootstrap-file <path> and --bootstrap <code> do the same. --no-open prints the sign-in URL and waits instead. |
init-chat |
A project name, and either --yes or all of --framework, --instance-url, and --package-manager. The command then installs dependencies and exits without starting the dev server. |
pack |
The agent name, when the project has more than one agent. |
skill |
Nothing. It installs the agents target unless you pass --agent. |
rollback |
--yes. Without it the command exits with code 2 and changes nothing. |
terms accept |
--agree --terms-version <version> --privacy-version <version>, only after the person who is signed in says yes. See terms. |
Setting STANDARD_AGENTS_BROWSER=none has the same effect as --no-open for init and login.
STANDARD_AGENTS_BROWSER can also name the browser these two commands open: an application name on macOS and Windows ("Google Chrome"), or a command on Linux (firefox). When the browser cannot be opened, the command prints a warning, and waits while you open the printed sign-in URL yourself.
A headless sign-in, deployment, and result check:
# The setup code comes from the project's Overview page in the dashboard.
# Standard input keeps it out of the process list, where an argument is visible.
printf '%s' "$SETUP_CODE" | npx @standardagents/cli@latest login --bootstrap-stdin
# Exit code 0: the build is live. Exit code 1: the push or the build failed.
# Exit code 4: the terms need acceptance. Exit code 5: the wait timed out.
npx @standardagents/cli@latest deploy --timeout 600 --json
# One JSON document that describes the build of the checked-out commit.
npx @standardagents/cli@latest builds status --jsonPlatform API address
init, login, logout, builds, terms, and the Git credential helper use the first address that one of these names:
- The flag of the command:
--endpoint <url>or--api-url <url> STANDARD_AGENTS_API_URLPLATFORM_ENDPOINTSTANDARD_AGENTS_PLATFORM_URLhttps://api.standardagents.ai
The Git credential helper and builds read the same three variables from the .dev.vars of your project after the environment.
--endpoint and --api-url are two names for one option, and every command that takes a platform address accepts both. The help of init lists --api-url; the help of the other commands lists --endpoint. When a command line has both, the CLI uses --api-url.
The CLI sends your session or API key to this address, so the address must use HTTPS. Plain HTTP is accepted only for this machine: localhost, 127.0.0.1, or [::1]. For any other address the command exits with code 1 before it sends a request, and the message shows the https:// address to use. An address that contains a user name or a password is refused in the same way.
A request that carries your session, API key, or setup code is never redirected. When the platform answers with a redirect, the command stops and names the host. Check the platform address.
Request time limits
Each request to the platform, to an instance, or to the model guide ends after 30 seconds without a complete answer (15 seconds for each model guide address). The message names the host that did not answer and the command to run next. Waiting for a browser sign-in or for a build has its own limit: the lifetime of the sign-in session, or --timeout.
Where credentials are stored
| Location | What it holds | Written by |
|---|---|---|
.dev.vars in the project |
STANDARD_AGENTS_API_KEY (the project API key) and the platform address |
init, login |
The macOS Keychain, service standardagents-cli |
On macOS, the account session and the account API key of your sign-in for this machine | login |
auth-state.json in the CLI configuration directory |
The record of your sign-in for this machine. It also holds the account session and the account API key where the Keychain is not used | login |
| Global Git configuration | The credential helper and useHttpPath, both for git.standardagents.ai and git.standardagentbuilder.com only |
login |
| Git configuration of the cloned repository | The same credential helper, for that repository | init |
The CLI configuration directory is $XDG_CONFIG_HOME/standardagents when XDG_CONFIG_HOME is set. Otherwise it is ~/.config/standardagents on macOS and Linux, and %APPDATA%\standardagents on Windows.
The CLI writes .dev.vars and auth-state.json so that only your user can read them. Before each write to .dev.vars, the CLI adds .dev.vars and .agents to your .gitignore when Git does not ignore them. When Git tracks .dev.vars, the CLI writes no credential into it and prints the git rm --cached command that stops the tracking.
Your sign-in is saved once for the machine. No project file holds an account session. Releases through 0.45.5 saved a project session in .agents/bootstrap-session.json and in .dev.vars. No command reads those values any more, and logout removes them. If you signed in only with that project sign-in, run npx @standardagents/cli@latest login once.
On macOS, login keeps the account session and the account API key in the Keychain, and auth-state.json holds no secret. The secret never appears in the arguments of a process. On Linux and Windows the CLI supports no credential store, so auth-state.json holds both values, readable only by your user. The same file is used on macOS in two cases:
- The Keychain is not available, for example because it is locked in an SSH session.
loginsays so. - You set
STANDARD_AGENTS_CREDENTIAL_STORE=filewhen you runlogin.
A sign-in that an earlier release saved in auth-state.json keeps working. It moves to the Keychain the next time you run login on macOS. A sign-in saved from a desktop session is in the Keychain, which an SSH session cannot read until you run security unlock-keychain; whoami, terms, the build commands, and the credential helper say so. To use one sign-in from both, run login with STANDARD_AGENTS_CREDENTIAL_STORE=file.
The credential helper stores no password. Each time Git contacts a Standard Agents repository, the helper requests a short-lived token from the platform. It uses the project API key from the nearest .dev.vars first. When the platform refuses that key, the helper names it on the error stream and tries your sign-in for this machine.
These environment variables also sign the CLI in, and they take effect until you unset them: STANDARD_AGENTS_API_KEY, STANDARD_AGENTS_SESSION_COOKIE.
logout removes the stored credentials and revokes the ones that the platform can revoke.
When a build fails
deploy and builds status --wait exit with code 1 when a build fails, and they print the error message from the platform.
-
Read the build log:
agents builds logsWithout a build ID, the command reads the newest build of the checked-out commit. To choose another build, list the builds with
agents buildsand pass an ID. -
If the log shows an error in your project, correct it, commit, and deploy again:
agents deploy -
If the failure needs no change to your code, run the same build again and wait for its result:
agents builds retry --wait -
If production is broken after a build went live, make the earlier production build live again, then correct the code in a new commit:
agents rollback --yes --wait
deploy and builds use the project API key in .dev.vars, or your account sign-in from agents login. rollback and redeploy need the account sign-in, by an owner or admin of the account that owns the project. Without a stored sign-in or key, deploy reports Only the push was verified, and the other commands exit with code 3.
Exit code 4 means that the platform stored your push and waits for the terms. Run terms accept. An acceptance starts no build by itself: the command offers to start each deploy that waits, and agents builds retry starts one later.
The local build script of a project stops with a message. Builds run on the platform from your committed package.json and lockfile, so commit both.
Project commands
init
agents init [project-name]Creates a project on the Standard Agents platform and sets it up on your machine. The command prints a sign-in URL and opens your browser. After you sign in and create the project there, it clones the project repository into the current directory, writes .dev.vars, registers the Git credential helper for the repository, installs dependencies, and starts the dev server on 127.0.0.1. It stays attached to the dev server until you press Ctrl-C.
Before the install, init sets every Standard Agents Builder package in package.json to the latest release and prints that version. These packages ship together, so a project names each of them at the same exact version, with no ^ or ~. A lockfile that names an older release is updated by the install. @standardagents/sip has its own version and is not changed. A prerelease CLI, run as @next or @dev, uses its own version instead of the latest release. If npm does not answer within 10 seconds, init prints a warning and installs the versions already in package.json. Commit the changed package.json and lockfile.
project-name fills in the name field of the browser form.
The command also accepts hidden compatibility and contributor options: --local selects local scaffolding, --template <template> selects its Vite template (default: vanilla-ts), and -y / --yes skips its prompts. --workspace links local packages with pnpm. --bootstrap <code>, --bootstrap-stdin, and --bootstrap-file <path> accept a platform setup code.
| Flag | Effect |
|---|---|
--no-open |
Print the sign-in URL without opening a browser |
--no-dev |
Clone and configure the project without starting the dev server |
--package-manager <manager> |
Use npm, pnpm, yarn, or bun instead of the detected package manager |
--api-url <url> |
Platform API address. See Platform API address |
The command exits with code 1 when the dev server does not start or stops with an error. Your project stays cloned and configured, and the output ends with the commands that start the server again.
scaffold
agents scaffoldAdds Standard Agents to the Vite project in the current directory. It adds @standardagents/builder and @standardagents/spec to package.json, adds the builder() plugin to your vite.config, sets the registry for the @standardagents scope, adds the generated type files to tsconfig.json, and creates the agents/ directories with an AGENTS.md guide in each one.
scaffold does not install dependencies, sign you in, or write .dev.vars. The root AGENTS.md that it writes lists those remaining steps. It keeps your application files. Without --force it keeps an AGENTS.md that already exists, and it says how many kept guides differ from the current version.
| Flag | Effect |
|---|---|
--force |
Reset the builder() entry in vite.config to a call with no options, and replace existing AGENTS.md guides with the current versions. The command prints each replacement before it writes. It changes nothing else |
--json |
Print one JSON result on the output stream, with a status for each stage. Progress lines go to the error stream |
The command runs five stages: vite-config, package-json, registry-pin, guides, and tsconfig. It exits with code 1 when a stage fails. It names that stage and the command that resumes it, completes the other stages, and keeps the files that it wrote.
support-files
agents support-filesWrites the local support files of a project repository that you cloned yourself. init runs the same step for you. The command writes a package.json when the repository has none, adds local build and development directories to .gitignore, and sets the registry for the @standardagents scope. It keeps files that already exist.
| Flag | Effect |
|---|---|
--project-name <name> |
Project name for a package.json that the command creates |
--package-manager <manager> |
npm, pnpm, yarn, or bun |
--json |
Print one JSON result on the output stream, with a status for the support-files and registry-pin stages |
The command exits with code 1 when it cannot set the registry, after it prints the setting to add by hand.
init-chat
agents init-chat [project-name]Creates a React chat application in a new project-name directory. The application connects to a running Standard Agents instance. In a terminal, the command asks for the framework, the address of the instance, and the package manager. It then installs dependencies, starts the dev server of the chat application, opens the browser, and stays attached to the server.
Without a terminal, the command never asks. It needs project-name, and either --yes or a flag for each of the three values. It installs dependencies, prints the command that starts the dev server, and exits. It starts the server only when you pass --dev.
agents init-chat my-chat --yes
agents init-chat my-chat --framework nextjs --instance-url http://localhost:5173 --package-manager pnpm| Flag | Effect |
|---|---|
-y, --yes |
Ask nothing. Use Vite, http://localhost:5173, and the detected package manager for each value that has no flag. Needs project-name |
--framework <framework> |
vite or nextjs |
--instance-url <url> |
Address of the Standard Agents instance that the chat connects to. It must be an http or https URL |
--package-manager <manager> |
npm, pnpm, yarn, or bun |
--no-install |
Write the project, and do not install dependencies or start the dev server |
--dev |
Start the dev server and stay attached to it. This is the default in a terminal. It cannot be combined with --no-install |
--no-dev |
Do not start the dev server. This is the default without a terminal |
--no-open |
Do not open the browser when the dev server starts |
The command exits with code 1, before it creates anything, when a value is missing or not supported, or when the directory already exists. It also exits with code 1 when the installation fails. When the dev server exits with an error, the command exits with the same code.
Account commands
login
agents login
agents login --bootstrap-stdinSigns you in to your Standard Agents account. It is the one sign-in command, and it works in any directory. It never creates a project.
The command prints the sign-in URL, opens your browser, and waits until you approve the sign-in. Ctrl-C cancels the sign-in on the platform too. The command then does these things:
- It saves one sign-in for this machine: an account session and a long-lived account API key.
terms,builds,deploy,rollback,redeploy, and Git all use it, in every directory. - It registers the credential helper in your global Git configuration for
git.standardagents.aiandgit.standardagentbuilder.comonly. - Inside a project that has no project API key, it saves that key in
.dev.vars. The local instance needs the key before you can sign in to it with your account. An existing key is kept.
The command finds the project from the Git remote of your checkout, or from a setup code that names the project. The setup code comes from the project's Overview page in the dashboard. When the command cannot get a project API key, it says why, and the sign-in for the machine is still saved.
| Flag | Effect |
|---|---|
--bootstrap-stdin |
Sign in with a setup code from the project's Overview page, read from the standard input. Needs no browser |
--bootstrap-file <path> |
Read the setup code from a file |
--bootstrap <code> |
The setup code as an argument. Other users of the machine can read an argument in the process list, so prefer the two flags above |
--endpoint <url> |
Platform API address. The default is https://api.standardagents.ai |
--no-open |
Print the sign-in URL without opening a browser. Required without a terminal when you pass no code |
--no-config |
Save the sign-in and leave the global Git configuration unchanged |
--helper-command <command> |
The credential helper command to register in the global Git configuration, in place of the default |
Pass the setup code one way. The command exits with code 1 when it receives two, or when the file or the standard input holds no code.
When the project still has a published default admin password and the command cannot save a project API key, the command replaces the password with a random one. It saves the new password as SUPER_ADMIN_PASSWORD in .dev.vars and does not print it.
The registered helper command names the CLI release that ran login: npx -y @standardagents/cli@<version> git-credential. Git therefore never starts a release that you did not run yourself. Run login again after you update the CLI to register the new release. init registers the helper of its own release in the cloned repository in the same way.
The command sets useHttpPath for the two Standard Agents hosts, because one host serves many repositories. Releases through 0.45.5 set credential.useHttpPath for every Git host. The command removes that global value when your global Git configuration has no other credential setting. Otherwise it leaves the value and prints the command that removes it.
The sign-in includes an account API key that does not expire, so Git and the build commands keep working after the browser session ends. When you run login again as the same user of the same account, the command keeps that key. When the saved key belongs to another user, account, or platform, the command revokes it before it creates a new one. The number of active keys for the machine therefore stays at one. A key that could not be revoked is named in a warning.
agents git-login is an earlier name of this command. It accepts the same flags and does the same work.
whoami
agents whoami
agents whoami --jsonPrints the user, the account, and the platform address of the sign-in that login saved on this machine. The command reads the saved sign-in and sends no request, so it works offline. It never prints the session or the key.
| Flag | Effect |
|---|---|
--json |
Print one JSON document: ok, endpoint, account, user, credential (api_key, session, or unreadable), and signed_in_at |
The command exits with code 0 when a sign-in is saved. When the Keychain does not return the saved session and key (for example in an SSH session), the command still prints the account, reports the credential as unreadable, and names security unlock-keychain. It exits with code 3 when there is none, and names the login command. With --json that result is { "ok": false, "error": { "code": "NOT_SIGNED_IN", "message", "fix" } }.
logout
agents logoutRemoves every stored credential: your sign-in for this machine and STANDARD_AGENTS_API_KEY in the nearest .dev.vars. It also removes a project session that a release through 0.45.5 saved. It then revokes the project API key, the account API key of this machine, and the account session on the platform, which also signs you out of the dashboard. The output lists what the command removed, what it revoked, and what still works.
Each API key revokes itself, so the command needs no session for it. A platform that has no route for this reports the project API key as still valid; the key is gone from this machine, and you revoke it under API keys in the dashboard. Credentials in environment variables stay until you unset them.
| Flag | Effect |
|---|---|
--org <org-id-or-slug> |
Limit the removal of organization sessions that early releases saved to one organization |
--endpoint <url> |
Platform API address for a project session from an earlier release whose .dev.vars names none |
--json |
Print only the result as JSON on the output stream: ok, removed, revoked, and remaining. ok is false when the exit code is 1 |
The command exits with code 1 when a credential on this machine still works or a revocation failed. The local credentials are removed in both cases.
git-credential
agents git-credential <operation>The credential helper that init and login register. Git runs it; you do not need to. It follows the Git credential helper protocol: Git writes the request to the standard input, and the helper prints a user name and a short-lived password.
The helper answers the get operation for HTTPS requests to git.standardagents.ai and git.standardagentbuilder.com. It prints nothing for other hosts and other operations, so your other credential helpers keep working. When it has no credential for a Standard Agents host, it prints the login command on the error stream.
The helper requests a token that can only read for git clone, git fetch, git pull, and git ls-remote, and a token that can also write for every other command. Git does not tell a credential helper which command runs, so the helper reads it from the git process that started it. When it cannot, it requests a write token, as earlier releases did for every command. STANDARD_AGENTS_GIT_TOKEN_SCOPE=write (or read) sets the scope yourself.
The helper reads .dev.vars as the local runtime reads it, so quoted values, export lines, and comments are understood.
| Flag | Effect |
|---|---|
--endpoint <url> |
Platform API address |
Deployment commands
deploy
agents deployPushes the checked-out commit to the branch of the same name on the origin remote, then follows the platform build of that commit and reports the result. The command does not use push.default or the upstream setting of the branch. It exits with code 2 when the remote is not a Standard Agents repository, or when no branch is checked out and you pass no --branch.
A push to the default branch deploys to production. A push to another branch deploys a preview.
When the remote branch already has the commit, the command pushes nothing and reads the existing build of that commit.
| Flag | Effect |
|---|---|
--no-wait |
Push and return without following the build |
--timeout <seconds> |
How long to follow the build. The default is 900 |
--remote <name> |
Git remote to push to. The default is origin |
--branch <name> |
Remote branch to push to. The default is the checked-out branch |
--json |
Print one JSON document on the output stream. Every other line goes to the error stream |
--project <id> |
Project ID, when the project cannot be found from the pushed remote |
--endpoint <url> |
Platform API address. The default is the address of the project, then https://api.standardagents.ai |
| Exit code | Result |
|---|---|
0 |
The build is live |
0 |
The output says Only the push was verified: the command could not read the build. Sign in with agents login, then run agents builds status |
0 |
With --no-wait: the push was accepted and the build was not followed |
1 |
The push failed, the build failed or was cancelled, or no build started |
1 |
The push printed lines that start with remote: Standard Agents:, for a reason other than the terms. The platform stored the push and started no build |
2 |
The remote, the branch, or --timeout is not usable |
4 |
The platform stored the push and needs the terms accepted before it builds. Run terms accept |
5 |
The wait reached the timeout while the build was still in progress |
builds
agents builds # recent builds, newest first
agents builds status [build] # one build and its error message
agents builds logs [build] # the log of one build
agents builds retry [build] # run a failed build again without a new commit[build] is a build ID or a unique prefix of a build ID. A commit prefix selects its newest build when all matches belong to one commit. Without it, status and logs use the newest build of the checked-out commit, or the newest build when that commit has none. retry uses the newest build of the checked-out branch, when that build failed.
| Command | Flag | Effect |
|---|---|---|
builds |
--limit <n> |
How many builds to list. The default is 10 |
builds status |
--commit <sha> |
Show the newest build of this commit |
builds status, builds retry |
--wait |
Wait for the build to finish. Exit with code 0 only when it was deployed |
builds status, builds retry |
--timeout <seconds> |
How long --wait waits. The default is 900 |
builds logs |
--follow |
Stream the log of a build that is still running |
| All four | --json |
Print one JSON document on the output stream |
| All four | --project <id> |
Project ID, when the project cannot be found from the origin remote |
| All four | --endpoint <url> |
Platform API address |
These commands use the project API key in .dev.vars, or your account sign-in. They exit with the shared codes.
rollback
agents rollback [build]Makes an earlier production build live again. Without [build], the target is the production build that was live before the current one. The command accepts only a production build that was live earlier.
The command asks for confirmation in a terminal. Without a terminal it changes nothing and exits with code 2 unless you pass --yes. It needs an account sign-in from agents login; a project API key is not enough.
| Flag | Effect |
|---|---|
--yes |
Do not ask for confirmation |
--wait |
Wait for the build to finish. Exit with code 0 only when it was deployed |
--timeout <seconds> |
How long --wait waits. The default is 900 |
--json |
Print one JSON document on the output stream |
--project <id> |
Project ID, when the project cannot be found from the origin remote |
--endpoint <url> |
Platform API address |
redeploy
agents redeployDeploys the live production build again, so that changed environment values take effect. No build runs. The command needs an account sign-in from agents login.
| Flag | Effect |
|---|---|
--json |
Print one JSON document on the output stream |
--project <id> |
Project ID, when the project cannot be found from the origin remote |
--endpoint <url> |
Platform API address |
Model commands
current-models
agents current-modelsPrints the current model guide as Markdown. The command requests https://standardagentspec.org/models.md first, and https://standardagentspec.com/models.md when the first request fails. It needs no project and no sign-in.
| Flag | Effect |
|---|---|
--url <url> |
Request this address instead |
The command exits with code 1 when no address returns the guide. An address that does not answer within 15 seconds counts as failed.
available-models
agents available-models --provider=openaiLists the model IDs of one provider as a Markdown table. Run it from a project with its dependencies installed. The command uses the provider's own key when the project has one. Otherwise it uses the account key of the project, STANDARD_AGENTS_API_KEY.
| Flag | Effect |
|---|---|
--provider <provider> |
An installed provider package such as openai, or a provider defined in agents/providers/. Required when more than one provider is usable |
--json |
Print the provider and its models as one JSON document. The document never contains a key. See JSON output |
The command exits with code 1 when a key is missing, the request fails, or the provider returns no models. It also exits with code 1, before any request, when the account key would go to a platform address that is neither HTTPS nor on this machine.
Coding agent commands
skill
agents skillInstalls the agentbuilder skill for your coding agent. In a terminal, the command asks which target to install. See @standardagents/skill for what the skill covers.
| Flag | Effect |
|---|---|
--agent <target> |
agents installs into ~/.agents/skills, which Codex, Cursor, Gemini CLI, GitHub Copilot, and OpenCode read. claude installs into ~/.claude/skills |
--dir <path> |
Install into this directory instead |
--force |
Replace an installed copy |
--agent codex is an alias of --agent agents. The command exits with code 1 when the skill is already installed without --force.
Packing commands
Run these commands from the root of a project with its dependencies installed. They use the Standard Agents Builder that the project installs. Without it, each command prints the install command and exits with code 1.
pack
agents pack [agent-name]Packs an agent and everything it depends on into a package in agents/packed/. The command then removes the original files that only that agent uses, and it lists those files before it removes them. It keeps files that another agent also uses.
| Flag | Effect |
|---|---|
--output <dir> |
Output directory. The default is agents/packed |
--npm |
Write a package structure that npm can publish |
--version <version> |
Package version. The default is 1.0.0 |
--no-remove |
Keep every original file |
--no-interactive |
Never prompt. agent-name is then required when the project has more than one agent |
unpack
agents unpack [package]Copies a packed agent into editable files under agents/. Without package, the command lists the packages that it found and exits with code 0. It has no flags.
list-packed
agents list-packedLists the packed agents in agents/packed/ and in the installed packages of the project, with their version, source, and entry agent.
| Flag | Effect |
|---|---|
--json |
Print the packages as one JSON document. See JSON output |
Diagnostic commands
diag
agents diag instance
agents diag threads
agents diag thread <id>
agents diag logs <thread> [logId]
agents diag tail <thread>
agents diag revive <thread>Diagnoses a running instance: a local dev server or a deployed project. These commands read the request logs of an instance. Build logs are in builds.
| Command | Purpose |
|---|---|
diag instance |
The Builder version of the instance, its watchdog settings, and configuration warnings |
diag threads |
Recent threads and the state of their execution |
diag thread <id> |
One thread: execution state, open requests, alarms, and watchdog history |
diag logs <thread> [logId] |
The recent request logs of a thread, or one log in detail |
diag tail <thread> |
Stream the logs of a thread until you press Ctrl-C |
diag revive <thread> |
Run a watchdog check now. It closes lost requests and resumes a thread that is stuck. This command changes the thread |
<id> and <thread> accept the start of a thread ID.
| Command | Flag | Effect |
|---|---|---|
| All six | --endpoint <url> |
Address of the instance. The default is STANDARD_AGENTS_INSTANCE_URL, then http://localhost:5173 |
| All six | --token <token> |
API key or session token of the instance. Set STANDARD_AGENTS_INSTANCE_TOKEN in place of this flag: other users of the machine can read an argument in the process list. A deployed instance needs a key with the logs permission |
| All six | --json |
Print JSON on stdout only: one document, or for diag tail one frame per line. See JSON output |
diag threads |
--stuck |
Show only threads with an open request that was not recovered. The command exits with code 1 when it could not read a thread, because that thread could be the stuck one |
diag threads |
--limit <n> |
How many recent threads to read, from 1 to 100. The default is 25 |
diag logs |
--limit <n> |
How many logs to list, from 1 to 100. The default is 10 |
Each command prints one line that starts with diag: on stderr and exits with code 1 when the instance cannot be reached, does not answer within 30 seconds, or refuses the request. A --token is sent only to an HTTPS instance address, or to plain HTTP on this machine; any other address exits with code 1 before a request. A request with a token is not redirected. diag tail exits with code 0 when the stream closes normally, and with code 1 when the connection fails or closes abnormally.
Terms commands
terms
agents terms
agents terms acceptterms shows the Terms of Service and the Privacy Policy that are in force: each title, version, and URL, and whether you accepted that version. terms status does the same.
terms accept shows the same documents and the acknowledgement sentence, then asks for your confirmation. An acceptance starts no build. The command lists each deploy that waits and asks whether to start it; with --agree it starts them without a second question. To start one later, run agents builds retry in its project on the branch that you pushed.
Both commands use the sign-in that login saved on this machine, so they work in any directory. An API key cannot accept terms, because acceptance belongs to a person.
Without a terminal, terms accept records nothing and exits with code 2. It prints the two links, the acknowledgement sentence, and the command that accepts those versions. A coding agent shows you the links and the sentence, and runs that command only after you say yes. When a document changed after you reviewed it, the command records nothing, exits with code 2, and prints the current documents.
| Flag | Effect |
|---|---|
--json |
Print one JSON object and never prompt. terms accept --json still needs --agree |
--endpoint <url> |
Platform API address. The default is the address of your saved sign-in |
--agree |
terms accept only: accept without a prompt. It needs both version flags |
--terms-version <version> |
With --agree: the Terms of Service version that you reviewed |
--privacy-version <version> |
With --agree: the Privacy Policy version that you reviewed |
| Exit code | Result |
|---|---|
0 |
Success, including when you already accepted the current documents or there are none to accept |
1 |
The command failed |
2 |
A confirmation is needed. Nothing was recorded |
3 |
You are not signed in |
Generate types
The dev server generates the type files of a project. It writes .agents/types.d.ts and .agents/virtual-module.d.ts when it starts, and again after each change under agents/:
npm run devStart the dev server once before you run the type checker in a new project. The type checker reports missing type files until then. There is no separate type-generation command.