A local terminal coding assistant with provider switching, tool-calling, and safety rails for file + command operations.
- Interactive chat loop with tool chaining
- Provider support:
anthropic(/v1/messages)openai(/v1/responses)groq(OpenAI-compatiblechat/completions)
- Startup provider preference:
anthropic->openai->groq - Curated model lists per provider (with OpenAI dynamic filtering against
/v1/models) - Working indicator while model calls are in flight (
Baxter is working...) - Built-in malformed tool-call recovery (one automatic retry if JSON tool call is broken)
anthropicclaude-opus-4-6claude-sonnet-4-6claude-haiku-4-5-20251001(default)
openaigpt-4o-mini(default)gpt-5-minicodex-3.5
groqllama-3.1-8b-instant(default)
Notes:
- OpenAI model IDs are fetched from
/v1/modelsand intersected with the allowlist above. - You can override the OpenAI allowlist with
OPENAI_MODELS_ALLOWLIST(comma-separated IDs).
Tools available:
read_filewrite_fileapply_difflist_dirmake_dirdelete_pathrun_cmdgit_cmdsearch_code
Key behaviors:
- File paths are restricted to the repo root (no absolute paths, no
..escape). delete_pathsupports recursive directory deletion (defaultrecursive=true).write_filerefuses to overwrite existing files unlessoverwrite=true.apply_diffsupports targeted edits using exactfind/replacewith optionalreplace_all=true.apply_diffreturns a unified diff summary (+/-) and stores the full last diff for terminal viewing.
Baxter asks y/N confirmation before:
delete_pathapply_diffwrite_filewhenoverwrite=truegit pushgit rm
/opens interactive provider/model picker/providers(alias:/settings)/provider <groq|openai|anthropic>/models/model <model_name>/lastdiff(expand the lastapply_diffunified diff)/help
.
├─ .env.example
├─ pyproject.toml
├─ README.md
└─ baxter/
├─ __init__.py
├─ baxter_cli.py
├─ providers.py
└─ tools/
├─ __init__.py
├─ registry.py
├─ safe_path.py
├─ read_file.py
├─ write_file.py
├─ apply_diff.py
├─ list_dir.py
├─ make_dir.py
├─ delete_path.py
├─ run_cmd.py
├─ git_cmd.py
└─ search_code.py
- Python 3.10+
- At least one API key:
ANTHROPIC_API_KEYOPENAI_API_KEYGROQ_API_KEY
- Create and activate a virtual environment.
Windows (cmd):
python -m venv .venv
.venv\Scripts\activate.batWindows (PowerShell):
python -m venv .venv
.venv\Scripts\Activate.ps1macOS/Linux:
python3 -m venv .venv
source .venv/bin/activate- Install editable:
pip install -e .- Create
.envfrom.env.exampleand set keys:
GROQ_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
# optional:
# OPENAI_MODELS_ALLOWLIST=gpt-4o-mini,gpt-5-mini,codex-3.5The CLI also loads user-level keys from ~/.baxter/.env first, then applies project .env as an override.
- Install Baxter:
pip install baxter-cli- Configure keys once per machine in:
- Windows:
%USERPROFILE%\.baxter\.env - macOS/Linux:
~/.baxter/.env
Example:
GROQ_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
# optional:
# OPENAI_MODELS_ALLOWLIST=gpt-4o-mini,gpt-5-mini,codex-3.5- Open any project folder and run:
baxterUse this to verify first-run key loading and precedence.
- Missing keys path:
Remove-Item Env:OPENAI_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:GROQ_API_KEY -ErrorAction SilentlyContinue
Remove-Item "$HOME\.baxter\.env" -ErrorAction SilentlyContinue
baxterExpected: startup warning about missing keys.
- User-level key file path:
mkdir $HOME\.baxter -Force
@"
OPENAI_API_KEY=your_real_key
"@ | Set-Content "$HOME\.baxter\.env"
baxterExpected: no missing-key warning.
- Project-level override path:
@"
GROQ_API_KEY=your_real_groq_key
"@ | Set-Content ".env"
baxterExpected: local .env values override user-level values for overlapping keys.
baxteror:
python -m baxter.baxter_clirun_cmd allowlist:
pythonpython3pippip3git
git_cmd subcommand allowlist:
statuslogdiffshowbranchswitchcheckoutaddcommitpushpullfetchremoterev-parserestorermmvstash
Additional protections:
- No shell execution for command tools
- Path traversal/root escape blocked
- Selected risky git flags blocked (
--git-dir,--work-tree,-C, etc.) - Per-tool timeout bounds
- Missing key error:
- Verify
.envhas the expected API key and restart Baxter.
- Verify
- OpenAI tool-call/JSON issues:
- Baxter now does one automatic repair retry for malformed tool-call JSON.
- OpenAI model list too large:
- Set
OPENAI_MODELS_ALLOWLISTexplicitly.
- Set
git not found on PATH:- Install Git and restart terminal.
