Cogitator
CLI

CLI

Command-line interface for Cogitator: scaffold and grow projects, Cogitator Studio, MCP for coding agents, doctor, evals, assistants as services, Ollama models and deploy.

Command-line interface for the Cogitator AI agent runtime. Scaffold projects and grow them with cogitator add, debug them in Cogitator Studio, give coding agents the docs over MCP, check that a project can run, score it with evals, run assistants in the foreground or as a background service, chat with agents from the terminal, manage Ollama models and Docker services, and deploy.

Installation

# Global installation (recommended)
pnpm add -g @cogitator-ai/cli

# Or use with npx
npx @cogitator-ai/cli <command>

Requires Node.js 22.12+.

Quick Start

There are two ways to build an assistant:

# A) Config-driven personal assistant (no code)
cogitator wizard        # answers → cogitator.yml + .env
cogitator up            # run it

# B) Code-first project
npx create-cogitator-app my-assistant   # or: cogitator init my-assistant for a messaging bot
cd my-assistant
pnpm dev
cogitator dev           # Cogitator Studio: chat, traces, approvals, workflows, forks

Quick one-off chat with any model:

cogitator run -m ollama/llama3.1:8b "What is the capital of France?"

Commands

CommandDescription
cogitator init [name]Scaffold a messaging assistant project (the channels preset of create-cogitator-app)
cogitator add [features]Add rag, mcp, workflows, evals, memory, deploy and the other generated features to a project
cogitator devOpen Cogitator Studio for the project
cogitator mcpServe the Cogitator docs and the project to coding agents over MCP (stdio)
cogitator doctorCheck that a project can run: Node, packages, config, keys, models and services
cogitator eval [files]Run the eval suites and fail when an assertion fails
cogitator wizardInteractive setup that writes cogitator.yml + .env
cogitator upRun the assistant from cogitator.yml, or start Docker services
cogitator downStop Docker Compose services
cogitator assistantRun a gateway module (src/gateway.ts) with a live dashboard
cogitator run [msg]Chat with an agent (one-shot or interactive REPL), or run headless with -p
cogitator app-serverServe the typed JSON-RPC app-server on stdio, write its client and JSON Schema
cogitator acpServe a Cogitator coding agent to an editor over the Agent Client Protocol (stdio)
cogitator buildBundle a gateway into a self-starting dist/cogitator.mjs
cogitator daemon <cmd>Run in the background / install as a launchd or systemd service
cogitator bridge <cmd>Run and watch the agent bridge between harnesses, and call it from a session (experimental)
cogitator skill <cmd>Create, validate, install and remove skills
cogitator modelsList or pull Ollama models
cogitator statusShow Docker Compose and Ollama status (alias: ps)
cogitator logsView Docker Compose service logs
cogitator deployDeploy with Docker or Fly.io (see @cogitator-ai/deploy)
cogitator rewindRewind a thread's conversation, memory and files to an entry, a dry run first
cogitator plugin <cmd>Install, update, enable, disable and validate plugins and marketplaces, run plugin evals (experimental)
cogitator schedule <cmd>List, add, run now, pause, resume and remove the schedules of routines (experimental)
cogitator inboxRead the inbox of routines: results, failures and runs waiting for an answer (experimental)
cogitator trigger <cmd>Fire the API trigger of a running server, issue its token (experimental)

Every command ends with examples in its --help.

Output and exit codes

Every command exits with 0 when it did what was asked, 1 when it could not (a failed check, deploy or install, a missing service) and 2 when the command line is wrong (an unknown option, command or value, with the closest valid name). Failures print the message and what to do about it on stderr, COGITATOR_DEBUG=1 adds the stack trace. With --json (add, doctor, eval, models, status, deploy, bridge status, bridge log, bridge doctor, bridge delegate, bridge send, bridge inbox) the result goes to stdout as JSON, and a failure as { "ok": false, "error": { "message", "exitCode", "hints" } }.


cogitator init

Creates a messaging assistant project: the channels preset of create-cogitator-app, generated by the same engine, with the provider, model, channels and memory you choose.

cogitator init my-assistant            # prompts for provider, model, channels, memory
cogitator init my-assistant --no-install --no-git --no-telemetry

The prompts cover the LLM provider (Anthropic, OpenAI, Google or Ollama) and model, channels (Telegram, Discord, Slack, WebChat, Bluesky, Threads, GitHub, email, Microsoft Teams) with their tokens, and the memory adapter (SQLite, in-memory or Postgres). Tokens and keys go to .env (mode 600). The project is the same as npx create-cogitator-app my-assistant --preset channels: the registry in src/cogitator.ts, tests on a mocked model, cogitator.yml, AGENTS.md, Cogitator Studio and the rest. The assistant is src/gateway.ts, the gateway export that cogitator assistant, cogitator build and cogitator daemon run, and src/index.ts starts it for dev and start. When the project has compose services (Postgres memory, the Ollama container) and Docker is running, it offers to start them the way create-cogitator-app does, before it prints the next steps. A Postgres URL of your own leaves the compose Postgres out.


cogitator add

cogitator add rag                       # answers grounded in docs/
cogitator add workflows evals           # two features at once
cogitator add --memory postgres         # switch the memory adapter
cogitator add --deploy docker --dry-run # every diff, nothing written
cogitator add --agent claude            # MCP config and skill for Claude Code

Grows a project created by create-cogitator-app or cogitator init with the same feature modules that generated it: the project and its extended spec are both planned, and what the addition changes between them is merged into the files on disk. Files still as generated (by the hashes in .cogitator/scaffold.json) take the change; package.json, cogitator.yml, docker-compose.yml and pnpm-workspace.yaml merge key by key, keeping your values and comments; the managed block of AGENTS.md is rewritten and the rest kept; .gitignore gains missing lines; an edited README is left with a note. Any other file you edited that the addition changes is a conflict: nothing is written, and the change is printed as a diff. Adding what the project has is a no-op. New dependencies are installed (--no-install skips it), the written files formatted, and the new spec and command recorded in package.json.


cogitator dev

cogitator dev                         # http://localhost:4321, opens the browser
cogitator dev --port 4400 --no-open
cogitator dev --host 0.0.0.0          # reachable from your network, with a token in the URL

Opens Cogitator Studio for the project in the current directory: chat with every agent of src/cogitator.ts (streamed answers, reasoning, tool calls, stop, threads), approve tool calls that need it, read the waterfall trace of each run with nested agents, tokens and cost per model call, run workflows with live node statuses and rerun them from a node, and fork a run from any step with a changed input or tool result. The project runs in a child process that reloads when you save (--no-watch turns it off). History lives in .cogitator/studio/.


cogitator mcp

A stdio MCP server for Claude Code, Cursor and Codex, configured by create-cogitator-app --agent or cogitator add --agent:

ToolWhat it does
search_docsSearches the docs bundled with the installed @cogitator-ai/core, best passages first
read_docReads a page, or one section with path#section
inspect_projectThe agents (model, instructions, tool schemas), workflows and swarms of src/cogitator.ts
check_projectRuns cogitator doctor, offline unless asked

The registry loads in a child process, so the agent always sees the current code and the project's own output never reaches the MCP stream. The server finds the project from a subdirectory, or takes --project <dir>.


cogitator doctor

cogitator doctor            # Node, packages, cogitator.yml, keys, services, models
cogitator doctor --offline  # no provider or service probes
cogitator doctor --json

Checks the Node version against engines, the installed @cogitator-ai/* packages, cogitator.yml, the variables src/env.ts requires, the provider key (with a cheap call), Redis, Postgres and the other services the config uses, and the Ollama models. Each problem comes with the fix; it exits 1 when one fails.


cogitator eval

cogitator eval                                   # every evals/*.eval.ts
cogitator eval evals/answers.eval.ts --max-cases 5
cogitator eval --json --report eval-report.json  # for CI
cogitator eval --skip-without-key                # exit 0 on forks without the key

Runs eval suites (files exporting an EvalSuite from @cogitator-ai/evals as default) and exits 1 when an assertion fails or every case errored.


cogitator wizard

Interactive setup for the config-driven personal assistant run by cogitator up.

cogitator wizard          # create cogitator.yml (+ .env)
cogitator wizard --edit   # edit an existing cogitator.yml, pre-filling current values

The wizard asks for your name and the assistant's name, the LLM provider and model (models are fetched live from the provider registry or your Ollama server), channels (Telegram, Discord, Slack, Bluesky, Threads, GitHub, email, Microsoft Teams with owner IDs), capabilities (web search, file system, GitHub, device tools, browser, scheduler, RAG, self-config, self-tools), MCP servers (quoted arguments are supported), the SQLite memory path and the assistant's personality. A terminal channel is always available.

Secrets are merged into .env without touching your other variables or comments. In --edit mode, leaving a secret blank keeps the current value, and existing MCP servers and advanced settings (security, rate limits, …) are preserved. The wizard does not ask about WhatsApp, WebChat or Postgres memory, but keeps them: channels.whatsapp / channels.webchat entries stay as they are, and a memory.adapter: postgres config is kept (the SQLite path prompt is skipped).

See the wizard guide for the generated cogitator.yml.


cogitator up / down

cogitator up                       # ./cogitator.yml (or .yaml) → run the assistant
cogitator up -c path/to/assistant.yml
cogitator up --no-restart-loop     # run in-process, without the restart supervisor

When a cogitator.yml exists, up validates it (errors list the offending fields), loads the .env next to it into process.env without overriding variables that are already set (so tools that read process.env, such as web_search and github_api, see the wizard's keys) and starts the assistant. Unless --no-restart-loop is given, up runs the assistant in a child process and starts it again whenever it exits with code 78 — the owner /restart command and self-config updates; SIGINT/SIGTERM are forwarded for a graceful shutdown. With --no-restart-loop the assistant runs in the up process and simply stops on /restart.

A cogitator.yml made only of @cogitator-ai/config runtime keys (llm.defaultModel, memory, sandbox, … — the file create-cogitator-app generates) is not an assistant config: your project's code loads it. up then starts the project's Docker Compose services, or, without a compose file, exits explaining that you start the project itself (e.g. pnpm dev). up -c with such a file fails with the same explanation, and cogitator daemon skips it when auto-detecting what to run.

Without an assistant config, up manages the Docker Compose project found in the current or a parent directory (docker-compose.yml, compose.yml, …):

OptionDefaultDescription
-d, --detachtrueRun services in background
--no-detach-Run services in foreground
--pullfalsePull latest images before starting

After starting, the published ports of every service are printed.

cogitator down             # stop services (keep data)
cogitator down --volumes   # stop and delete volumes

cogitator assistant

Runs a module that exports a gateway (as generated by init) with a live dashboard.

cogitator assistant                    # src/gateway.ts
cogitator assistant -c src/my-gw.ts
cogitator assistant --quiet            # no banner, status line or hotkeys (used by the daemon)

TypeScript modules are loaded through tsx, resolved from your project first. .env in the working directory is loaded before the module. Hotkeys (interactive terminals only): s sessions, c channels, h help, q quit.


cogitator run

Run an agent with a message, or start an interactive REPL when no message is given.

cogitator run "Explain quantum computing in simple terms"
cogitator run -m openai/gpt-6.1-sol "Analyze this code..."
cogitator run --no-stream "Hello"
cogitator run            # interactive
OptionDefaultDescription
-c, --config <path>autoConfig file (must exist when given)
-m, --model <model>auto-detectModel, e.g. ollama/qwen3:8b
-i, --interactivefalseForce interactive mode
-s, --streamtrueStream response tokens
--no-stream-Disable streaming

Config resolution: -c → COGITATOR_CONFIG → cogitator.yml, cogitator.yaml, .cogitator.yml, .cogitator.yaml, cogitator.json. The .env next to the file (or in the working directory without one) is loaded first, without overriding variables already set. The file is loaded with @cogitator-ai/config, so ${ENV} references and COGITATOR_* / provider environment variables apply even without a file. An assistant config from cogitator wizard is not a runtime config: run takes its llm.provider and llm.model as the model and everything else from the environment (cogitator up runs the assistant itself).

Model resolution: -m → COGITATOR_MODEL → llm.defaultModel from the config → the model of an assistant config → first installed Ollama model (preferring qwen3:8b, qwen3.5:9b, llama3.1:8b, llama3:8b, gemma3:4b, gemma2:9b, mistral:7b). Ollama is reached at llm.providers.ollama.baseUrl, OLLAMA_URL or OLLAMA_HOST.

Interactive commands: /model [name], /clear, /help, exit / quit (Ctrl+D also exits).

With -p (--print) run works without a terminal: the answer as text, JSON or stream-json, many turns as stream-json input, sessions kept to --resume and --fork, and --json-schema for a structured answer. See Headless mode.


cogitator app-server

Serves the app-server on stdin and stdout as NDJSON JSON-RPC, with the agent run would use (-c, -m, --no-session-persistence). generate-ts --out <dir> writes the typed client, generate-json-schema --out <dir> the JSON Schema of the protocol.

cogitator app-server -m ollama/qwen3:8b
cogitator app-server generate-ts --out src/generated
cogitator app-server -m ollama/qwen3:8b --acp-agent claude

--acp-agent <spec...> serves external ACP agents next to it: a preset (claude, codex, gemini), registry:<id> or a command line, as name=spec to name one. Their permission requests are decided by the permission rules and asked of the client otherwise.


cogitator acp

Serves a Cogitator coding agent to the editor that launches it over the Agent Client Protocol: the coding harness agent on the model of -m, the config or a local Ollama. --models adds models a session may switch to, --trust trusts the project (its own subagents, commands, hooks and allow rules apply, and "always" answers are saved to .cogitator/settings.local.json).

cogitator acp -m ollama/qwen3:8b

cogitator rewind

Rewind a thread of the project's registry (src/cogitator.ts, which exports the runtime as cogitator and the agents as agents) to an entry: its conversation and memory, and with --files the files of the agent's workspace from the file checkpoint at that point. Without an entry it lists the active branch of the thread, the user messages with a checkpoint marked [files].

cogitator rewind thread_42
cogitator rewind thread_42 entry_abc --files --dry-run
cogitator rewind thread_42 entry_abc --files
cogitator rewind thread_42 entry_abc --files --no-memory --yes
OptionDefaultDescription
--filesfalseRestore the files from the checkpoint at that point
--no-memory-Leave the conversation and memory as they are, restore files only
--dry-runfalseShow what the rewind would change, change nothing
-y, --yesfalseRewind without asking (needed when stdin is not a terminal)
--forcefalseAbort the runs going on in the thread first
-a, --agent <key>the thread's agentThe registry agent whose workspace to restore
-r, --registry <path>src/cogitator.tsThe registry module
--jsonfalsePrint the report as JSON

Before it rewinds, the command prints the dry run (entries that leave the branch, stale memory items, files restored and deleted, runs dropped) and asks. --json never prompts, so it needs --dry-run or --yes. Without --agent, the agent is the one whose id the thread names, else the only registry agent with a workspace. The command runs in a process of its own: a run of the project's other processes is seen only when it is durable, and the command warns when runs are not durable by default, so stop such runs before you rewind with --files.

cogitator plugin

Manage plugins in the format of Claude Code's plugins and the marketplaces they come from (experimental). Plugins are kept under COGITATOR_PLUGINS_DIR (default ~/.cogitator/plugins), and every install is pinned to the exact commit, npm version and integrity or archive digest it fetched.

cogitator plugin marketplace add your-org/claude-plugins
cogitator plugin install formatter@your-org --scope project
cogitator plugin install npm:@acme/review-kit@^2.0.0
cogitator plugin install git+https://git.example.com/tools.git#v1.2.0
cogitator plugin configure formatter@your-org --set endpoint=https://x.example --secret token
cogitator plugin list --json
cogitator plugin update
cogitator plugin disable formatter@your-org
cogitator plugin uninstall formatter@your-org --prune --yes
cogitator plugin validate ./my-plugin --strict
cogitator plugin eval ./my-plugin
SubcommandDescription
install <plugin> (i)From a marketplace (name@marketplace), npm (npm:<package>[@version]) or git (git+<url>[#ref], github:<owner>/<repo>[#ref]). -s, --scope user|project|local picks the settings file that enables it, --config key=value sets options, --secret key reads a secret from the terminal, --marketplace <source> adds the marketplace first, -y, --yes grants the permissions the plugin asks for and runs a command source without asking
uninstall <plugin> (remove, rm)Removes its files, data (--keep-data keeps it), options, secrets and enabledPlugins entries, --prune also the dependencies nothing needs. Refused while an installed plugin depends on it
enable <plugin>, disable <plugin>Writes enabledPlugins of the scope, without --scope of the settings file that decides now (local, project, user), else the user's, and warns when a higher layer still decides otherwise. Enabling needs the dependencies installed, disabling is refused while an enabled plugin depends on it, managed settings win
update [plugin]Fetches the source again and installs a new version only when its version changed
listThe installed plugins, enabled or not, with load errors. --available --json adds what the marketplaces offer
configure <plugin>--set key=value, --secret key, --unset key
validate <path>As claude plugin validate: exit 0 passed, 1 failed, 2 when the check itself failed, --strict fails on warnings
marketplace add <source>, list, remove <name> (rm), update [name]owner/repo, a git URL, an https link to a marketplace.json or a local folder or file
eval [target]Runs the plugin's eval cases in the format of claude plugin eval, with and without the plugin. Exits 0 passed, 1 a case below --threshold, a load or provider error or a command-line error, 2 a partial run, 130 interrupted, 143 terminated. Claude Code's --trust-plugin, --no-publish, --publish-report and --mocks record are accepted, --mocks off and --allow-real-servers exit 1. See Plugin evals

Every subcommand that changes something takes --json and then prints one object with command, outcome (ok or failed), message and, on a failure, failureCode.

cogitator schedule

Work on the routines a runtime keeps in files (experimental_fileTriggerStores, experimental) while it runs. Every subcommand takes --dir <path> (default COGITATOR_TRIGGERS_DIR, else .cogitator/triggers) and --json.

cogitator schedule list
cogitator schedule add digest --cron "0 9 * * 1-5" --timezone Europe/Berlin --agent assistant --prompt "Summarize the news"
cogitator schedule run digest
cogitator schedule pause digest.cron
cogitator schedule resume digest
cogitator schedule rm digest
SubcommandDescription
list (ls)The routines of the store with their triggers (paused or not, next occurrence, times fired) and every pending schedule entry: the cron triggers' of every routine, those in code included, and the tasks agents gave themselves
add <id>Saves a routine to the store that runs on a cron schedule: --cron (5 or 6 fields, or a preset such as @daily) and --prompt are required, --agent or --workflow names what it runs, --timezone, --name, --catch-up latest|none|all, --overlap skip|queue|parallel|replace. The running runtime fires it from the next occurrence
rm <id> (remove)Removes a routine of the store with its schedules and trigger state, or a schedule entry that is not a routine's. The schedule of a routine in code is refused: remove the trigger from the code, or pause it
run <id>Makes a schedule due now, by schedule id, routine id or <routine>.<trigger>: the runtime polling the folder runs it on its next poll
pause <id>, resume <id>Pauses or resumes a schedule entry, a routine or one trigger of it. A resumed schedule goes on from its next occurrence

The CLI runs nothing itself: a routine runs in the runtime whose experimental_triggers uses the same folder, and the files lock as they change, so both can work on them at once.

cogitator inbox

Read what routines came to, from the inbox file of the same folder. Without a subcommand it lists unread and read items, newest first.

cogitator inbox --unread
cogitator inbox --kind failure --limit 10
cogitator inbox show inbox_abc
cogitator inbox read inbox_abc
cogitator inbox archive inbox_abc
Option or subcommandDescription
--unread, --archived, --allOnly unread items, only archived ones, or every item (archived ones are left out by default)
--kind <kind>result, approval, question or failure
--limit <n>Most items, 50 by default
show <id>One item in full, with its routine, run and thread
read <id>, unread <id>, archive <id>Marks an item

Answering an approval or a question is done in code (respond()) or in Studio.

cogitator trigger

cogitator trigger token digest.api
cogitator trigger fire digest.api --text "Breaking news" --url http://localhost:3000/cogitator
SubcommandDescription
token <id>Issues a new token for an API trigger of a routine of the store (--dir), printed once. The store keeps only its SHA-256, and the token issued before stops working. A trigger with a token in its spec is refused, and a routine in code gets its token from issueToken() in code
fire <id>POSTs to <url>/triggers/<id>/fire of a running server: --url (default COGITATOR_URL, where the server adapter is mounted), --token (default COGITATOR_TRIGGER_TOKEN), --text (what the routine gets as untrusted data) and --idempotency-key

With --json every subcommand of schedule, inbox and trigger prints one object with command and outcome (ok or failed), then what it found or did (routines and schedules, items, item, token, result), or message and failureCode on a failure.

cogitator build

Bundles a gateway module with esbuild into a single self-starting ES module. The bundle starts the exported gateway and stops it gracefully on SIGINT/SIGTERM. esbuild ships with the CLI, so the project needs no extra dependency.

cogitator build                     # src/gateway.ts → dist/cogitator.mjs
cogitator build -c src/gw.ts -o out/bot.mjs --minify --no-sourcemap
node dist/cogitator.mjs
OptionDefault
-c, --config <path>src/gateway.ts
-o, --outfile <path>dist/cogitator.mjs
--target <version>node22
--sourcemaptrue
--minifyfalse
-q, --quietfalse

Only the project's own code is bundled: every package stays an import resolved from node_modules at runtime, since packages ship native addons (better-sqlite3, the ssh2 behind the Docker sandbox) and optional drivers loaded on demand. Run the bundle where the project's dependencies are installed.


cogitator daemon

Runs your assistant in the background. The entry is auto-detected in this order: dist/cogitator.mjs (from cogitator build), an assistant cogitator.yml / cogitator.yaml (via cogitator up; a runtime config is skipped), src/gateway.ts (via cogitator assistant --quiet). Use -c to choose explicitly.

cogitator daemon start [-c <entry>] [--bridge]
cogitator daemon status          # PID, uptime, memory
cogitator daemon logs -f -n 100  # .cogitator/daemon.log
cogitator daemon restart [-c <entry>] [--bridge | --no-bridge]
cogitator daemon stop            # SIGTERM, then SIGKILL after ~10s

cogitator daemon install [-c <entry>] [--bridge]   # launchd (macOS) or systemd --user (Linux)
cogitator daemon uninstall

The PID file (.cogitator/daemon.pid) records the launched script, so stop never signals an unrelated process that reused the PID. Service definitions use absolute paths, the current PATH, and start on login (loginctl enable-linger keeps a systemd user service running after logout).

--bridge makes the daemon also host the dispatcher of the agent bridge (experimental). The assistant does not depend on it: when another dispatcher already runs on the machine the daemon just does not host one. A bundle runs without the CLI, so --bridge is refused for it, run cogitator bridge serve next to it. A restart keeps hosting it without the flag, in the same folder, restart --no-bridge stops. install --bridge writes the current COGITATOR_BRIDGE_HOME into the service, which does not see your shell.


cogitator bridge

The agent bridge (experimental): Claude Code, Codex and other agents hand each other jobs, ask questions on the way and report back, each in its own window. The bridge is a dispatcher, one per machine, shared by every project. See the Agent Bridge guide.

cogitator bridge install [harness]    # give Claude Code and Codex the bridge in this project
cogitator bridge uninstall [harness]  # take out what install put in
cogitator bridge serve                # the dispatcher in the foreground, until Ctrl+C
cogitator bridge status [--json]      # the dispatcher, the sessions it knows, the jobs in progress
cogitator bridge log                  # the last 50 entries of the journal
cogitator bridge log --follow         # keep printing what comes in
cogitator bridge log --job 12         # everything about one job
cogitator bridge log --all            # the whole journal
cogitator bridge log --json           # one line of JSON per entry
cogitator bridge doctor [--json]      # whether Claude Code and Codex can be reached, and what to fix

serve reaches Claude Code and Codex sessions through their own commands: it starts a session for a job (claude --bg, codex exec), hands letters to Codex threads (codex queue) and answers the hooks of Claude Code sessions that wait for mail. With --home <dir> the sessions it starts are told that folder, so they call this dispatcher. A hook runs the command line the way serve itself was run, by absolute paths, so it does not depend on the PATH of a session. COGITATOR_BRIDGE_COMMAND names another way, such as cogitator bridge. The sessions it starts get the bridge's tools with them, so they ask, answer and report whatever their sandbox. A Claude Code session it starts runs in acceptEdits mode (--claude-mode <mode> or COGITATOR_BRIDGE_CLAUDE_MODE chooses another): it changes files in the folder of its job without asking, and asks leave for the rest through the bridge instead of showing a dialog nobody would answer. A Codex thread it starts works in the workspace-write sandbox, which keeps its shell commands from the bridge's socket and its tools from nothing, and a thread whose turn ends without a report gets its final answer taken as one. --codex-sandbox <mode> or COGITATOR_BRIDGE_CODEX_SANDBOX names another sandbox (read-only, danger-full-access) for what the thread itself may do: danger-full-access holds nothing back. What a Codex thread it started prints is kept in sessions/ of the bridge's folder. It refuses to start while another dispatcher runs and names its PID. status exits 0 when a dispatcher runs and 1 when none does. log reads the store itself, so it works after the dispatcher stopped, and prints what agents wrote on one line each without control characters. The files live in ~/.cogitator/bridge (bridge.db, bridge.sock), COGITATOR_BRIDGE_HOME or --home <dir> moves them.

With cogitator daemon start --bridge the assistant daemon hosts the dispatcher, so no second process is needed.

doctor checks the dispatcher, then each harness: its version, the commands the bridge needs from it, whether Claude Code trusts the folder (--cwd <dir>, the current one by default), whether sessions opened in it carry the wake hook and have the bridge's tools, whether a hook tells the tools which session calls, and whether Codex's local daemon runs. Every finding that is not fine comes with what to do. It exits 1 when something the bridge needs is missing, 0 when at most warnings are left.

install sets the harnesses up for the sessions you open: claude, codex, or both when none is named, leaving out one that is not installed. It lists every change, asks once, and makes them: the server of tools (claude mcp add --scope local, codex mcp add), for Claude Code the hooks and the rule for the tools in the project's .claude/settings.local.json, and the notes in CLAUDE.md and AGENTS.md. --dry-run only lists, -y does not ask, and without a terminal nothing is changed unless -y is there. --user sets every project of yours up, --take-jobs lets sessions carry out the jobs of other agents without asking you first, --no-notes leaves the instructions files alone and --no-allow keeps Claude Code's permission prompt for the bridge tools. --cwd <dir> names another project, --json prints the changes. Running it again changes only what is out of date. uninstall takes the same out again, and leaves Codex its server unless --user is there, since Codex keeps its servers for every project.

A session with the tools needs no command line. One without them, and you at a terminal inside one, calls the bridge from a shell, known by the id its harness put into the environment (CLAUDE_CODE_SESSION_ID, CODEX_THREAD_ID):

cogitator bridge delegate <to> [text...]   # hand a job over: --title, --cwd, --check <command>, --worktree, --parent <job>,
                                           # and its context: --done, --constraint, --decision, --file <path[:lines][=why]>
cogitator bridge send [text...] --job <n> --kind <question|answer|report|note|permission>
cogitator bridge inbox                     # the letters that wait: --job <n>, --peek, --unhandled
cogitator bridge cancel <job> [reason...]  # take back a job this session handed over
cogitator bridge diff <job> [path...]      # what a job changed in its worktree: --stat for the files alone
cogitator bridge accept <job>              # take the work of a finished job into this checkout: --as-branch [name]
cogitator bridge reject <job> [reason...]  # drop the work of a finished job with its worktree
cogitator bridge remember [text...]        # put a note on the board of the project: --lesson, --job <n>, --job-only
cogitator bridge recall [words...]         # the notes of the board that fit the words, or the newest: --kind, --limit
cogitator bridge forget <id>               # take a note off the board
cogitator bridge wait                      # wait for mail and exit with 2 when it comes
cogitator bridge mcp                       # serve the bridge tools over MCP (stdio)
cogitator bridge caller --hook claude-code # tell the tools which session calls
cogitator bridge permit --hook claude-code # ask leave for a call of a session the bridge started
cogitator bridge stuck --hook claude-code  # say the session waits for you at its permission dialog

What waits for your own word is answered from a terminal that is not a session of an agent:

cogitator bridge asks                               # permission requests and questions left to you
cogitator bridge allow <job-or-letter> [reason...]  # allow the call an agent asks leave for
cogitator bridge deny <job-or-letter> [reason...]   # refuse it
cogitator bridge reply <job-or-letter> [text...]    # answer a question

A call an agent asks leave for is yours to decide when the rules of the agent that handed the job over would have it ask you too, and a question is yours when an agent left it to you. A session that got a permission request decides it with send --kind answer --decision allow or deny, and leaves it or a question to you with --decision person. serve and the daemon also keep these letters in inbox.json in the folder of the bridge, and send them to a Telegram chat when COGITATOR_BRIDGE_TELEGRAM_TOKEN and COGITATOR_BRIDGE_TELEGRAM_CHAT are set: a request with Allow and Refuse buttons, a question to reply to. COGITATOR_BRIDGE_TELEGRAM_USERS names who in that chat may answer.

delegate prints the number of the job and returns at once, the answer arrives as a letter. <to> is codex, claude, the name of an agent, or codex:new for a fresh session. The text of delegate and send is the arguments, or stdin when there are none or they are -. A text that starts with a dash goes after --. send --kind report --failed reports a job that could not be done, --reply-to <letter> names the letter an answer is for. All three take --json.

delegate --worktree gives the job a git worktree of its own, made from the last commit of the checkout the command runs in, and a fresh session to work there. --check <command> names a command that shows the job is done: the bridge runs the checks when the job is reported on, those the rules of the project allow without asking, and the report comes with what they showed. diff shows what the job changed in its worktree. accept brings the work of a finished job into the checkout the command runs in, staged and not committed, and removes the worktree. It exits with 1 and touches nothing when files would conflict, and names them. accept --as-branch leaves the work as a branch instead, reject drops it. delegate takes the context of the job in flags that repeat: --done for what done looks like, --constraint, --decision, and --file src/a.ts:120-180="the retry loop" for a file to start from. The bridge puts them under the job with the lines of those files and the notes of the board that fit, within --context-tokens (6000 by default). send --kind report --lesson "..." names what the job taught. remember, recall and forget work on the board of the project: from a session they speak as that agent, from a terminal of your own as you, for the project the command runs in. serve keeps the board in memory.db in the folder of the bridge. See @cogitator-ai/bridge.

wait is what the wake hook of a Claude Code session runs: it waits for the mail of the session (--timeout <seconds>, 600 by default), and when a letter comes writes it to stderr and exits with code 2, which makes Claude Code wake the session with it. With --hook claude-code it takes the session from what Claude Code wrote to the hook's stdin, and --agent <name> is the name the bridge gave a session it started. Under the letters it adds one line saying how to answer through the bridge: with the tools when --tools says the session has them, with the command line otherwise. Without mail it exits with 0 and prints nothing. A failure, a mistyped option included, exits with 1 and never with 2, so an error cannot wake a session. See the Agent Bridge guide for the hook itself.

mcp is the server of the bridge's tools, started by a harness for a session, not by you: delegate, ask, answer, report, note, inbox, job, jobs, cancel, diff, accept, reject, remember, recall, forget and agents. It connects to the dispatcher for each call, so it may start before the dispatcher does. caller is the hook Claude Code runs before a call of one of these tools: it adds the session to the arguments of the call, since Claude Code keeps one server across /clear. It never exits with 2, which Claude Code would read as a refusal of the tool call. A folder of the bridge that is not the default one (--home, COGITATOR_BRIDGE_HOME) is written into the command of the server and of the hooks, since a harness does not always hand its environment on.


cogitator skill

cogitator skill create weather-api --template api   # basic | device | api; --global for ~/.cogitator/skills
cogitator skill validate skills/weather-api         # defaults to the current directory
cogitator skill list
cogitator skill add ./path/to/skill [--global]
cogitator skill remove weather-api [--global]

Local skills live in ./skills, global ones in ~/.cogitator/skills. Skill names must be kebab-case. validate loads skill.ts/skill.js/skill.mjs, checks the defineSkill shape and every tool, required environment variables (env) and that dependencies resolve from the skill's location; it exits non-zero on problems.


cogitator models

cogitator models                       # list installed models
cogitator models --pull qwen2.5:0.5b   # pull with progress
cogitator models --url http://gpu-box:11434
cogitator models --json                # name, size and date of each model

The Ollama URL is chosen in this order: an explicit --url, the configured llm.providers.ollama.baseUrl, OLLAMA_BASE_URL (then the OLLAMA_URL and OLLAMA_HOST aliases Ollama itself reads, port 11434 when none is given and 0.0.0.0 as localhost), and finally http://localhost:11434. An explicit --url uses that server's own connection, so the configured server's apiKey and headers are never sent to it. OLLAMA_API_KEY is sent as a bearer token. Custom headers in llm.providers.ollama.headers are sent with model discovery, pulls, run model detection, doctor and status probes, Content-Type and the API key's Authorization take precedence. Pull errors reported by Ollama (e.g. unknown model) fail the command.


cogitator status / logs

cogitator status          # compose services (state, health) + Ollama reachability
cogitator status --json
cogitator logs ollama -f -t -n 50
cogitator logs -n all
OptionDefaultDescription
[service]allService name (redis, postgres, …)
-f, --followfalseFollow log output
-n, --tail <lines>100Number of lines, or all
-t, --timestampsfalseShow timestamps

status still reports Ollama when Docker is not running.


cogitator deploy

cogitator deploy --dry-run          # analyze + preflight only
cogitator deploy --dry-run --json   # the plan for scripts and CI: secrets, services, warnings, checks
cogitator deploy                    # docker: build image, start compose stack
cogitator deploy --target fly --region ord
cogitator deploy --registry ghcr.io/acme   # build + push (use --no-push to skip)
cogitator deploy status
cogitator deploy logs -f            # stream the logs (docker compose logs / flyctl logs)
cogitator deploy logs ollama-pull   # docker: one compose service, the last 100 lines
cogitator deploy destroy
OptionDescription
-t, --target <target>docker (default) or fly
-c, --config <path>Config file to deploy from
--registry <url>Container registry to push to
--no-pushSkip pushing even when a registry is set
--dry-runShow the plan without executing
--region <region>Deploy region (Fly.io)
--jsonThe plan, result or status as JSON
-f, --followlogs: keep streaming new lines
-n, --tail <lines>logs: lines to show or all (docker)
--timestampslogs: prefix lines with time (docker)

The model, memory and deploy: section all come from one config file: the -c file, else the first of cogitator.yml, cogitator.yaml, .cogitator.yml, .cogitator.yaml. The plan lists the kind (server or worker), detected services (marked as not provisioned on Fly, where REDIS_URL / DATABASE_URL are required instead), volumes, required secrets (read from the environment or the project's .env), warnings and preflight checks. On Docker the deploy only succeeds when the app container keeps running after it starts, otherwise its last log lines are shown. A project whose models run on a local Ollama gets an ollama service in the compose stack that pulls them on the first start. deploy logs [service] runs docker compose logs for the deployed stack (every service, or app, ollama, ollama-pull, redis, postgres) and flyctl logs --app <app> on Fly, where the app is deploy.app (else the image name) and a new app is created in deploy.org. --timestamps has no short flag, -t is --target. A flag that does not apply to the action, such as --follow on deploy status or --json on deploy logs, and the docker-only service name, --tail and --timestamps on Fly are refused as usage errors (exit code 2). See @cogitator-ai/deploy and the deploy guide for details.


Environment Variables

VariableUsed byDescription
COGITATOR_CONFIGrunConfig file path
COGITATOR_MODELrunDefault model
COGITATOR_SESSIONS_DBrun -p, app-serverSQLite file of the sessions, default ~/.cogitator/sessions.db
COGITATOR_PLUGINS_DIRplugin, runtimeWhere installed plugins are kept
COGITATOR_TRIGGERS_DIRschedule, inbox, trigger, runtimeWhere the file stores of routines are kept, default .cogitator/triggers
COGITATOR_URL, COGITATOR_TRIGGER_TOKENtrigger fireThe server and the trigger's token
OLLAMA_URL / OLLAMA_HOSTrun, models, statusOllama endpoint
OLLAMA_API_KEYrun, models, wizardOllama Cloud / authenticated Ollama
OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEYrun, init, wizardProvider keys
COGITATOR_DEBUGallPrint stack traces
COGITATOR_TELEMETRY_DISABLED, DO_NOT_TRACKinitSend no anonymous usage event

See @cogitator-ai/config and the configuration guide for every COGITATOR_* variable.

On this page