Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

CLI launch settings, persistent JSON, generated NixOS configuration, and secret discovery are different inputs. A provider key is not another level in ordinary settings precedence.

Local settings

Inside the Zellij harness, /settings or Ctrl+, opens the session settings screen. It shares the bootstrap star header and centered layout. Type to filter models, use arrow keys to select, and review a change before applying it. The star hangs left of the title, and navigation stays at the bottom of the pane. Escape cancels; an existing chat draft is preserved when opening by shortcut. Model changes in that picker affect the current session only. When attached to a remote agent, the screen is informational and directs changes to that host.

cowboy init offers only Harness or Docker in Python, then opens the Rust name screen unless a name was supplied. Harness enters the local Zellij session; Docker provisions a container and opens its existing Rust bootstrap wizard. --mode harness or --mode docker bypasses the picker. Persistent local settings UI integration with the Rust wizard is still pending. Noninteractive local configuration remains available through init --settings.

The settings backend supports explicit credential references; it has no discovery of existing setup. Choosing Codex in the local wizard asks which codex login credential file to use, suggesting $CODEX_HOME/auth.json (~/.codex/auth.json by default) without reading it. Enter confirms the suggestion; the save refuses a missing file or one group or others can read. Checks establish credential presence, not successful provider authentication. A failed save preserves the previously committed setup.

After setup completes, selected provider references take precedence over the legacy discovery order below. Unselected environment credentials and project configuration cannot replace them. Existing managed credential provisioning retains its own launch path. See operator settings for persistence and ownership semantics.

The launcher merges JSON objects in this order, with later files winning:

  1. /etc/cowboy/config.json
  2. ~/.config/cowboy/config.json (under the configured XDG config directory)
  3. .cowboy/config.json in the current directory

Missing, unreadable, malformed, and non-object files contribute no settings. Explicit CLI options override the corresponding ordinary settings.

For provider and main model, merged files override generated agent JSON, which overrides built-in defaults. A merged provider without a model beside it drops the agent JSON’s model, so the provider’s default applies, as --model <provider> does. Heartbeat and chrome come from CLI options or merged files only. An explicit false counts: --no-chrome turns chrome off even when a merged file turns it on. For secondary models and memory/rerank settings, generated agent JSON overrides merged files; supported CLI options still win. The main log level comes from CLI options or merged files only. max_output_tokens, sweep_floor and qmd_min_score come from generated agent JSON only, so a resident launched with harness, cowboy ask or cowboy serve <name> gets the values its daemon unit has. Do not assume one precedence order covers every field. The declared systemd daemon takes its arguments from NixOS configuration directly, rather than reading the operator’s local launch defaults.

A local config can contain:

{
  "provider": "openai",
  "model": "served-model",
  "openai_base_url": "https://inference.example/v1",
  "log_level": "info"
}

openai_base_url selects an arbitrary OpenAI-compatible Chat Completions endpoint. The value should include the API prefix (commonly /v1); Cowboy normalizes trailing slashes before appending /chat/completions. It can also come from OPENAI_BASE_URL when no JSON or generated agent setting supplies one. A configured endpoint may be keyless for local servers, or use the normal OPENAI_API_KEY/openai_api_key credential path for bearer authentication. Custom endpoints always use Chat Completions, even for model names that the first-party OpenAI service would route through its Responses API.

cowboy config set <key> <value> edits the user file. It accepts only the settings the launcher reads and stores each as its JSON type: chrome as true or false, heartbeat, rerank_top_n and codex_quota_threshold (1–100) as positive integers, and rerank_min_score as a number. It refuses any other key or value and leaves the file unchanged.

Common settings subset

This is a common subset, not the entire recognized surface. The implementation inventory is crates/contracts/src/keys.rs; a host or launcher need not expose every component key as a CLI option.

KeyMeaning
providerProvider for the main model
modelBare model ID in local JSON; provider comes from the separate key
openai_base_urlBase URL for an OpenAI-compatible Chat Completions endpoint
summary_modelProvider:model specification for summarization
compact_modelProvider:model specification for compaction
subagent_modelProvider:model specification for sub-agents
vision_modelNative vision or a separate provider:model specification
memory_backendMemory search backend
heartbeatLauncher heartbeat interval, in seconds
log_levelLogging verbosity

The component key for heartbeat is heartbeat_interval; the launcher’s JSON setting and flag use heartbeat and --heartbeat. Model availability and provider access are separate: selecting a model does not provision credentials. Use cowboy models to inspect the bundled catalog and each command’s --help for its options.

Secrets

Outside proxy deployments, discovery checks each key in this order and uses the first nonempty value:

  1. Provider environment variable, such as ANTHROPIC_API_KEY.
  2. User keys file, ~/.config/cowboy/keys.json.
  3. System keys file, /etc/cowboy/keys.json.
  4. The provider’s agenix file, if readable.

Keys files map component key names, such as anthropic_api_key, to secret values. They must have mode 0600: files accessible to group or other users are skipped with a warning. Local and noninteractive --settings Docker deployments can store real credentials in those files. Interactive cowboy init --mode docker uses the separate credential proxy: its /etc/cowboy/keys.json contains the literal "proxy" placeholder, while the encrypted credential and age identity stay in the proxy’s private volume. See Docker connector setup for the separate status of connector credentials.

Managed daemons receive proxy placeholders. The actual key belongs at the secret path named by the proxy domain mapping, readable by the proxy service user. The managed installation shows an agenix declaration with that ownership.

First-boot settings

A --settings file for cowboy init or cowboy serve is a validated bootstrap input, not the general config file. It accepts a key reference through api_key_env or api_key_file; a literal api_key is rejected. For example:

{
  "agent_name": "myagent",
  "posture": "container",
  "provider": "anthropic",
  "model": "claude-opus-4-5-20251101",
  "api_key_env": "ANTHROPIC_API_KEY"
}

An authenticated OpenAI-compatible endpoint can be bootstrapped without putting its secret in the settings file:

{
  "provider": "openai",
  "model": "served-model",
  "openai_base_url": "https://inference.example/v1",
  "api_key_env": "INFERENCE_API_KEY"
}

Omit api_key_env/api_key_file for a keyless local compatible server.

The host resolves the reference and writes the key into the agent’s configuration volume with mode 0600. A bootstrapped volume rejects restaging; edit its persistent configuration instead. See daily operation for generation and backup considerations.

NixOS module

Import the default NixOS module and enable individual agents under services.cowboy.agents. There is no top-level service enable switch. Keep agent usernames equal to their agent names when using Redis ACLs, and give each enabled agent a unique UID.

The main model option takes a provider:model specification. Common per-agent options include homeDirectory, prompts.system, mounts, daemon.enable, and daemon.expose. The latter provides an authenticated control endpoint; daemon.observe provides a separate read-only endpoint and credential.

Nix generates per-agent launch configuration and components, and message-source configuration for agents and bridges. Edit the Nix declaration, not the generated files under /etc/cowboy. The full per-agent schema is in modules/options/user.nix.

Managed provider access is provisioned from the model options. To keep another keyed provider available for a runtime model switch, declare it in extraProviders and provision its proxy secret. This grants provider access; it does not select the main model.

For a managed agent, set openaiBaseUrl beside an openai:<model> model. Credential provisioning remains separate: configure the secrets proxy domain mapping for the endpoint and its key. The URL is ordinary configuration; the key must remain in the existing secret-reference/proxy path.

Continue with tools and skills and bridge integration.

Docker bootstrap handoff

Docker’s Zellij wizard asks which connectors the user wants to discuss, using an optional filtered checklist. It records interests, not connected accounts. Setup chat then establishes the agent’s purpose and configures selected connectors one at a time when access is ready. Harness setup stays brief. A prose profile does not provision a service.

When a connector needs a credential, the setup agent can hand the terminal back to the host. The existing masked Zellij wizard lets the user paste it; the wizard encrypts it to the proxy’s age recipient before writing output. The user can instead provision an age file at the printed private host path. Setup chat resumes afterward, with only credential status exposed to the agent. The agent must keep configured, verified, and missing capabilities distinct.

Before the setup chat, Cowboy seeds flake.nix, agent.nix, and environment.nix in the configuration volume. Edit environment.nix to add packages and local build checks; packages reach both nix develop and the persistent agent’s PATH. Scripts belong in the persistent workspace and should be tested against safe fixtures during setup. Unfinished setup resumes with these edits intact; a seeded flake alone does not mark setup complete.

After the user agrees to finish, cowboy __finish-bootstrap checks the saved profile, runs nix flake check, and builds the edited configuration. Only successful checks and a build writes the completion marker and closes the setup session. Missing external credentials can remain explicitly pending, but do not prevent independent package and script work.

Ctrl-Q exits the setup terminal without marking setup complete. After successful completion, host init restarts the container into the configured supervisor and opens its chat client. Closing that client leaves the supervisor running.

Docker credential entry stays in the masked Zellij wizard. The Rust plugin age-encrypts credentials in memory to a host-generated public recipient before writing its output. Only ciphertext leaves the plugin; the host stores it and the private identity under the agent volume’s private proxy/ directory. Only the companion mounts that directory and decrypts credentials. The agent receives placeholders and a public CA bundle. The companion starts before setup chat and runs the credential proxy and Redis; individual bridge configuration and shared connector forms remain separate work.