CLI Configuration
Cosine CLI can be configured through multiple sources: command-line flags, configuration files, and environment variables. This guide covers all configuration options and how to use them effectively.
Configuration Sources (Priority Order)
Section titled “Configuration Sources (Priority Order)”Configuration is resolved in this order (highest to lowest priority):
- Command-line flags - Override everything else
- Repository config - Project-specific settings in
cosine.toml - User config - Personal settings in
~/.cosine.toml - Environment variables - System-level overrides
- Default values - Built-in defaults
Configuration Files
Section titled “Configuration Files”User Configuration (~/.cosine.toml)
Section titled “User Configuration (~/.cosine.toml)”The main configuration file for your user account. Store personal preferences, API tokens, and global settings here.
[auth]user_id = "usr_123456789"token = "your_api_token_here"
[api]base_url = "https://api.cosine.wtf"
[inference]base_url = "https://api.cosine.wtf"model = "lumen"max_context_tokens = 128000max_turns = 100
[config]system_prompt_id = "lumen"latex_formatting = falsereasoning_level = "medium"
[browser]cdp_url = "http://localhost:9222"
[telemetry]enabled = trueRepository Configuration (cosine.toml or .cosine.toml)
Section titled “Repository Configuration (cosine.toml or .cosine.toml)”Project-specific configuration that lives in your repository. This is ideal for team settings and project-specific behavior.
is_topmost_config = true
[agent]model = "codex"extra_context = "AGENTS.md"
[hooks]on_save = "go test ./..."Profile-specific Configs
Section titled “Profile-specific Configs”Create multiple configuration profiles for different contexts:
In your repo:
# cosine.work.toml for work projectscos --profile work start
# cosine.personal.toml for personal projectscos --profile personal startIn your home directory:
cos --profile work start
# ~/.cosine.personal.tomlcos --profile personal startProfile resolution order:
- Check for
cosine.<profile>.tomlin the repo - Check for
~/.cosine.<profile>.tomlin home
Configuration Sections
Section titled “Configuration Sections”Authentication ([auth])
Section titled “Authentication ([auth])”Your Cosine account credentials.
| Field | Type | Description |
|---|---|---|
user_id | string | Your Cosine user ID |
token | string | Your API authentication token |
Setting credentials:
# Via login command (recommended)cos login
# Or manually via flagcos start --api-key your_token_hereAPI Settings ([api])
Section titled “API Settings ([api])”Base configuration for Cosine’s API.
| Field | Type | Default | Description |
|---|---|---|---|
base_url | string | https://api.cosine.wtf | Base URL for API requests |
Inference Settings ([inference])
Section titled “Inference Settings ([inference])”Configure the AI model and inference behavior.
| Field | Type | Default | Description |
|---|---|---|---|
base_url | string | https://api.cosine.wtf | OpenAI-compatible inference endpoint |
model | string | codex | Default model for sessions |
max_context_tokens | int | 0 (unlimited) | Maximum context window size |
max_turns | int | 0 (unlimited) | Maximum conversation turns |
Available models:
codex- Default model for general taskslumen- Alternative model optimized for specific tasksjudge- Model for evaluation tasksorchestrator- Model for orchestration tasks
General Config ([config])
Section titled “General Config ([config])”Miscellaneous configuration options.
| Field | Type | Default | Description |
|---|---|---|---|
system_prompt_id | string | lumen | Default system prompt ID |
latex_formatting | bool | false | Enable LaTeX formatting in responses |
reasoning_level | string | "medium" | Default reasoning effort level |
shell | string | "" | Preferred shell for terminal sessions |
checkpointing | bool | true | Enable automatic checkpointing each turn |
Reasoning levels:
low- Faster responses, less thoroughmedium- Balanced speed and depthhigh- Slower but more thoroughxhigh- Maximum depth (Codex models only)
Shell configuration:
By default, the CLI uses your system’s `$SHELL` environment variable (falling back to `/bin/bash` on Unix or `cmd.exe` on Windows). You can override this to use a different shell:
[config]shell = "/opt/homebrew/bin/fish"Common shell paths:
- Bash: `/bin/bash`
- Zsh: `/bin/zsh` or `/usr/local/bin/zsh`
- Fish: `/opt/homebrew/bin/fish` or `/usr/bin/fish`
- Dash: `/bin/dash`
The configured shell must exist on your system or the CLI will fall back to the default shell detection.
Checkpointing:
By default, Cosine CLI creates a checkpoint at the end of each agent turn, committing only the files the agent edited. Each checkpoint is a lightweight git commit that you can revert or reapply from the timeline. To disable this globally:
[config]checkpointing = falseYou can also disable it per session with the `—checkpointing=false` flag:
cos start --checkpointing=falseBrowser ([browser])
Section titled “Browser ([browser])”Chrome DevTools Protocol (CDP) configuration for browser automation.
| Field | Type | Description |
|---|---|---|
cdp_url | string | URL to Chrome’s debugging port (e.g., http://localhost:9222) |
MCP ([mcp])
Section titled “MCP ([mcp])”Model Context Protocol server configurations. See MCP Configuration for detailed documentation.
[mcp.servers.myserver]transport = "stdio"command = "npx"args = ["-y", "@modelcontextprotocol/server-filesystem", "/path"]Repository Agent ([agent])
Section titled “Repository Agent ([agent])”Settings for the AI agent in this specific repository.
| Field | Type | Description |
|---|---|---|
model | string | Override the default model for this repo |
extra_context | string | Path to a markdown file to append to system prompts |
Hooks ([hooks])
Section titled “Hooks ([hooks])”Automated actions triggered by CLI events.
| Field | Type | Description |
|---|---|---|
on_save | string | Shell command to run after file writes |
on_save details:
- Runs via
sh -cwith working directory set to the config’s directory - Supports
{file}or{{file}}placeholder for the saved file path - Exposes environment variables:
COSINE_ON_SAVE_FILE- Path to the saved fileCOSINE_ON_SAVE_CONFIG- Path to the config file
Example with placeholder:
[hooks]on_save = "go test ./... -run TestRelatedTo{file}"Telemetry ([telemetry])
Section titled “Telemetry ([telemetry])”Control usage data collection.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable/disable telemetry |
Environment Variables
Section titled “Environment Variables”COSINE_CONFIG_FILE
Section titled “COSINE_CONFIG_FILE”Override the default user config file location:
export COSINE_CONFIG_FILE=/path/to/custom/config.tomlcos startOPENAI_API_KEY / Custom Keys
Section titled “OPENAI_API_KEY / Custom Keys”Some MCP servers require their own API keys as environment variables:
export OPENAI_API_KEY=sk-...cos startCommand-line Flags Reference
Section titled “Command-line Flags Reference”All available global flags:
| Flag | Short | Description | Default |
|---|---|---|---|
--inference | -i | Inference base URL | From config |
--system-prompt | -s | System prompt ID | lumen |
--prompt | -p | One-shot prompt | - |
--cwd | - | Working directory | . |
--api-key | -k | API token | From config |
--auto-accept-plans | - | Auto-accept plans | false |
--auto-accept | - | Auto-accept all | false |
--checkpointing | - | Enable checkpointing | true |
--debug | - | Debug mode | false |
--forceUpdate | - | Force update flow | false |
--lsp-diagnostics-on-file-read | - | Include LSP diagnostics | false |
--profile | - | Config profile | - |
--workspace | - | Workspace mode | os |
--worktree-name | - | Worktree name | - |
--endpoint | - | API endpoint URL | From config |
--cdp-url | - | Chrome CDP URL | From config |
--model | - | Model override | From config |
--reasoning | - | Reasoning level | From config |
Complete Configuration Example
Section titled “Complete Configuration Example”A comprehensive example showing all configuration options:
~/.cosine.toml:
[auth]user_id = "usr_123456789"token = "tok_abcdef123456"
[api]base_url = "https://api.cosine.wtf"
[inference]base_url = "https://api.cosine.wtf"model = "lumen"max_context_tokens = 128000max_turns = 50
[config]system_prompt_id = "lumen"latex_formatting = falsereasoning_level = "high"
[browser]cdp_url = "http://localhost:9222"
[telemetry]enabled = truecosine.toml (in repo):
is_topmost_config = true
[agent]model = "codex"extra_context = "AGENTS.md"
[hooks]on_save = "npm run lint -- --fix {file}"Configuration Tips
Section titled “Configuration Tips”1. Keep Secrets in User Config
Section titled “1. Keep Secrets in User Config”Don’t commit API tokens to version control. Put them in ~/.cosine.toml, not cosine.toml.
2. Use Profiles for Context Switching
Section titled “2. Use Profiles for Context Switching”Create different profiles for work vs. personal projects:
# Work profile with work settingscos --profile work start
# Personal profile with personal preferencescos --profile personal start3. Override per Session
Section titled “3. Override per Session”Use flags for temporary overrides without changing config files:
# Use a different model just for this sessioncos start --model codex
# Debug mode for troubleshootingcos start --debug4. Topmost Config for Monorepos
Section titled “4. Topmost Config for Monorepos”In monorepos, mark the root config as topmost:
# In root cosine.tomlis_topmost_config = true
# CLI won't look above this directory for config5. Validate Your Config
Section titled “5. Validate Your Config”Test your configuration:
# Start with debug mode to see loaded configcos start --debug
# Check if MCP servers load correctlycos start # Look for MCP status in the TUINext Steps
Section titled “Next Steps”- MCP Configuration - Connect external tools
- Browser Automation - Configure Chrome CDP
- Skills - Manage reusable skill packages