CLI Reference

Use this reference to launch sessions, configure Octomind, and automate workflows from your shell. It covers every CLI

Use this reference to launch sessions, configure Octomind, and automate workflows from your shell. It covers every CLI argument, including hidden internal commands.

Synopsis

bash
octomind [COMMAND]
octomind COMMAND --help

Options belong after their subcommand; there are no inherited application options. Boolean switches default to false, optional values to unset, and repeatable options to an empty list unless stated otherwise.

The subcommand is optional. Bare octomind behaves as octomind run with the configured default tag.

CommandPurpose
runStart an interactive or non-interactive AI session (the main command).
loginSign in to an Octomind account and store the minted OctoHub key.
serverStart a WebSocket server for remote sessions. See WebSocket Server.
acpRun as an Agent Client Protocol agent over stdio for editor integration. See ACP Protocol.
configCreate, validate, display, or upgrade configuration. See Config Reference.
tapAdd a registry tap (agent source), list active taps, or scaffold a new tap with tap init.
untapRemove a previously added tap.
varsShow placeholder variables and their resolved values.
sendInject a message into a running named session.
workflowList tap workflows or run one by name/local TOML file. See Workflows.
completionGenerate shell completion scripts.
completeHidden: print cached completion candidates.
distillHidden: extract memories from a disposable transcript snapshot.
help [COMMAND]...Clap-generated help, including nested commands such as help tap init.

The global config file lives at ~/.local/share/octomind/config/config.toml on macOS and Linux (%LOCALAPPDATA%\octomind\config\config.toml on Windows). Override the load path with OCTOMIND_CONFIG_PATH, or relocate the data tree with OCTOMIND_DATA_DIR. See Environment Variables for load/save path differences.

TAG resolution

run, server, and acp take an optional TAG:

  • A role name (e.g. assistant) — matched against [[roles]] in your config.
  • A registry agent tag in category:variant form (e.g. developer:general) — resolved through your installed taps.
  • Omitted — uses the default tag from config.

Model resolution priority, highest first: explicit runtime override > role profile > tap name mapping > the required main [model].

Only run and workflow accept --format; neither restricts its value through clap. jsonl selects JSON Lines; other strings use the ordinary output path.

octomind login

Sign in through the browser-confirmed device flow and store the minted OctoHub key in Octomind's environment file.

FlagDescription
--forceSign in again even when the current machine already has an account session.
--no-browserPrint the confirmation URL instead of attempting to open it.
bash
octomind login
octomind login --force --no-browser

octomind config [OPTIONS]

Create, validate, display, or upgrade configuration. With no flags, see the example note below.

Loading happens before command dispatch and may create or migrate config even with --show or --validate.

Mutating flags (apply changes, then save to the loaded config path):

FlagDescription
--model MODELSet root-level model (provider:model format).
--log-level <none|info|debug>Set the log level (case-insensitive); any other value errors.
--mcp-providers <a,b,c>Replace the MCP server list: clears all configured servers, then adds each named one as a builtin server (timeout 30s).
--mcp-server <name,key=value,...>Add or update one MCP server. See the --mcp-server format details below.
--system TEXTWrite/reset the legacy root system field. Current session prompts come from [[roles]].system, so prefer editing the role instead.
--markdown-enable BOOLEnable or disable markdown rendering.
--markdown-theme THEMESet the markdown theme (must be one of the themes from --list-themes).

Inspect / maintenance flags:

FlagDescription
--showDisplay a selected summary (model, logging, rendering, roles, credentials, and MCP), not a full TOML dump.
--validateValidate the configuration without making changes.
--list-themesList the available markdown themes.
--upgradeUpgrade and rewrite the standard config file when migration is needed.

Note on --api-key: the parser accepts an --api-key provider:key argument, but the mutation path rejects it at runtime — API keys can never be stored in the config file for security reasons. Set the provider's environment variable instead, using the credential example in Environment Variables. See Environment Variables for credential variables.

Inspection precedence is --list-themes, --show, --validate, then --upgrade; the first matching mode returns before mutations (including the --api-key rejection). Value options take one value. --markdown-enable requires true or false; --system default clears the legacy prompt.

bash
octomind config --model octohub:auto --log-level debug
octomind config --markdown-enable true --markdown-theme dark
octomind config --system default
octomind config --mcp-providers core,runtime,orchestration,agent
octomind config --upgrade

--api-key PROVIDER:KEY has no short flag and takes one string; use environment credentials instead.

--mcp-server format

--mcp-server name,key=value,... — the first comma-separated token is the server name; the rest are key=value pairs:

KeyMeaning
typehttp, stdio, or builtin (default http).
urlEndpoint URL — required for http.
commandExecutable to launch — required for stdio.
argsSpace-separated arguments for a stdio command.
timeout / timeout_secondsPer-operation timeout in seconds (default 30); tool-call progress resets the idle deadline.
bash
# HTTP server
octomind config --mcp-server "search,url=http://localhost:9000,timeout=60"

# stdio server
octomind config --mcp-server "files,type=stdio,command=octofs"

Examples:

bash
# Create a default config (only if none exists; otherwise reports
# the current state with no changes — it does NOT regenerate).
octomind config

# Show current settings
octomind config --show

# Validate config
octomind config --validate

# List themes
octomind config --list-themes

octomind run [TAG]

Start an interactive or non-interactive AI session.

FlagShortDescription
TAGRole name (e.g. assistant) or registry agent tag category:variant (e.g. developer:general). Uses the default tag if omitted.
--name NAME-nCreate a named session, or resume it if it already exists.
--resume [SESSION]-rResume by name; in an interactive TTY, bare --resume opens the recent-session picker
--resume-recentResume the most recent session for the current directory
--format FORMATOutput mode: use plain or jsonl. Unset by default; non-jsonl strings take the plain path.
--model MODEL-mOverride model (provider:model format)
--daemonKeep the session alive for injected messages. Pair with --format jsonl for headless use; TTY use remains interactive-capable.
--sandboxRestrict filesystem writes to the working directory. See Sandbox.
--hook NAMEActivate webhook hook(s) by name (defined in [[hooks]] config). Repeatable. See Daemon & Hooks.
--schema PATHPath to a JSON Schema object file. Constrains the model's output to match it (structured output). The resolved model must support structured output, or the run fails fast. See note below.

Interactivity and --format: --format is unset by default. If it is omitted and stdin is a TTY, the session runs interactively. If --format is given (plain or jsonl) or stdin is piped, the session runs non-interactively, reading the input from stdin. Internally, an unset format resolves to plain.

run has no message argument: its only positional argument is TAG. With --format, a non-daemon run requires nonempty piped stdin; a TTY produces an error. Resuming without an explicit tag restores the saved role.

Daemon mode: --daemon keeps the session alive after a turn. Pair it with --format jsonl for a headless event stream. When attached to a TTY without --format, startup uses an empty initial input and the terminal stays interactive. Inject further messages with octomind send --name <name>.

Structured output (--schema): pass a path to a JSON Schema object file to constrain the model's output. The schema applies to every assistant reply for the session's lifetime — across multi-turn sessions, resumes, and daemon mode — while tool calls still flow normally underneath. If the resolved model reports no structured-output support, the run fails before the provider request. The schema is a runtime-only override and is not persisted, so pass it again when resuming. Most useful with --format jsonl. A ready-to-use example ships at config-templates/todos.schema.json.

Examples:

bash
# Interactive session with the default tap agent
octomind run

# Explicit default tap agent
octomind run assistant:concierge

# Registry agent (category:variant)
octomind run developer:general

# Non-interactive: pipe message via stdin
echo "Explain the auth module" | octomind run assistant:concierge --format plain

# Named session
octomind run --name feature-auth

# Resume session
octomind run --resume feature-auth
octomind run --resume-recent

# Daemon mode with webhook
echo "Wait for build events" | octomind run --name ci-watcher --daemon --format jsonl --hook github-push

# Main-purpose model override
octomind run -m anthropic:claude-sonnet-4-6

# Structured output — constrain replies to a JSON Schema (structured-output models only)
echo "List the top 3 TODOs" | octomind run developer:general --format jsonl --schema config-templates/todos.schema.json

octomind server [TAG]

Start a WebSocket server for remote AI sessions.

FlagShortDescription
TAGRole name or registry agent tag category:variant
--host HOSTBind address (default: 127.0.0.1)
--port PORT-pPort (default: 8080)
--sandboxRestrict filesystem writes to the working directory. See Sandbox.
--allow-origin ORIGINPermit a browser Origin header; repeatable. Unlisted origins are rejected, while native clients without Origin do not need an entry.

Examples:

bash
octomind server
octomind server --host 0.0.0.0 --port 9090
octomind server developer:general --sandbox
octomind server --allow-origin http://localhost:3000

octomind acp [TAG]

Run as Agent Client Protocol agent over stdio (for editor integration).

FlagShortDescription
TAGRole name or registry agent tag category:variant
--name NAME-nSession name (used when client creates a session)
--resume SESSION-rResume a specific session by name
--resume-recentResume the most recent session
--model MODEL-mOverride model (provider:model format)
--sandboxRestrict filesystem writes to the working directory. See Sandbox.
--hook NAMERepeatable; parsed into ACP options, but ACP does not currently start webhook listeners.

Examples:

bash
octomind acp
octomind acp developer:general --sandbox
octomind acp assistant:concierge -m openai:gpt-5.6-luna

octomind tap [TAP] [PATH]

Add or list registry taps (Homebrew-style agent sources). Replace myorg/my-tap and the local path below with your own tap. myorg/my-tap resolves to the repository myorg/octomind-my-tap.

ArgumentDescription
TAPTap identifier (user/repo format). Omit to list all taps.
PATHOptional local path. If provided, symlinks instead of cloning from GitHub.

Examples:

bash
# List all taps
octomind tap

# Add tap from GitHub
octomind tap myorg/my-tap

# Add local tap (symlink)
octomind tap myorg/my-tap /path/to/local/tap

octomind tap init <TAP>

Create a new tap repository from the default tap's scaffold (scaffolds/tap/ in muvon/octomind-tap). Renders the template, validates it, runs git init, and registers the directory as a local tap — the starter agent is runnable immediately.

ArgumentDescription
TAPNew tap identifier (user/repo format).
--agent DOMAIN:SPECStarter agent tag. Domain defaults to the repo name, spec to the installed scaffold default; pass --agent to make it explicit.
--dir DIRDestination directory. Defaults to ./octomind-<repo>.

Examples:

bash
# Scaffold ./octomind-team, validate, git init, register as local tap
octomind tap init acme/team --agent team:assistant

# Then run the starter agent
octomind run team:assistant

# Custom starter agent and destination
octomind tap init acme/team --agent legal:contracts --dir ~/work/acme-tap

The destination must be missing or an empty directory. Rendering fails if any scaffold token remains unresolved or the validation command declared by the installed scaffold fails.

octomind untap <TAP>

Remove a previously added tap. TAP is required; use an identifier listed by octomind tap.

bash
octomind untap myorg/my-tap

octomind vars

Show all placeholder variables and their current values.

FlagShortDescription
--preview-pShow a short preview (up to 3 lines) of each placeholder value
--expand-eShow full expanded values for placeholders

With no flag, vars runs in list mode (names + descriptions). If both flags are given, --expand takes precedence over --preview.

bash
octomind vars
octomind vars --preview
octomind vars --expand

Displays the placeholder set octomind vars reports: {{DATE}}, {{SHELL}}, {{OS}}, {{BINARIES}}, {{CWD}}, {{HOME}}, {{SYSTEM}} (complete system info), {{CONTEXT}} (README + git status + git tree), {{GIT_STATUS}}, {{GIT_TREE}}, and {{README}}. ({{ROLE}} is substituted in role prompts but is not among the values vars lists.)

octomind send

Inject a message into a running named session.

Works against any running session that has started its inject listener (typically a session launched with --daemon, but not exclusively). The message reaches the session over a per-OS transport:

  • Unix: a Unix domain socket at <run_dir>/<stem>.sock (long names are shortened and suffixed with an eight-digit SHA-256 prefix) (run dir is $XDG_RUNTIME_DIR/octomind/, or <system tmp>/octomind-<uid>/ when that variable is unset).
  • Windows: a named pipe \\.\pipe\octomind-<name>.

The session replies ok on successful delivery; any other reply is treated as an error and reported.

FlagShortDescription
--name NAME-nName of the running session to send to (required)
MESSAGEMessage text. If omitted, reads from stdin.
bash
echo "Check build status" | octomind send --name ci-watcher
octomind send --name ci-watcher "Check build status"

octomind workflow [NAME|FILE]

Run a multi-step workflow defined in a TOML file.

FlagShortDescription
`NAMEFILE`
--dry-runValidate and print the execution plan without running any steps
--format <FORMAT>jsonl streams one assistant event per step + a final aggregated cost event to stdout

Running a workflow reads input from stdin; listing workflows and --dry-run do not. Public tap workflows may reference only public tap roles; local files are not subject to that restriction. Per-step assistant responses, progress, cost, and token stats are written to stderr. When executing a target, stdout receives output only for --dry-run (the execution plan) or jsonl. Listing without a target also prints to stdout. With --format jsonl, stdout streams one {"type":"assistant","content":...,"step":"<name>","session_id":""} line as each step completes (the final result is simply the last one) followed by one {"type":"cost",...} line with aggregated tokens/cost. These are the same event shapes octomind run --format jsonl emits, with an extra step field identifying the originating step (omitted in run output). Workflows have no single resumable session, so session_id is empty. See Workflows.

Create myflow.toml in your working directory with this runnable one-step definition:

toml
name = "refine"

[[steps]]
name = "refine"
role = "task_refiner"
prompt = "{{input}}"
bash
octomind workflow
echo "build a JSON-to-CSV CLI in Rust" | octomind workflow myflow.toml
echo "build a JSON-to-CSV CLI in Rust" | octomind workflow myflow.toml --format jsonl
octomind workflow myflow.toml --dry-run

octomind completion <SHELL>

Generate shell completion scripts.

ArgumentDescription
SHELLTarget shell: bash, zsh, fish, powershell, elvish
ShellCommand
Bashoctomind completion bash > ~/.local/share/bash-completion/completions/octomind
Zshoctomind completion zsh > ~/.zfunc/_octomind
Fishoctomind completion fish > ~/.config/fish/completions/octomind.fish
PowerShelloctomind completion powershell > octomind.ps1
Elvishoctomind completion elvish > octomind.elv

Create the destination directory before redirecting output. For Zsh:

bash
mkdir -p ~/.zfunc
octomind completion zsh > ~/.zfunc/_octomind

Add ~/.zfunc to Zsh’s fpath before compinit in your shell configuration.

Dynamic agent-tag completion for octomind run <TAB> and tap-workflow completion for octomind workflow <TAB> are injected only into the bash, zsh, and fish scripts through the hidden complete helper. PowerShell and Elvish remain static.

Hidden internal commands

These commands are omitted from normal help but remain callable. complete reads cached tap data; an unknown subcommand prints nothing. distill reads and deletes its snapshot before parsing and extracting memories.

Command / argumentRequired / defaultMeaning
complete SUBCOMMANDRequiredrun lists agent tags and configured roles; workflow lists public workflows.
distill --messages PATHRequiredJSON array of session messages; consumed and deleted.
distill --role ROLE""Originating role.
distill --project PROJECT""Project storage scope.
distill --session SESSION""Originating session name.
distill --outcome OUTCOMEunknownverified, failed, or unknown completion evidence.
bash
octomind complete run
octomind complete workflow
# A disposable empty snapshot demonstrates the input shape without inventing a transcript.
printf '[]\n' > /tmp/octomind-empty-transcript.json
octomind distill --messages /tmp/octomind-empty-transcript.json --role developer:general \
  --project demo --session demo --outcome unknown

Sandbox

When enabled, the sandbox restricts writes with Landlock on Linux or Seatbelt on macOS while retaining the state/temp exceptions defined by each backend. It is active if either the config sandbox setting or the --sandbox flag is set, and it applies only to run, server, and acp — all other subcommands ignore both. Other platforms log that the sandbox is unsupported.

bash
octomind run developer:general --sandbox

Common questions

  • Why does --format reject startup? Pipe a nonempty prompt; redirected empty stdin also fails in daemon mode.
  • Why does bare --resume fail in a script? Supply a session name; the picker requires an interactive TTY.
  • Why does send fail? The receiving session must still be running with its inject listener active. A saved session alone cannot receive messages.
  • Why does a hook fail? --hook names must exist in [[hooks]]; see Daemon & Hooks for a complete hook configuration.

Help and version

FlagShortDescription
--help-hRoot or subcommand help.
--version-VRoot version flag; not inherited by subcommands.
bash
octomind --version
octomind help tap init
octomind run --help

Source map

CLI registration: main.rs. Argument structs and behavior: run.rs, config.rs, server.rs, acp.rs, tap.rs, untap.rs, login.rs, send.rs, vars.rs, workflow.rs, complete.rs, distill.rs. Workflow file schema: schema.rs. State paths: directories.rs.

See also