Terminal Coding Agent (Lumagent CLI)
A local terminal coding assistant with provider switching, tool-calling, and safety rails for file + command operations.
Features
- Interactive chat loop with tool chaining
- Provider support:
anthropic(/v1/messages)openai(/v1/responses)grok(xAI OpenAI-compatiblechat/completions)groq(OpenAI-compatiblechat/completions)
- Startup provider preference:
anthropic->openai->grok->groq - Curated model lists per provider (with OpenAI dynamic filtering against
/v1/models) - Working indicator while model calls are in flight (
Lumagent is working...) - Built-in malformed tool-call recovery (one automatic retry if JSON tool call is broken)
Current Model Sets
anthropicclaude-opus-4-6claude-sonnet-4-6claude-haiku-4-5-20251001(default)
openaigpt-4o-mini(default)gpt-5-mini
grokgrok-4-1-fast-reasoning(default)grok-code-fast-1
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). - Codex models are not currently supported in
v0.1.3.
Tooling
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.
Confirmations
Lumagent asks y/N confirmation before:
delete_pathapply_diffwrite_filewhenoverwrite=truegit pushgit rm
CLI Commands
/modelsopens interactive provider/model picker/apikeysopens API key setup/update flow
Project Layout
.
├─ .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
Requirements
- Python 3.10+
- At least one API key:
ANTHROPIC_API_KEYOPENAI_API_KEYXAI_API_KEYGROQ_API_KEY
Setup (Developer)
- Create and activate a virtual environment.
Windows (cmd):
python -m venv .venv
.venv\Scripts\activate.bat
Windows (PowerShell):
python -m venv .venv
.venv\Scripts\Activate.ps1
macOS/Linux:
python3 -m venv .venv
source .venv/bin/activate
- Install editable:
pip install -e .
- Create
.envfrom.env.exampleand set keys:
GROQ_API_KEY=...
XAI_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
# optional:
# OPENAI_MODELS_ALLOWLIST=gpt-4o-mini,gpt-5-mini
The CLI also loads user-level keys from ~/.lumagent/.env first, then applies project .env as an override.
Setup (User install via pip)
Current PyPI release: lumagent==0.1.3
- Install (or pin to this release):
pip install lumagent==0.1.3
- Upgrade later:
pip install -U lumagent
- Configure keys once per machine in:
- Windows:
%USERPROFILE%\.lumagent\.env - macOS/Linux:
~/.lumagent/.env
Example:
GROQ_API_KEY=...
XAI_API_KEY=...
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
# optional:
# OPENAI_MODELS_ALLOWLIST=gpt-4o-mini,gpt-5-mini
If keys are missing on startup, Lumagent now offers an interactive one-time setup prompt and writes keys to ~/.lumagent/.env.
- Open any project folder and run:
lumagent
Environment Setup Smoke Test
Use 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:XAI_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:GROQ_API_KEY -ErrorAction SilentlyContinue
Remove-Item "$HOME\.lumagent\.env" -ErrorAction SilentlyContinue
lumagent
Expected: startup warning about missing keys.
- User-level key file path:
mkdir $HOME\.lumagent -Force
@"
OPENAI_API_KEY=your_real_key
"@ | Set-Content "$HOME\.lumagent\.env"
lumagent
Expected: no missing-key warning.
- Project-level override path:
@"
XAI_API_KEY=your_real_grok_key
GROQ_API_KEY=your_real_groq_key
"@ | Set-Content ".env"
lumagent
Expected: local .env values override user-level values for overlapping keys.
Run
lumagent
or:
python -m baxter.baxter_cli
Command Safety Model
run_cmd allowlist:
pythonpython3pippip3gitnodenpmnpxpython.exepip.exegit.exenode.exenpm.cmdnpx.cmd
run_cmd process behavior:
- Use
detach=trueto start long-running commands (example:["npm","run","dev"]) in the background. - Detached runs return
pidand a background status message in the terminal UI. - To stop a detached process, call
run_cmdwithstop_pid(only PIDs started by this Lumagent session are stoppable). - On Windows,
run_cmdautomatically retries common shims (example:npm->npm.cmd) if the bare binary is not found.
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
Troubleshooting
- Missing key error:
- Verify
.envhas the expected API key and restart Lumagent.
- Verify
- OpenAI tool-call/JSON issues:
- Lumagent 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.
Metadata
Release files for lumagent 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lumagent-0.1.3.tar.gz | 34.0 kB | Without provenance | Details for lumagent-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lumagent-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for lumagent-0.1.3-py3-none-any.whl |
Total release size: 71.5 kB
Release files / lumagent-0.1.3.tar.gz
| Download URL | lumagent-0.1.3.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cc7b0ad7319df986e9fc96acfd7b6b9caf2d8ce351f877729e2f881fcbc5ca0
|
|
BLAKE2b-256 checksum How to use checksums |
f199428998a73a5ce4cef6e0f9139b897c1ec060c2b490389e83cc3530eae03d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / lumagent-0.1.3-py3-none-any.whl
| Download URL | lumagent-0.1.3-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c44c7a254c3e56749031c2a463b7dd10a2f3460769773c224bd00801e74fa056
|
|
BLAKE2b-256 checksum How to use checksums |
bb5a747b598c35ab180fc5542862fa1dc6de9f62e44b2344c87052018be20a9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for lumagent 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.