Skip to content

CLI Reference

This is the reference page for commands run from a shell. Interactive slash commands and power commands live in Commands; this page covers the Symfony Console command surface exposed by kosmokrator and bin/kosmokrator.

Most automation-oriented commands support --json. Prefer JSON mode for agents, scripts, CI, wrappers, and tests because failures return structured success: false envelopes where the command owns the error handling.

Symfony global options are accepted by every command:

OptionPurpose
-h, --helpShow help for a command.
-q, --quietOnly show errors.
-v, -vv, -vvvIncrease verbosity.
-V, --versionPrint application version.
--ansi, --no-ansiForce or disable ANSI output.
-n, --no-interactionNever ask interactive questions.

Shell completion is built in:

Terminal window
kosmokrator completion zsh
eval "$(kosmokrator completion zsh)"

agent is also the default command, so kosmokrator -p "task" and kosmokrator agent -p "task" are equivalent.

Terminal window
kosmokrator [options] [prompt]
kosmokrator agent [options] [prompt]
OptionValuesPurpose
--rendererauto, tui, ansiSelect terminal renderer.
--no-animationflagSkip startup animation.
--resumeflagResume last session for this project.
--sessionsession ID or prefixResume a specific session.
-p, --printflagRun headlessly and exit.
-o, --output-formattext, json, stream-jsonSelect headless output format.
-m, --modelmodel IDOverride configured model.
--modeedit, plan, askSelect agent mode.
--permission-modeguardian, argus, prometheusSelect permission mode.
--yoloflagAlias for --permission-mode prometheus.
-t, --max-turnsintegerCap agentic LLM turns.
--timeoutsecondsCap wall-clock runtime.
-c, --continueflagContinue the most recent session.
--append-system-prompttextAppend extra instructions to the default prompt.
--system-prompttextReplace the system prompt for this run.
--no-sessionflagDo not persist this run.

Examples:

Terminal window
kosmokrator
kosmokrator --renderer=ansi --no-animation
kosmokrator -p "Explain this repository" --mode ask --output-format text
kosmokrator -p "Run tests and fix failures" --mode edit --permission-mode guardian
kosmokrator -p "Review the branch" --mode plan --output-format json --no-session
kosmokrator -p "Summarize progress" --continue --output-format stream-json
CommandPurpose
setupInteractive or headless first-run provider/model setup.
authProvider auth status, login, and logout.
configInspect and update settings through the legacy config facade.
settings:*Schema-backed headless settings API.
secrets:*Managed secret storage helpers.
providers:*Provider discovery, model discovery, credentials, and custom providers.
codex:*ChatGPT OAuth helpers for the Codex provider.
Terminal window
kosmokrator setup
kosmokrator setup --provider openai --model gpt-5.4-mini --api-key-env OPENAI_API_KEY --global --json
printf %s "$ANTHROPIC_API_KEY" | kosmokrator setup --provider anthropic --api-key-stdin --json
kosmokrator setup --provider codex --device --json

Options: --renderer, --no-animation, --provider, --model, --api-key, --api-key-stdin, --api-key-env, --device, --global, --project, --json.

Terminal window
kosmokrator auth status --json
kosmokrator auth status openai --json
kosmokrator auth login openai --api-key-env OPENAI_API_KEY --json
printf %s "$OPENAI_API_KEY" | kosmokrator auth login openai --api-key-stdin --json
kosmokrator auth login codex --device
kosmokrator auth logout openai --json

Actions: status, login, logout.

Terminal window
kosmokrator config show
kosmokrator config show --json
kosmokrator config paths --json
kosmokrator config get agent.default_model --json
kosmokrator config set agent.default_model gpt-5.4-mini --provider openai --global --json
kosmokrator config unset agent.mode --project --json
kosmokrator config edit --project

Actions: show, get, set, unset, edit, paths.

Prefer settings:* for new automation because it exposes categories, types, current source, effect timing, and validation metadata.

CommandPurpose
settings:listList all headless-configurable settings.
settings:getRead one effective setting.
settings:setWrite one setting.
settings:unsetRemove an override.
settings:applyApply a JSON batch.
settings:optionsShow valid options for choice settings.
settings:doctorDiagnose headless readiness.
settings:examplesPrint machine-readable examples.
Terminal window
kosmokrator settings:list --json
kosmokrator settings:list --category permissions --json
kosmokrator settings:get tools.default_permission_mode --json
kosmokrator settings:options agent.default_model --provider openai --json
kosmokrator settings:set agent.mode plan --project --json
kosmokrator settings:set tools.denied_tools "file_write,bash" --global --json
kosmokrator settings:unset agent.mode --project --json
jq -n '{
settings: {
"agent.default_provider": "openai",
"agent.default_model": "gpt-5.4-mini",
"tools.default_permission_mode": "guardian"
}
}' | kosmokrator settings:apply --stdin-json --global --json

See Settings Reference for the full schema.

CommandPurpose
providers:listList providers, labels, source, auth mode, and configured status.
providers:models <provider>List models for one provider.
providers:status [provider]Show credential/configuration status.
providers:configure <provider>Configure provider credentials and default model.
providers:logout <provider>Clear stored provider credentials.
providers:custom:listList custom providers.
providers:custom:upsert [id]Create or update a custom provider.
providers:custom:delete <id>Delete a custom provider.
Terminal window
kosmokrator providers:list --json
kosmokrator providers:models anthropic --json
kosmokrator providers:status openai --json
printf %s "$OPENAI_API_KEY" | \
kosmokrator providers:configure openai --api-key-stdin --model gpt-5.4-mini --global --json
kosmokrator providers:configure codex --device --global --json
kosmokrator providers:logout openai --json

Custom OpenAI-compatible provider:

Terminal window
kosmokrator providers:custom:upsert local_ollama \
--driver openai-compatible \
--url http://127.0.0.1:11434/v1 \
--model qwen3:32b \
--label "Local Ollama" \
--global \
--json

Custom provider options: --driver, --url, --auth, --model, --label, --context, --max-output, --api-key, --api-key-stdin, --api-key-env, --stdin-json, --global, --project, --json.

CommandPurpose
secrets:listList managed secret statuses.
secrets:status <key>Show whether one secret is configured.
secrets:set <key> [value]Store a secret.
secrets:unset <key>Remove a secret.
Terminal window
printf %s "$OPENAI_API_KEY" | kosmokrator secrets:set provider.openai.api_key --stdin --json
kosmokrator secrets:status provider.openai.api_key --json
kosmokrator secrets:list --json
kosmokrator secrets:unset provider.openai.api_key --json

Use --stdin or --env for automation. Avoid putting secrets directly in argv because shell history and process listings may capture them.

Integrations are discovered from installed OpenCompany integration packages and exposed through both generic and provider-specific commands.

CommandPurpose
integrations:listList providers and functions.
integrations:statusShow activation, credentials, accounts, and permission state.
integrations:search <query>Search functions.
integrations:docs [page]Read provider/function docs.
integrations:fields <provider>Show credential fields.
integrations:doctor [provider]Diagnose readiness and next steps.
integrations:configure <provider>Configure credentials, activation, accounts, and permissions.
integrations:schema <provider.function>Print JSON input schema.
integrations:examples <page>Show usage examples.
integrations:call <provider.function>Call any function.
integrations:lua [file]Run Lua against configured integrations and MCP servers.
integrations:<provider> [function]Dynamic provider shortcut, for example integrations:plane.
Terminal window
kosmokrator integrations:list --json
kosmokrator integrations:search "plane issue" --json
kosmokrator integrations:docs plane.create_issue --format markdown
kosmokrator integrations:schema plane.create_issue
kosmokrator integrations:configure plane --set api_key="$PLANE_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:call plane.list_issues '{"project_id":"..."}' --json
kosmokrator integrations:plane list_issues --project-id=... --json
kosmokrator integrations:lua workflow.lua --force --json

Installed dynamic shortcuts currently include integrations:clickup, integrations:coingecko, integrations:plane, and integrations:plausible in this checkout. The set changes with installed integration packages.

See Integrations for argument coercion, multi-account credentials, Lua helpers, permissions, and result envelopes.

MCP servers are configured in portable mcpServers JSON files, with compatibility for VS Code/Cursor servers files.

CommandPurpose
mcp:listList configured servers.
mcp:status [server]Show server readiness.
mcp:add <name>Add or update a server.
mcp:remove <name>Remove a server.
mcp:enable <name> / mcp:disable <name>Toggle a server.
mcp:trust <server>Trust a project server command after review.
mcp:tools [server]Discover tools.
mcp:schema <server.tool>Show tool schema.
mcp:call <server.tool>Call a tool.
mcp:<server> <tool>Dynamic server shortcut.
mcp:lua [file]Run Lua against MCP servers.
mcp:resources <server> / mcp:resource <server> <uri>List or read resources.
mcp:prompts <server> / mcp:prompt <server> <prompt>List or get prompts.
mcp:secret:set, mcp:secret:list, mcp:secret:unsetStore MCP secret values.
mcp:import <path>Import .mcp.json, VS Code, Cursor, or mcpServers JSON.
mcp:exportExport effective config.
mcp:presetList or install known presets.
mcp:examplesPrint examples.
mcp:doctorDiagnose MCP readiness.
Terminal window
kosmokrator mcp:add github --type stdio --command github-mcp-server \
--env GITHUB_TOKEN --read allow --write ask --project --json
kosmokrator mcp:trust github --project --json
kosmokrator mcp:tools github --json
kosmokrator mcp:schema github.search_repositories --json
kosmokrator mcp:call github.search_repositories --query kosmokrator --json
kosmokrator mcp:github search_repositories --query kosmokrator --json
kosmokrator mcp:lua workflow.lua --json

Use --force on discovery/call/Lua commands only for trusted automation. It bypasses MCP trust and read/write policy for that one command.

CommandPurpose
web:providersList optional external web providers.
web:configure <provider>Configure provider credentials and defaults.
web:doctorDiagnose web-provider setup.
web:search <query>Run an external search provider.
web:fetch <url>Fetch or extract a URL through a provider.
web:crawl <url>Crawl a site through Tavily or Firecrawl.
Terminal window
kosmokrator web:providers --json
kosmokrator web:configure tavily --api-key-env TAVILY_API_KEY --enable --search --global --json
kosmokrator web:search "KosmoKrator terminal agent" --max-results 5 --json
kosmokrator web:fetch https://example.com --format markdown --json
kosmokrator web:crawl https://docs.example.com --max-pages 10 --json

See Web Providers for provider capabilities, environment variables, and settings.

CommandPurpose
gateway:telegramRun the gateway worker.
gateway:telegram:configureConfigure the worker headlessly.
gateway:telegram:statusShow readiness and effective config.
gateway:telegram:workerInternal worker command.
Terminal window
printf %s "$TELEGRAM_BOT_TOKEN" | \
kosmokrator gateway:telegram:configure --token-stdin --enabled on --global --json
kosmokrator gateway:telegram:configure --allowed-users "12345,@alice" --require-mention on --json
kosmokrator gateway:telegram:status --json
kosmokrator gateway:telegram

See Telegram Gateway for routing, security, and deployment notes.

CommandPurpose
acpStart the Agent Client Protocol stdio server.
updateCheck for and apply release updates when supported.
smoke:startupOffline startup checks for CI and release artifacts.
codex:login / codex:status / codex:logoutCodex provider OAuth helpers.
Terminal window
kosmokrator acp --cwd /path/to/project --mode edit --permission-mode guardian
kosmokrator update --check
kosmokrator update --yes
kosmokrator smoke:startup --json

Automation commands generally follow this shape:

{
"success": true,
"data": {},
"meta": {}
}

On failure they return a non-zero exit code and include an error field when JSON mode is enabled. Headless agent --output-format json returns a run result with text, session ID, duration, usage, turn count, tool-call count, success, exit code, and error.

For long-running headless agent runs, prefer --output-format stream-json when a wrapper needs progress:

Terminal window
kosmokrator -p "Run tests and fix failures" --output-format stream-json | jq -c .