Skip to content

TOML Config

Cosine CLI can be configured through multiple sources: TOML configuration files, command-line flags, and environment variables. This guide covers user config, repository config, and MCP config as separate files because each file has its own schema.

Your personal settings and global preferences. Keep this file private because it can contain provider preferences and local project mappings.

# ============================================================
# COSINE CLI USER CONFIGURATION (~/.cosine/config.toml)
# ============================================================
# ------------------------------------------------------------
# AUTHENTICATION
# ------------------------------------------------------------
# Credentials (user_id, token, team_id, team_name, team_slug) are stored
# in ~/.cosine/auth.json and are NOT written to config.toml. Only provider
# preferences live here.
# OpenAI OAuth for ChatGPT subscription users
[auth.openai]
auth_method = "oauth"
oauth_redirect_uri = "http://localhost:1455/auth/callback"
# GitHub Copilot subscription users
[auth.copilot]
auth_method = "copilot"
# ------------------------------------------------------------
# API & INFERENCE
# ------------------------------------------------------------
[api]
base_url = "https://api.cosine.sh"
[inference]
base_url = "https://api.cosine.sh"
model = "gpt-5.5"
model_selection_id = "cosine:gpt-5.5"
small_model = "claude-sonnet-4-6-1m"
micro_model = "claude-haiku-4-5"
review_model = "gemini-3.1-pro"
max_context_tokens = 128000
max_turns = 100
# ------------------------------------------------------------
# GENERAL SETTINGS
# ------------------------------------------------------------
[config]
system_prompt_id = "lumen"
reasoning_level = "medium"
mode = "auto"
shell = "/bin/zsh"
agent_commits = true
api_sessions = true
ghost_text_enabled = true
memory_recall_mode = "every"
memory_recall_detail = "snippet"
theme = "dark"
overview_graph_mode = "tokens"
runner_background_theme = "spinner"
# ------------------------------------------------------------
# BROWSER & MCP
# ------------------------------------------------------------
[browser]
cdp_url = "http://localhost:9222"
tool_backend = "browser"
# ------------------------------------------------------------
# ULTRA DAEMON (Background task suggestions)
# ------------------------------------------------------------
[ultra.inactivity_minutes]
repo = 15
gmail = 5
# ------------------------------------------------------------
# PROJECT MAPPINGS
# ------------------------------------------------------------
[projects]
"/Users/me/work/api" = { project_id = "proj_abc123" }
# ------------------------------------------------------------
# TOOL CONFIGURATION
# ------------------------------------------------------------
[agent]
disabled_tools = ["edit"]

Configuration is usually resolved in this order (highest to lowest priority):

  1. Command-line flags - Override everything else
  2. Repository config - Project-specific settings in cosine.toml
  3. User config - Personal settings in ~/.cosine/config.toml
  4. Environment variables - Auth and file-location overrides
  5. Default values - Built-in defaults

Some environment variables are not simple defaults. COSINE_CONFIG_FILE selects the user config file path before loading, and COSINE_AUTH_* variables override credentials loaded from ~/.cosine/auth.json.

FilePurposeScope
~/.cosine/config.tomlUser settings and preferencesUser-wide
.cosine.toml or cosine.tomlProject-specific settingsRepository
cosine.<profile>.tomlProfile-specific project configRepository
~/.cosine/config.<profile>.tomlProfile-specific user configUser-wide
~/.cosine/mcp.jsonMCP server definitionsUser-wide

Create multiple profiles for different contexts:

Terminal window
# Use work profile (looks for cosine.work.toml or ~/.cosine/config.work.toml)
cos --profile work start
# Use personal profile
cos --profile personal start

Profile resolution order:

  1. cosine.<profile>.toml in repo (project-specific)
  2. ~/.cosine/config.<profile>.toml in Cosine home (user-specific)

The sections below cover the TOML keys you are most likely to edit directly.

Auth credentials (user_id, token, team_id, team_name, team_slug) are stored in ~/.cosine/auth.json (mode 0600) and are never written to config.toml. They are managed automatically by cos login / cos logout. Manual configuration is rarely needed; to override at runtime use the COSINE_AUTH_TOKEN, COSINE_AUTH_USER_ID, COSINE_AUTH_TEAM_ID, COSINE_AUTH_TEAM_NAME, and COSINE_AUTH_TEAM_SLUG environment variables.

The [auth] TOML section is reserved for provider preferences only:

FieldTypeDescription
auth.openai.auth_methodstring"cosine" or "oauth"
auth.openai.oauth_redirect_uristringOAuth callback URL
auth.copilot.auth_methodstring"copilot" for GitHub Copilot-backed models
FieldTypeDefaultDescription
base_urlstringhttps://api.cosine.shBase URL for Cosine API
FieldTypeDefaultDescription
base_urlstringhttps://api.cosine.shOpenAI-compatible endpoint
modelstringlumen-outpostDefault agent model
model_selection_idstringderived from modelProvider-qualified model ID, such as cosine:gpt-5.5
small_modelstringclaude-sonnet-4-6-1mFast model for quick tasks
micro_modelstringclaude-haiku-4-5Tiny model for memory queries
review_modelstringgemini-3.1-proModel for code reviews
max_context_tokensint0 (no override)Max context window; values at or below 0 are ignored
max_turnsint0 (no override)Max conversation turns; values at or below 0 are ignored

Available model IDs include: cosine:auto, cosine:lumen-outpost, cosine:gpt-5.5, cosine:gpt-5.4, cosine:claude-sonnet-4-6-1m, cosine:gemini-3.1-pro, ChatGPT-backed IDs such as chatgpt:gpt-5.5, Claude Max IDs such as claudemax:claude-sonnet-4-6, and Copilot IDs such as copilot:gpt-5.5.

FieldTypeDefaultDescription
system_prompt_idstringlumenDefault prompt: lumen, judge, orchestrator
reasoning_levelstringmediumnone, low, medium, high, xhigh, adaptive, or max
modestringmanualStartup mode: manual, auto, plan, swarm; normal also maps to manual
shellstringdetectedPreferred shell for terminal sessions
agent_commitsbooltrueAuto-create Agent Commits per turn
api_sessionsbooltrueEnable API-backed session persistence and remote resume
auto_acceptboolfalsePersisted default auto-accept preference
ghost_text_enabledbooltrueEnable inline autocomplete suggestions in the TUI
memory_recall_modestringfirstfirst or every (when to recall memory)
memory_recall_detailstringsnippetsnippet or full (memory detail)
themestringdarkUI theme, typically dark or light
overview_graph_modestringtokensOverview graph mode: tokens or resources
runner_background_themestringspinnerRunner background motion: spinner, blue-shift, knight, bloom, runway, twin-beam, ripple, or aurora
runner_background_colorstringunsetRunner color key: unset/default, theme names, mode, or session
latex_formattingboolfalsePersisted LaTeX formatting preference
ultra_enabledboolfalseEnable Ultra daemon
on_the_go_enabledboolfalseEnable the Desktop On the Go listener

Autocomplete suggestions: Toggle from the TUI with /autocomplete or through SettingsAutocomplete. When ghost_text_enabled = false, Cosine does not request background autocomplete suggestions.

Reasoning levels: none (minimal internal reasoning), low (fast), medium (balanced), high (thorough), xhigh (supported GPT/Codex models), adaptive (supported Claude models), max (supported models only)

For guidance on when to use each level, see Reasoning.

Older configs that still use checkpointing are still read, but new configs should use agent_commits.

telemetry.enabled is not a configurable opt-out. Telemetry is enabled after config load even if a config file sets it to false.

Shell paths:

  • Bash: /bin/bash
  • Zsh: /bin/zsh
  • Fish: /opt/homebrew/bin/fish
FieldTypeDescription
cdp_urlstringChrome DevTools URL, e.g., http://localhost:9222
tool_backendstringBrowser tool backend: browser, browseruse, or safari on supported macOS surfaces

[ultra.inactivity_minutes] — Ultra Daemon

Section titled “[ultra.inactivity_minutes] — Ultra Daemon”

Minutes of inactivity before suggesting tasks from each source:

[ultra.inactivity_minutes]
repo = 15 # Local coding (default: 15)
slack = 0 # Slack MCP server
github = 0 # GitHub MCP server
linear = 0 # Linear MCP server
gmail = 5 # Gmail

In ~/.cosine/config.toml, [agent] controls user-wide tool settings.

FieldTypeDescription
disabled_toolsarrayTools to disable: ["edit", "mcp_*"]

Tool rules:

  • Exact match: "edit"
  • Wildcard: "mcp_*" (disables all MCP tools)

Manage via terminal user interface (TUI): Press Ctrl+PToolsSpace to toggle

In .cosine.toml or cosine.toml, [agent] controls project-specific defaults.

FieldTypeDescription
modelstringModel override for this repo
extra_contextstringPath to context file (e.g., AGENTS.md)

The legacy camelCase key extraContext is still read, but new repo configs should use extra_context.

FieldTypeDescription
on_savearray(table)One or more [[hooks.on_save]] entries that run after file writes

Each hook entry supports:

FieldTypeDescription
matcherstringRegex matched against the tool name. Use "edit" to cover edit, apply_patch, and find_replace_in_file.
directoriesarray(string)Optional directory prefixes, relative to the config root.
extensionsarray(string)Optional file extensions to match, without leading dots.
commandstringShell command to run
asyncboolStart the hook in the background instead of blocking the tool call

Placeholders:

  • {file} or {{file}} — replaced with the saved file path

Environment variables:

  • COSINE_ON_SAVE_FILE — Path to saved file
  • COSINE_ON_SAVE_CONFIG — Path to config file
  • COSINE_ON_SAVE_TOOL — Tool name that triggered the hook
[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

For scoped examples and execution details, see Hooks.

Map local directories to Cosine project IDs:

[projects]
"/Users/me/work/api" = { project_id = "proj_abc123" }
"/Users/me/work/web" = { project_id = "proj_def456" }

TOML config is the long-lived source of truth, but you can override it per session with CLI flags.

Common examples:

Terminal window
cos start --model gpt-5.5 --reasoning high
cos start --profile work --debug
cos start --cdp-url http://localhost:9222 --auto-accept

For the full flag reference, examples, and in-page jump links, see Commands.

Override the default config file location:

Terminal window
export COSINE_CONFIG_FILE=/path/to/custom/config.toml
cos start

Some MCP servers need API keys as environment variables:

Terminal window
export OPENAI_API_KEY=sk-...
export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...
cos start

User settings go in ~/.cosine/config.toml and auth tokens live in ~/.cosine/auth.json. Keep both private. Project settings go in cosine.toml or .cosine.toml and are safe to commit when they contain only project defaults.

Terminal window
cos --profile work start # Work settings
cos --profile personal start # Personal settings
Terminal window
cos start --model gpt-5.5 --debug # One session only

Mark root config to stop parent directory searches:

is_topmost_config = true
Terminal window
cos start --debug # See loaded config
cos start # Check MCP status in TUI