Skip to content
Opod

Core CLI

CLI overview

Every opod command at a glance, and the conventions all of them share — help, JSON output, prompts, pickers, keys and colour.

In short

opod is one binary. opod up starts a leader and opod join adds a worker; every other command manages them. Every command prints its own help with --help.

opod node ls --help
opod version
opod 0.21.0 (linux/amd64, go1.26.4)

opod is the only binary. Every capability is a command, and most commands call an /admin/v1 route you can also script.

opod <command> [options]
opod <command> --help

Commands

CommandDoes
opod upStart a leader, a front door (--role gateway) or a cell door (--role door).
opod downStop the local leader and unload its engine's models.
opod statusShow the local leader, engine and installed models.
opod joinJoin a cluster as a worker.
opod nodels, show, drain, undrain, remove.
opod modeladd, ls, ps, search, info, load, unload, move, remove.
opod shardcreate, ls, remove gangs.
opod tokencreate, ls, expire, renew, revoke API keys.
opod catalogls and export the embedded catalog.
opod fetchDownload one GGUF or a safetensors snapshot into a models directory.
opod cachels, prune the weight cache; kv-prune a disk KV tier.
opod imagels, show, recommend the published container images.
opod batchrun an OpenAI batch file against any OpenAI-compatible URL.
opod connectPrint client settings for a tool; disconnect prints how to undo them.
opod configshow, path, edit.
opod doctorDiagnose the local setup.
opod updateInstall the latest or a pinned release. upgrade is an alias.
opod completionPrint a bash, zsh or fish completion script.
opod versionPrint the version, or the leader's feature keys.
opod helpPrint the command list. Also --help and -h.

Shared conventions

Help. --help or -h anywhere in the arguments prints the command's usage, flags and examples, and exits 0. The word help counts only as the first argument, so opod model search help searches for "help". A wrong flag prints the help to stderr and exits 2. From core v0.4.6, a usage error is three lines on stderr instead — opod: <what is wrong>, the command's usage line, and opod <command> --help for every flag — and opod help <command> is opod <command> --help. The commands that parse their flags by hand (model, shard, node, token, join) list them in a Flags section of their help.

Typos. An unknown command or sub-command prints a "Did you mean …?" suggestion when one is close.

Aliases. ls = list in node, model, shard, token and image (not in catalog or cache). remove = rm in node, model and shard. image show = image info, image recommend = image for. model add --node = --nodes. upgrade = update. version = --version = -v.

Flags. Flags may come before or after positional arguments. Both --flag value and --flag=value work.

JSON. --json prints machine-readable output on status, model ls|ps|search|info, config show, cache ls|prune|kv-prune and image ls|show|recommend. node ls has no --json; node show prints JSON always.

Prompts. model remove, node remove and shard remove ask for confirmation. --yes or -y skips the prompt for scripts. Without a terminal they printed opod: aborted; from core v0.4.6 they say no terminal to confirm opod node remove n_one on — run opod node remove n_one --yes and exit 2.

Pickers. model add, info, remove, load, unload and connect open an interactive picker (type to filter, arrow keys, Enter) when the id is missing or unknown and the terminal is interactive. Without a terminal they printed opod: no model selected; from core v0.4.6 they name the fix — no catalog entry "X" (try: opod model search X), "X" is not installed on this host (see opod model ls), model add needs a catalog id … — and model load checks its flags before it would ask.

Colour. Output is coloured on a terminal. NO_COLOR=1 or OPOD_NO_COLOR=1 turns colour off. Before, the ▶ ✔ ⚠ markers kept their colour codes in a pipe or a file; from core v0.4.6 each stream is coloured only when it is a terminal.

Warnings. From core v0.4.6, every warning (⚠ …) goes to stderr, so opod status > s.txt or opod doctor | grep carries only the answer; before, status, doctor, up, join, model add and others printed them on stdout.

Secrets on a pipe. A command that prints a key (opod up on first run, opod token create) warns on stderr when stdout is not a terminal, because the key may land in a log. The key still goes to stdout, so key=$(opod token create …) works.

Where commands act

Most commands run on the leader host and use its local state:

Reads or writesCommands
the local store (storage.dsn) and the local engine directlytoken *, model add (without --node), model ls, model remove, node ls, node show, status
the running leader's admin API, with ~/.opod/admin.keymodel add --node, model load, model move, model ps, shard *
the leader first, then the store or engine if no leader answersnode drain, node undrain, node remove, model unload (from core v0.4.6: only when this host's own leader does not answer — a leader that answers with any error, even a 500 with no body, is final, and an OPOD_BASE_URL leader never falls back to this host's store)
nothing but the local machinefetch, cache, catalog, image, doctor, completion, version

The admin calls go to http://localhost<listen> with the key in ~/.opod/admin.key. From 0.3.0 they go to the leader's own address — its listen host (an empty or 0.0.0.0 host is localhost), over https when it serves TLS, trusting its own certificate file; on 0.2.1 a listen with a host, or a TLS leader, breaks them. They fail with no admin key on disk … is opod up running on this host? elsewhere.

From core v0.4.6, an admin call goes to OPOD_BASE_URL when it is set, with the key in OPOD_TOKEN when it is set — so these verbs reach a leader on another host — else to this host's leader with ~/.opod/admin.key. Each failure says what to do:

What happenedWhat it prints
the leader refused the key (401, 403)the leader at <url> refused the admin key from <source> (<its message>) — run this on the leader's host, or set OPOD_TOKEN to an admin key
no key hereno admin key: none at ~/.opod/admin.key and OPOD_TOKEN is not set — …; from core v0.4.6, … and neither OPOD_TOKEN nor OPOD_ADMIN_TOKEN is set — …
a certificate that is not the leader's own (from core v0.4.6)the leader at <url> answered, but it presented a certificate that is not the one in <tls_cert> — check tls_cert and OPOD_TLS_CERT on this host
nothing answeredno leader answering at <url> (<where the address came from>): <cause> — start it with opod up, or set OPOD_BASE_URL to the leader's URL
the leader answered an error<METHOD> <path>: the leader answered HTTP <code>: <its message> [<type>]; a body that is not the leader's JSON (a proxy page) or an empty one says so
the client budget ran outgave up after 45m0s waiting for <METHOD> <path> at <url> — the leader may still be working on it; check with opod status
OPOD_BASE_URL=https://leader.example.com:8080 OPOD_TOKEN=sk-orc-<admin key> opod shard ls

From core v0.4.6, three more rules hold. They matter most for a leader that a manager runs (OPOD_MANAGED=1, for example in a Kubernetes pod), which has no key file:

  • The key. After OPOD_TOKEN, an admin call uses the admin token the leader was started with (OPOD_ADMIN_TOKEN, or auth.admin_token in the config), and only then ~/.opod/admin.key.
  • The certificate. Over TLS, the CLI accepts exactly the certificate in the leader's own tls_cert file, byte for byte, whatever names it carries. A certificate issued for the leader's service name, and not for localhost, now works. Any other certificate is an answer from a leader, never "no leader answering", so no command falls back to the store because of it.
  • The store. On a managed host with no OPOD_STORAGE_DSN, the leader's store lives only inside the running opod up. opod node ls and opod node show ask the running leader. Every command that would read or write the store itself (model ls, token ls, token create, …) refuses instead of opening an empty store:
opod: this host's leader is managed (OPOD_MANAGED=1): its store lives only inside the running `opod up`, so there is nothing on this host to read or change — `opod node ls`, `opod node show`, `opod shard ls` and `opod model ps` ask the running leader; make any other change through the leader's manager

Up to core v0.4.5, on such a host node ls printed (no nodes registered yet …) beside a serving worker, and shard ls printed no admin key.

Calls that move weights (shard create, model add, model load) wait up to 45 minutes; other admin calls wait up to 5 minutes.

Configuration file

Every command reads ~/.opod/config.yaml when it exists, then environment variables. opod up --config PATH reads another file. See Configuration.

Exit codes

CodeMeaning
0Success, or --help.
1The command failed; the message is on stderr, prefixed opod:.
2Usage error: missing argument, bad flag, unknown command or subcommand. From core v0.4.6 every one of them exits 2 with an opod: line; before, some exited 1 (join with no URL, node show with no id, connect a b, connect --retries 9, an unknown subcommand, a non-numeric --tp), completion with no shell printed its help and exited 0, and cache, fetch, catalog and batch said error:.
75opod batch run stopped and can be resumed.

Last updated · Source: content/docs/core-cli/index.mdx · View as Markdown