gearbox-code 0.1.2

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -0
  3. package/dist/cli.mjs +136900 -0
  4. package/package.json +46 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gearbox contributors
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,81 @@
1
+ # ⚙ gearbox
2
+
3
+ A beautiful, simple coding harness for the terminal. It reads, edits, and runs your code through one clean agent loop, talking to any provider (Anthropic, OpenAI, Google, DeepSeek).
4
+
5
+ > **What it does:** the point of Gearbox is *intelligent per-task model routing* — automatically using the right model for each task across every provider and account you pay for, cheaply and transparently. Basic routing is live: it classifies each task, filters candidates by quality bar, and picks the cheapest one that fits. The richer engine (shadow-eval, credit/limit scoring, confidence display) layers on top. See [`DESIGN.md`](./DESIGN.md).
6
+
7
+ ```
8
+ ⚙ gearbox
9
+ coding harness · sonnet-4.6
10
+ ──────────────────────────────────────────────────────────
11
+
12
+ › add a --json flag to the CLI and cover it with a test
13
+
14
+ ⏺ I'll see how args are parsed, add the flag, then test it.
15
+
16
+ ✓ read_file src/cli.tsx
17
+ renders the Ink app · 18 lines
18
+ ✓ edit_file src/cli.tsx
19
+ ✓ run_shell bun test
20
+ 9 pass · 0 fail
21
+
22
+ ⏺ Done — flag added with a passing test.
23
+
24
+ ╭──────────────────────────────────────────────────────────╮
25
+ │ › ask gearbox to build or fix something │
26
+ ╰──────────────────────────────────────────────────────────╯
27
+ gearbox · sonnet-4.6 · 18,432 tok · ⏎ send ctrl+c quit
28
+ ```
29
+
30
+ ## Run
31
+
32
+ ```bash
33
+ bun install
34
+ export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY / GOOGLE_GENERATIVE_AI_API_KEY / DEEPSEEK_API_KEY
35
+ bun start # or: bun run src/cli.tsx
36
+ bun start -- --model gemini-flash # pick a model
37
+ ```
38
+
39
+ No key? It launches in demo mode so you can see the interface. Preview the look without running anything:
40
+
41
+ ```bash
42
+ bun run scripts/preview.tsx
43
+ ```
44
+
45
+ ## Install for internal use (the `gearbox` command, anywhere)
46
+
47
+ Requires [Bun](https://bun.sh). Clone the repo, then:
48
+
49
+ ```bash
50
+ ./install.sh # bun install + bun link → 'gearbox' on your PATH
51
+ export ANTHROPIC_API_KEY=... # each person uses their own key (add to ~/.zshrc)
52
+ cd ~/any/project && gearbox # the current directory is the workspace
53
+ ```
54
+
55
+ **Upgrade** later with one command — `gearbox upgrade` (pulls latest + reinstalls deps). Equivalent to `git pull && bun install` in the repo. If `gearbox` isn't found, add Bun's bin dir to PATH: `export PATH="$HOME/.bun/bin:$PATH"`.
56
+
57
+ **Standalone binary** (no clone/install on the target, same OS/arch):
58
+
59
+ ```bash
60
+ bun run build # → dist/gearbox (single ~64MB executable)
61
+ cp dist/gearbox ~/.bun/bin/ # or anywhere on PATH; share the file directly
62
+ ```
63
+
64
+ > ⚠ **Before running on real code:** there is no permission/confirm gate yet — `write_file`, `edit_file`, `run_shell`, and the `!` prefix execute without asking. Fine for trusted internal use on your own repos; do not point it at anything you don't want modified. A confirm-gate is the next thing to land.
65
+
66
+ ## Develop
67
+
68
+ ```bash
69
+ bun test # render + agent tests (no API key needed)
70
+ bun run typecheck
71
+ ```
72
+
73
+ ## Principles
74
+
75
+ - **Open + free.** MIT. No paid dependencies, no hosted backend, no telemetry. The only cost is your own model calls on your own keys.
76
+ - **Beautiful + calm.** One accent color, generous spacing, consistent glyphs. The whole look lives in `src/ui/theme.ts`.
77
+ - **Routing-ready.** Model choice happens in exactly one place (`src/model/selector.ts`); the router drops in there later with no changes upstream. See [`CLAUDE.md`](./CLAUDE.md).
78
+
79
+ ## Status
80
+
81
+ v0.1 — streaming agent loop, real file + shell tools, a polished Ink TUI, multi-provider support, accounts + spend ledger, BM25 context retrieval, and basic per-task routing (classify → quality bar → cheapest winner). The richer routing engine (shadow-eval, credit/limit/plan scoring, per-repo calibration) is next (`DESIGN.md`).