Skip to content

Configuration

Cosine CLI can be configured through three methods:

  1. Command-line flags — Per-session overrides
  2. TOML configuration files — User and project settings
  3. Environment variables — Auth and file-location overrides

Your personal settings. Never commit this file.

Authentication tokens are stored separately in ~/.cosine/auth.json (managed automatically by cos login / cos logout) and never appear in config.toml.

[inference]
model = "gpt-5.5"
model_selection_id = "cosine:gpt-5.5"
[config]
system_prompt_id = "lumen"
reasoning_level = "medium"
shell = "/bin/zsh"
agent_commits = true
ghost_text_enabled = true
[browser]
cdp_url = "http://localhost:9222"

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

is_topmost_config = true
[agent]
model = "gpt-5.3-codex"
extra_context = "AGENTS.md"
[hooks]
[[hooks.on_save]]
matcher = "edit"
directories = ["apps/website"]
extensions = ["ts", "tsx"]
command = "pnpm exec eslint --fix --no-warn-ignored \"$COSINE_ON_SAVE_FILE\""
async = false
Terminal window
# Override model for one session
cos start --model gpt-5.5 --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/config.tomlPersonal preferences
4Environment varsAuth and config-file overrides
5Built-in defaultsFallbacks

Some environment variables are not simple defaults. COSINE_CONFIG_FILE selects a different user config file, and COSINE_AUTH_* variables override fields loaded from ~/.cosine/auth.json.


FileLocationPurpose
~/.cosine/config.tomlCosine homeUser settings and preferences
cosine.tomlRepository rootProject settings
.cosine.tomlRepository rootProject settings, preferred when both files exist
~/.cosine/config.<profile>.tomlCosine homeUser profile 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
base_urlhttps://api.cosine.shOpenAI-compatible inference endpoint
modellumen-outpostMain agent model
model_selection_idderived from modelProvider-qualified model ID, such as cosine:gpt-5.5
small_modelclaude-sonnet-4-6-1mFast tasks
micro_modelclaude-haiku-4-5Memory queries
review_modelgemini-3.1-proCode review tasks
max_context_tokens0Context limit (0=unlimited)
max_turns0Turn limit (0=unlimited)
OptionDefaultDescription
system_prompt_idlumenlumen, judge, orchestrator
reasoning_levelmediumnone, low, medium, high, xhigh, adaptive, or max
modemanualStartup mode: manual, auto, plan, swarm
agent_commitstrueAuto-create Agent Commits after each turn
api_sessionstrueUse API-backed session persistence and resume
ghost_text_enabledtrueEnable inline autocomplete suggestions in the TUI
shell$SHELLTerminal shell
themedarkdark or light
ultra_enabledfalseBackground daemon

Autocomplete shows inline suggestions while you type in the TUI. It is enabled by default.

To toggle it from the TUI:

  1. Type / in an empty chat input to open the commands menu.
  2. Search for autocomplete or select Autocomplete.
  3. Press Enter.

You can also run /autocomplete directly. The preference is saved to your CLI config as ghost_text_enabled.

When autocomplete is off, Cosine does not request background autocomplete suggestions.

[agent]
# Disable specific tools
disabled_tools = ["edit"]

In user config, [agent] supports disabled_tools. Repository config has its own [agent] section for project-specific model and extra_context.


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 user config private~/.cosine/config.toml stores personal preferences, while auth tokens live in ~/.cosine/auth.json
  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