@burtson-labs/bandit-stealth-cli 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/cli.js +1025 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Burtson Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<a href="https://burtson.ai">
|
|
2
|
+
<picture>
|
|
3
|
+
<img src="https://cdn.burtson.ai/logos/bandit-stealth.png" alt="Bandit Stealth" width="140" style="width: 140px !important; max-width: 140px !important; height: auto; display: inline-block;" />
|
|
4
|
+
</picture>
|
|
5
|
+
</a>
|
|
6
|
+
|
|
7
|
+
# Bandit — Agent CLI
|
|
8
|
+
|
|
9
|
+
**Local-first AI coding agent for your terminal.**
|
|
10
|
+
|
|
11
|
+
Your code never leaves your machine. Works with any Ollama model.
|
|
12
|
+
|
|
13
|
+
*Prefer an IDE?* The sibling Bandit Stealth extension for VS Code / Cursor ships the same runtime, skills, and tool-use loop — install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=BurtsonLabs.bandit-stealth) or [Open VSX](https://open-vsx.org/extension/BurtsonLabs/bandit-stealth).
|
|
14
|
+
|
|
15
|
+
[](https://www.npmjs.com/package/@burtson-labs/bandit-stealth-cli)
|
|
16
|
+
[](https://nodejs.org)
|
|
17
|
+
[](./LICENSE)
|
|
18
|
+
|
|
19
|
+
<p>
|
|
20
|
+
<img src="https://cdn.burtson.ai/images/cli.png" alt="Bandit CLI boot banner in a terminal" width="780" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
1. Install **[Ollama](https://ollama.com)** and pull a model:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
brew install ollama # or download installer
|
|
31
|
+
ollama pull qwen2.5-coder:7b # fast, tool-calling, ~4.7 GB
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
2. Install the CLI globally:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm i -g @burtson-labs/bandit-stealth-cli
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. Run it:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bandit # interactive REPL
|
|
44
|
+
bandit "explain @src/auth/login.ts" # one-shot with a file mention
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That's it. No API keys. No cloud services. The agent reads your code, searches, runs commands, and writes changes — all locally.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## What it does
|
|
52
|
+
|
|
53
|
+
- **Agentic tool use** — automatically reads files, searches code, runs commands, writes changes
|
|
54
|
+
- **Unified-diff approval gate** — every `write_file` / `apply_edit` shows a colored diff before touching disk
|
|
55
|
+
- **Pre-write validation** — TypeScript, Python, JSON, C# are syntax-checked before the agent can write them
|
|
56
|
+
- **Skills system** — the agent activates specialized skills based on your prompt, and can create its own
|
|
57
|
+
- **Plan execution** — structured multi-step plans for complex refactors
|
|
58
|
+
- **Session persistence** — every REPL session saved as JSONL under `~/.bandit/sessions/` for later resume
|
|
59
|
+
- **Project memory** — drop a `BANDIT.md` or `CLAUDE.md` at your workspace root and it's auto-loaded into the system prompt
|
|
60
|
+
- **File + image mentions** — `@path` auto-inlines files; images are either sent multimodally or OCR'd locally (Apple Vision / tesseract)
|
|
61
|
+
- **Clipboard paste** — `Ctrl+V` in the REPL pastes an image straight from your clipboard
|
|
62
|
+
- **Hooks** — `PreToolUse` / `PostToolUse` / `Stop` shell hooks via `.bandit/settings.json`
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Slash commands
|
|
67
|
+
|
|
68
|
+
| Command | Does |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `/help` | List slash commands |
|
|
71
|
+
| `/clear` | Reset conversation (keeps session id) |
|
|
72
|
+
| `/model <name>` | Switch model mid-session |
|
|
73
|
+
| `/skills` | List loaded skills |
|
|
74
|
+
| `/session list` / `resume <id>` / `new` | Manage sessions |
|
|
75
|
+
| `/memory` | Show auto-loaded `BANDIT.md` / `CLAUDE.md` |
|
|
76
|
+
| `/config` | Show effective config (secrets redacted) |
|
|
77
|
+
| `/exit` | Quit |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Skills
|
|
82
|
+
|
|
83
|
+
The agent activates specialized skills based on your prompt:
|
|
84
|
+
|
|
85
|
+
| Skill | Trigger | What it does |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| Filesystem | always | Read, write, search, list, run commands |
|
|
88
|
+
| Git | always | Status, diff, log, commit |
|
|
89
|
+
| Code Review | "review my changes" | Diff + full file context |
|
|
90
|
+
| Testing | "write tests" | Auto-detect runner, generate tests |
|
|
91
|
+
| Planning | "refactor the auth system" | Structured multi-step decomposition |
|
|
92
|
+
| Semantic Search | "how is auth implemented" | Local embedding search |
|
|
93
|
+
|
|
94
|
+
### Custom skills (the agent can make its own)
|
|
95
|
+
|
|
96
|
+
Ask: *"create a skill that runs my linter"*
|
|
97
|
+
|
|
98
|
+
The agent writes `.bandit/skills/linter.md`. Next prompt, it's live. Ask *"lint my code"* and it runs.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Recommended models
|
|
103
|
+
|
|
104
|
+
Pull one with `ollama pull <model>`. Bandit auto-detects each model's capabilities and takes the native tool-calling path when supported.
|
|
105
|
+
|
|
106
|
+
| Model | Where | Notes |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `qwen2.5-coder:7b` | Local / Mac (~4.7 GB) | **Fast default** — native tool calling, strong coding quality. |
|
|
109
|
+
| `gemma4:26b` | Local / Mac 32GB+ (~17 GB) | Sane default for recent Macs — fast, solid quality. |
|
|
110
|
+
| `gemma4:31b` | Local / Mac 64GB+, GPU node | Bigger context, better reasoning. |
|
|
111
|
+
| `qwen2.5-coder:32b-instruct-q8_0` | Local / Mac 48GB+, RTX 5090 | **Best for agents** — native tool calling, strong coding quality. |
|
|
112
|
+
| `qwen2.5-coder:14b-instruct-q8_0` | Local / Mac (~18 GB), 24GB GPUs | Lighter Qwen — native tool calling, fast. |
|
|
113
|
+
| `devstral:latest` | Local / Mac 32GB+ | Mistral's agent-tuned model — excellent tool use. |
|
|
114
|
+
|
|
115
|
+
**Capability dispatch**:
|
|
116
|
+
|
|
117
|
+
- **Native tool calling** — Qwen 2.5 Coder, Llama 3.1+, Devstral, DeepSeek-Coder-V2+. Tool schemas go in Ollama's `tools:` field. Saves ~1500–3000 tokens per turn.
|
|
118
|
+
- **Text-parsing fallback** — Gemma 3/4 and anything else. XML-style tool block lives in the system prompt with the full mitigation stack armed.
|
|
119
|
+
|
|
120
|
+
Any Ollama model works — capabilities auto-detect via `/api/show`.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Configuration
|
|
125
|
+
|
|
126
|
+
### Config file (preferred)
|
|
127
|
+
|
|
128
|
+
`~/.bandit/config.json` or `<workspace>/.bandit/config.json`:
|
|
129
|
+
|
|
130
|
+
```jsonc
|
|
131
|
+
{
|
|
132
|
+
"provider": "ollama", // or "bandit"
|
|
133
|
+
"model": "qwen2.5-coder:7b",
|
|
134
|
+
"ollama": {
|
|
135
|
+
"url": "http://localhost:11434",
|
|
136
|
+
"headers": { "Authorization": "Bearer ..." } // optional
|
|
137
|
+
},
|
|
138
|
+
"bandit": {
|
|
139
|
+
"apiKey": "bnd_...",
|
|
140
|
+
"apiUrl": "https://api.burtson.ai"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Workspace config overrides user config. Secrets belong in the user-level file, not in a committed workspace file.
|
|
146
|
+
|
|
147
|
+
### Environment variables
|
|
148
|
+
|
|
149
|
+
| Var | Default | Description |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| `BANDIT_PROVIDER` | `ollama` | `ollama` or `bandit` |
|
|
152
|
+
| `BANDIT_MODEL` | `gemma4:e4b` | Model ID |
|
|
153
|
+
| `BANDIT_API_KEY` | — | Required when `BANDIT_PROVIDER=bandit` |
|
|
154
|
+
| `BANDIT_API_URL` | `https://api.burtson.ai` | Override Bandit API endpoint |
|
|
155
|
+
| `OLLAMA_URL` | `http://localhost:11434` | Ollama endpoint |
|
|
156
|
+
| `BANDIT_MAX_ITERATIONS` | `20` | Tool-use loop cap |
|
|
157
|
+
| `BANDIT_AUTO_APPROVE` | `0` | `1`/`true` to skip write-approval prompts |
|
|
158
|
+
| `NO_COLOR` | — | Disable ANSI colors |
|
|
159
|
+
|
|
160
|
+
### Remote GPU
|
|
161
|
+
|
|
162
|
+
Running a bigger model on a remote Ollama instance? Point `OLLAMA_URL` at the remote endpoint and set `BANDIT_MODEL` to the bigger model. Requests route to the remote node; everything else stays local.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Security & privacy
|
|
167
|
+
|
|
168
|
+
- **Local-first by default** — with `provider=ollama`, nothing leaves your machine.
|
|
169
|
+
- **Approval gate** — all file writes show a unified diff before touching disk (unless `BANDIT_AUTO_APPROVE=1`).
|
|
170
|
+
- **Command allowlist** — `run_command` only executes from an internal allowlist (git, gh, kubectl, helm, brew, standard *nix tools). Arbitrary shell is refused.
|
|
171
|
+
- **Secret hygiene** — API keys are redacted in `/config` output and never logged.
|
|
172
|
+
- **Local sessions** — stored as JSONL under `~/.bandit/sessions/`. Inspect at any time.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Requirements
|
|
177
|
+
|
|
178
|
+
- Node.js 20+
|
|
179
|
+
- [Ollama](https://ollama.com) running locally (or remote via `OLLAMA_URL`) — unless you use `BANDIT_PROVIDER=bandit`
|
|
180
|
+
- `rg` (ripgrep) on `PATH` for fast code search; falls back to `grep` if absent
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Troubleshooting
|
|
185
|
+
|
|
186
|
+
**Ollama not detected** — Make sure it's running: `ollama serve`. The CLI checks on startup and surfaces a setup hint if it can't connect.
|
|
187
|
+
|
|
188
|
+
**Model not installed** — Pull it: `ollama pull <model>`. Run `/model <name>` in the REPL to switch without restarting.
|
|
189
|
+
|
|
190
|
+
**Slow responses** — Check your model size against available VRAM. Switch to a smaller model from the recommended list.
|
|
191
|
+
|
|
192
|
+
**Stuck approval prompt in CI** — Set `BANDIT_AUTO_APPROVE=1` to skip the diff-approval gate.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Support
|
|
197
|
+
|
|
198
|
+
- Issues, feature requests, and questions: [team@burtson.ai](mailto:team@burtson.ai)
|
|
199
|
+
- More from Burtson Labs: [burtson.ai](https://burtson.ai)
|
|
200
|
+
|
|
201
|
+
*Bandit CLI is built by [Burtson Labs](https://burtson.ai). Source for the runtime packages is currently private — open source release planned.*
|