Skip to content
⌘K

The okibi CLI

Agent and CI mode

Run okibi without prompts, read its JSON, and handle its errors in scripts and agents.

Add --agent to any okibi command when a script or a coding agent runs it:

Terminal
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, return approval_required with 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

CodeMeaning
0The command succeeded
1The command failed

With --agent, a failure prints JSON to stdout:

JSON
{"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

  1. Create a workspace-locked key with okibi keys create --name ci --workspace acme and store it as the secret OKIBI_API_KEY. See Log in.
  2. Install okibi in the job and run commands with --agent:
Terminal
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 delete refuses 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 change needs --yes, which confirms the charge.
  • Questions from the project chat. When okibi studio chat --text ends with a question, the agent waits for an answer only the interactive chat can take. The command exits non-zero; a person answers it with okibi 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.