Skip to content

Setup command

Muhammet Şafak edited this page May 27, 2026 · 1 revision

commitbrief setup

Interactive provider + API key + model wizard.

Synopsis

commitbrief setup [--local]

setup is the one command users run before they have a repo configured. It tolerates being invoked outside a git repo (when --local is not passed) so a fresh machine can be set up before cloning anything.

Flow

  1. Pick a provider. Choose from the registered list. Built-in options:
    • Anthropic (Claude) — needs API key
    • OpenAI (GPT) — needs API key
    • Google Gemini — needs API key
    • Ollama (local) — needs base URL, no API key
  2. API key. For providers with NeedsKey: true, the wizard prompts for the key with password masking (huh.EchoModePassword). A link to the provider's console (Anthropic / OpenAI / AI Studio) is shown in the help line.
  3. Base URL. For Ollama only, the wizard asks for the base URL, defaulting to http://localhost:11434.
  4. Model. For Anthropic / OpenAI / Gemini the wizard offers the static model list (see each Provider page). For Ollama it queries <base-url>/api/tags and lists the models you have pulled locally; if discovery fails (Ollama not running, wrong URL, etc.) it falls back to a free-text input.
  5. Connection test. A fast ping against the chosen provider with the credentials entered. Test failure surfaces the provider error and aborts the wizard without persisting anything.
  6. Write config. The resulting config is layered onto the existing file at the target path (user-level or repo-local per --local), preserving API keys for providers other than the one you just configured. First-time runs start from config.Default().

Flags

Flag Notes
--local Write to <repo-root>/.commitbrief/config.yml instead of ~/.commitbrief/config.yml. Requires being inside a git repo. The repo-local path is added to the repo's .gitignore on first write.

Non-destructive across providers

Re-running setup to add a second provider (or update an existing one) only touches that provider's entry. If you already have providers.anthropic.api_key set and run setup for OpenAI, the Anthropic key stays intact. The active provider field is updated to whatever you picked this round.

Examples

# First-time setup; writes ~/.commitbrief/config.yml.
commitbrief setup

# Per-repo override; writes <repo>/.commitbrief/config.yml and adds
# the path to .gitignore.
commitbrief setup --local

See also

Clone this wiki locally