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"]

Runtime flags have highest priority, followed by values in the selected personal profile and then build/code defaults. For model selection specifically, the order is runtime model override, profile model, then build/code default. Repository config no longer sets the model.

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
config.tomlDefault personal profileUser-wide
config.<profile>.tomlNamed personal profileUser-wide
.cosine.toml or cosine.tomlDeprecated project automation compatibilityRepository
mcp.jsonMCP server definitionsUser-wide

These files live in the platform-specific Cosine config/home directory (typically ~/.cosine on macOS and Linux). Create multiple personal profiles for different contexts:

Terminal window
# Use the default profile (config.toml)
cos
# Use the work profile (config.work.toml)
cos --profile work

Named repository files such as cosine.work.toml are unsupported. If an explicitly selected profile is missing, startup fails and reports its expected path, available profiles, and commands to create it or return to the default profile.

cos configure selects the profile before prompting for settings. Profile selection uses an explicit --profile flag first, then the target profile value, then the product default.

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
agent_browser_enabledboolfalseExpose browser-control tools; configurable from Command Centre Settings
agent_desktop_enabledboolfalseExpose foreground desktop-control tools; configurable from Command Centre Settings
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

The legacy agent_computer_enabled key is migrated to agent_desktop_enabled when the canonical key is absent. | latex_formatting | bool | false | Persisted LaTeX formatting preference | | ultra_enabled | bool | false | Enable Ultra daemon | | on_the_go_enabled | bool | false | Enable 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
enabledbooleanAllow browser automation when the session is started with --enable-agent-browser
executable_pathstringOptional path to Chrome, Chromium, or Brave
cdp_urlstringOptional Chrome DevTools URL, e.g. http://localhost:9222; attached browsers keep their launch mode
launch_modestringLocal browser mode: auto (default), headless, or headful
allowed_domainsarrayOptional list of domains the browser may visit

You can change launch_mode from the Command Centre Settings tab. A mode change applies to the next locally launched browser; it does not restart an existing browser.

[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

Repository [agent] — Deprecated project automation

Section titled “Repository [agent] — Deprecated project automation”

In .cosine.toml or cosine.toml, [agent] retains extra-context compatibility for project automation.

FieldTypeDescription
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

Personal settings and auth tokens live in platform-specific Cosine config/home files. Keep them private. Deprecated repository automation settings go in cosine.toml or .cosine.toml and are safe to commit when they contain no secrets.

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