Add --agent to any okibi command when a script or a coding agent runs it:
okibi --agent clis show my-cli--agent turns on three things at once:
- No prompts. okibi never stops to ask a question. Steps that need a person in a browser, such as
okibi auth publisher, returnapproval_requiredwith the URL to open. - JSON output wherever the command supports it.
- Structured errors, so a failure can be read as data instead of scraped from text.
Most listing and management commands also accept --json on its own, for JSON without the other two.
Exit codes
| Code | Meaning |
|---|---|
0 | The command succeeded |
1 | The command failed |
With --agent, a failure prints JSON to stdout:
{"ok": false, "error": "…"}Without --agent, the error is plain text on stderr.
okibi generate and okibi regenerate exit 1 when the build fails. Their JSON still carries the build, and build.failure.actions lists the commands that take it on. okibi status <run-id> --json prints the build object without the build wrapper, so the same list is failure.actions there.
With --agent or --json, generate and regenerate don't download the CLI. Run okibi pull <run-id> once okibi status says it succeeded.
Run okibi in CI
- Create a workspace-locked key with
okibi keys create --name ci --workspace acmeand store it as the secretOKIBI_API_KEY. See Log in. - Install okibi in the job and run commands with
--agent:
curl -fsSL https://okibi.ai/install | sh export PATH="$HOME/.local/bin:$PATH" okibi --agent generate --repo https://github.com/OWNER/REPO --name my-cli
--no-wait starts the build and returns its run id at once; follow it later with okibi --agent status <run-id>. Set OKIBI_NO_AUTO_UPDATE=1 to pin the installed version for the job.
To rebuild an existing CLI from CI, use okibi --agent regenerate my-cli. To rebuild on every push instead, turn on auto-generate.
Things that always need a human
- Deleting a CLI.
okibi clis deleterefuses to run with--agent. A person must type the CLI name in a terminal. - Logging in. The first login opens a browser or prints a device code.
- Paid plan changes.
okibi billing changeneeds--yes, which confirms the charge. - Questions from the project chat. When
okibi studio chat --textends with aquestion, the agent waits for an answer only the interactive chat can take. The command exits non-zero; a person answers it withokibi studio chat my-cli.
Commands that change something ask first in a terminal. In agent mode they need --yes instead, for example okibi runs cancel <run-id> --yes and okibi migrate my-cli --yes.
