Skip to content

CLI Overview

The Cosine CLI (command cos) is a powerful terminal interface that brings Cosine’s AI capabilities directly to your local development environment. With the CLI, you can have intelligent conversations about your code, automate tasks, and leverage external tools through the Model Context Protocol (MCP).

  • Interactive AI Sessions: Start a TUI session where you can chat with Cosine about your codebase
  • One-shot Tasks: Run single prompts without entering interactive mode
  • Repository Analysis: Automatically analyze your repo structure and get AI-generated context files
  • Browser Automation: Control Chrome for web-based tasks via CDP
  • MCP Integration: Connect external tools and APIs through Model Context Protocol servers
  • Skills Management: Install and manage reusable skill packages
CommandDescription
cos startStart the TUI (default command)
cos initInitialize repo with cosine.toml and AGENTS.md
cos loginAuthenticate with your Cosine account
cos skillsManage skills (see skills add)
cos ipcInter-process communication commands

All commands support these global flags:

FlagDescription
-i, --inferenceOpenAI-compatible inference host/base URL
-s, --system-promptSystem prompt ID (default: lumen)
-p, --promptRun once with this prompt (non-interactive)
--cwdWorking directory (default: current directory)
--auto-accept-plansAutomatically accept plans without confirmation
--auto-acceptAutomatically accept all tool executions
--debugEnable debug mode (dumps context window to /tmp/cosine/window.json)
--profileUse specific config profile
--workspaceWorkspace mode: os, vfs, or worktree
--modelOverride model for inference
--reasoningReasoning effort: low, medium, high, or xhigh
Terminal window
# Start in current directory
cos start
# Start in specific directory
cos start --cwd /path/to/project
# Start with specific model
cos start --model lumen
Terminal window
# Run a single prompt without interactive mode
cos start --prompt "Explain the main function in main.go"
# Combine with auto-accept for automation
cos start --prompt "Refactor the utils module" --auto-accept

The CLI reads configuration from multiple sources (in order of precedence):

  1. Command-line flags (highest priority)
  2. Repository config (.cosine.toml or cosine.toml)
  3. User config (~/.cosine.toml)
  4. Environment variables
  5. Defaults (lowest priority)

You can create profile-specific configs:

  • cosine.<profile>.toml in repo (project-specific)
  • ~/.cosine.<profile>.toml in home (user-specific)

Use with: cos --profile <profile> start