Skip to content

Install

Prerequisites

RequirementMinimum versionNotes
Node.js20 LTS22 LTS recommended
pnpm9.xnpm i -g pnpm
Git2.40+Required for worktree isolation
macOS or LinuxmacOS 13+ / Ubuntu 22.04+Windows support coming in a future release
Anthropic API keyClaude Sonnet 4.x is the default model

Install the CLI

Terminal window
npm install -g @defiant/cli

Verify the install:

Terminal window
defiant --version
# Defiant CLI 2.0.0

Configure credentials

Defiant stores credentials in ~/.defiant/. Run the interactive setup:

Terminal window
defiant init

The wizard prompts for:

  • Anthropic API key — required. Used for all agent inference calls.
  • GitHub token — required for repo access, PR creation, and status checks. Needs repo + workflow scopes.
  • Supabase URL + anon key — required for the REST API and event log persistence.
  • Asana PAT — optional. Enables the Scribe agent to create and update tasks.
  • Sentry DSN — optional. Enables the Medic agent to monitor runtime errors.
  • PostHog key — optional. Enables usage analytics.
  • Stripe secret key — optional. Required only for Marketplace vertical billing flows.

Credentials are written to ~/.defiant/credentials.json with 600 permissions. They are never committed to git.

To update a single credential later:

Terminal window
defiant config set ANTHROPIC_API_KEY sk-ant-...
defiant config set GITHUB_TOKEN ghp_...

Start the Conductor

The Conductor is the local daemon that drives all sprint execution. It must be running before you create sprints.

Terminal window
defiant watch start

Expected output:

[Conductor] Starting...
[Conductor] IPC socket: ~/.defiant/ipc/conductor.sock
[Conductor] Event log: ~/.defiant/events.db
[Conductor] Token budget: 2,000,000 / day
[Conductor] Ready. Listening for sprints.

Check status at any time:

Terminal window
defiant watch status
# Conductor: running (PID 12345)
# Active sprints: 0
# Token usage today: 0 / 2,000,000 (green)
# IPC socket: ~/.defiant/ipc/conductor.sock

Stop the Conductor:

Terminal window
defiant watch stop

Verify the installation

  1. Check the CLIdefiant --version returns the version string.
  2. Check the Conductordefiant watch status shows running.
  3. Check credentialsdefiant config check validates all configured keys against their APIs.
  4. List projectsdefiant projects list returns an empty list (or your existing projects).
Terminal window
defiant config check
# [OK] ANTHROPIC_API_KEY — valid
# [OK] GITHUB_TOKEN — valid (scopes: repo, workflow)
# [OK] SUPABASE_URL — reachable
# [OK] SUPABASE_ANON_KEY — valid
# [SKIP] ASANA_PAT — not configured
# [SKIP] SENTRY_DSN — not configured

Directory layout

After init, your ~/.defiant/ directory looks like:

~/.defiant/
credentials.json # API keys (chmod 600)
config.json # Preferences (model, token budgets, log level)
ipc/
conductor.sock # Unix socket for JSON-RPC
events.db # SQLite event log (append-only)
worktrees/ # Ephemeral git worktrees for each sprint
logs/
conductor.log # Conductor stdout/stderr
agents/ # Per-agent turn logs

Auto-start on login (optional)

Terminal window
defiant watch install-service
# Installs a launchd plist at ~/Library/LaunchAgents/build.defiant.conductor.plist
# The Conductor starts automatically on login.

Upgrading

Terminal window
# CLI
npm update -g @defiant/cli
# After upgrading, restart the Conductor
defiant watch stop
defiant watch start

Defiant follows semantic versioning. Minor versions are backward-compatible with the event log schema. Major versions ship a migration guide.

Uninstall

Terminal window
defiant watch stop
npm uninstall -g @defiant/cli
rm -rf ~/.defiant # removes all local state — irreversible

Next steps