Skip to content

Configuration

Cosine CLI can be configured through three methods (in priority order):

  1. Command-line flags — Override everything (highest priority)
  2. TOML configuration files — User and project settings
  3. Environment variables — System-level overrides

Your personal settings and API tokens. Never commit this file.

[auth]
user_id = "usr_xxx"
token = "tok_xxx"
[inference]
model = "gpt-5"
reasoning_level = "medium"
[config]
system_prompt_id = "lumen"
shell = "/bin/zsh"
agent_commits = true
[browser]
cdp_url = "http://localhost:9222"

Project-specific settings. Safe to commit to version control.

is_topmost_config = true
[agent]
model = "codex"
extra_context = "AGENTS.md"
[hooks]
on_save = "npm run lint -- --fix {file}"
Terminal window
# Override model for one session
cos start --model gpt-4o --reasoning high
# One-shot automation
cos start --prompt "Review code" --auto-accept
# Use profile
cos start --profile work
# Debug mode
cos start --debug

PrioritySourceUse Case
1Command flagsTemporary overrides
2cosine.tomlProject settings
3~/.cosine.tomlPersonal preferences
4Environment varsSystem defaults
5Built-in defaultsFallbacks

FileLocationPurpose
~/.cosine.tomlHome directoryUser settings, secrets
cosine.tomlRepository rootProject settings
~/.cosine.<profile>.tomlHome directoryProfile configs
cosine.<profile>.tomlRepositoryProfile configs
~/.cosine/mcp.jsonHome directoryMCP servers

Create different configurations for work/personal:

Terminal window
# Use work profile
cos --profile work start
# Use personal profile
cos --profile personal start

OptionDefaultDescription
modelgpt-5.4Main agent model
small_modelclaude-sonnet-4-6-1mFast tasks
micro_modelclaude-haiku-4-5Memory queries
reasoning_levelmediumnone, low, medium, high, xhigh, adaptive (model-dependent)
max_context_tokens0Context limit (0=unlimited)
max_turns0Turn limit (0=unlimited)
OptionDefaultDescription
system_prompt_idlumenlumen, judge, orchestrator
agent_commitstrueAuto-create Agent Commits after each turn
shell$SHELLTerminal shell
themedarkdark or light
ultra_enabledfalseBackground daemon
[agent]
# Disable specific tools
disabled_tools = ["edit", "mcp_slack_*"]

Terminal window
# Override config file location
export COSINE_CONFIG_FILE=/path/to/config.toml
# MCP server API keys
export OPENAI_API_KEY=sk-...
export GITHUB_TOKEN=ghp_...

  1. Keep secrets in ~/.cosine.toml — Never commit API tokens
  2. Use profiles — Separate work and personal settings
  3. Use is_topmost_config — In monorepo roots to stop parent config searches
  4. Override with flags — For temporary changes without editing files