Configuration

Settings, config files, and environment variables.

Configuration Priority

otto checks in this order:

  1. Injected config createEmbeddedApp({...}) (highest)
  2. Environment variablesOPENAI_API_KEY, etc.
  3. Config files~/.config/otto/, .otto/
  4. Built-in defaults

Directory Structure

~/.config/otto/           # Global configuration
├── auth.json            # API keys (0600 permissions)
└── config.json          # Global defaults

.otto/                    # Project-specific
├── otto.sqlite           # Local conversation history
├── config.json          # Project configuration
├── agents.json          # Agent customizations
├── agents/              # Custom agent prompts
│   └── <agent-name>/
│       └── agent.md
├── commands/            # Custom command definitions
├── tools/               # Custom tool implementations
└── artifacts/           # Large outputs

Configuration Files

Global Auth

~/.config/otto/auth.json — API keys stored securely (file permissions: 0600):

{
  "openai": {
    "type": "api",
    "key": "sk-..."
  },
  "anthropic": {
    "type": "api",
    "key": "sk-ant-..."
  }
}

Global Config

~/.config/otto/config.json — User-wide defaults:

{
  "defaults": {
    "provider": "anthropic",
    "model": "claude-sonnet-4",
    "agent": "general"
  }
}

Project Config

.otto/config.json — Project-specific overrides:

{
  "defaults": {
    "provider": "openai",
    "model": "gpt-4",
    "agent": "build"
  }
}

Agent Customization

.otto/agents.json:

{
  "build": {
    "tools": ["read", "write", "bash", "git_*"],
    "prompt": ".otto/agents/build/agent.md"
  },
  "test": {
    "tools": ["read", "bash"],
    "appendTools": ["progress_update"]
  }
}

Environment Variables

# Provider API keys
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_GENERATIVE_AI_API_KEY=...
OPENROUTER_API_KEY=...

# Optional: Default provider/model/agent
OTTO_PROVIDER=openai
OTTO_MODEL=gpt-4
OTTO_AGENT=build

Configuration Scenarios

ModeInjectedEnv VarsFilesUse Case
CLI--YesDesktop development
CI/CD-Yes-GitHub Actions, Docker
EmbeddedYes--VSCode extension, SaaS
HybridPartialAPI keysDefaultsMix of all