Locus uses the GitHub CLI (gh) for every GitHub interaction -- creating issues, milestones, labels, and pull requests. Install and authenticate it before proceeding.
Install gh
Authenticate
Follow the interactive prompts to authenticate with your GitHub account. When finished, verify:
You should see output confirming you are logged in.
Locus checks for gh authentication every time you run locus init. If authentication expires, re-run gh auth login.
Set Up an AI Provider CLI
Locus delegates code generation and analysis to an external AI CLI tool. You need at least one installed and authenticated.
After installation, launch claude once to complete the authentication flow. Claude Code manages its own API credentials -- no manual API key setup is required.
After installation, launch codex once to complete the authentication flow. Codex manages its own API credentials -- no manual API key setup is required.
Switching Providers
Locus defaults to Claude (claude-sonnet-4-6). You can change the provider and model at any time:
The provider is inferred automatically from the model name -- no need to set it separately.
Set Up Sandboxing (Recommended)
Locus can run AI agents inside Docker sandboxes for isolated, safe execution. This prevents agents from accessing host secrets, credentials, and system paths.
Why sandboxing matters: AI agents in full-auto mode have unrestricted access to your filesystem. Docker sandboxing ensures they only see what you allow via .sandboxignore rules, keeping .env files, API keys, and cloud credentials out of reach.
# Switch to Codex
locus config set ai.model codex-mini-latest
# Switch back to Claude
locus config set ai.model claude-sonnet-4-6
# 1. Verify Docker is available
docker sandbox ls
# 2. Create provider sandboxes
locus sandbox
# 3. Authenticate inside each sandbox
locus sandbox claude
locus sandbox codex
npx @locusai/cli --version
npx @locusai/cli init
npx @locusai/cli plan "Build a REST API"