glassbox 0.1.4 → 0.2.1

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/README.md CHANGED
@@ -12,19 +12,34 @@ No accounts. No pull requests. No waiting. Just you, the diff, and a tight feedb
12
12
 
13
13
  <br>
14
14
 
15
+ **Desktop app** (recommended) — download from [GitHub Releases](https://github.com/brianwestphal/glassbox/releases):
16
+
17
+ | Platform | Download |
18
+ |----------|----------|
19
+ | macOS (Apple Silicon) | `.dmg` (arm64) |
20
+ | macOS (Intel) | `.dmg` (x64) |
21
+ | Linux | `.AppImage` / `.deb` |
22
+ | Windows | `.msi` / `.exe` |
23
+
24
+ After installing, open the app and click **Install CLI** to add the `glassbox` command to your PATH.
25
+
26
+ **Or install via npm:**
27
+
15
28
  ```bash
16
29
  npm install -g glassbox
17
30
  ```
18
31
 
32
+ Then, from any git repository:
33
+
19
34
  ```bash
20
35
  glassbox
21
36
  ```
22
37
 
23
- That's it. Opens in your browser. Works in any git repo.
38
+ That's it. Data stays local. Works in any git repo.
24
39
 
25
40
  <br>
26
41
 
27
- <img src="assets/screenshot.png" alt="Glassbox reviewing a diff" width="720">
42
+ <img src="assets/demo-guided-review.png" alt="Glassbox reviewing a diff with guided review notes" width="720">
28
43
 
29
44
  </div>
30
45
 
@@ -34,19 +49,21 @@ That's it. Opens in your browser. Works in any git repo.
34
49
 
35
50
  AI coding tools generate a lot of code fast. But "fast" doesn't mean "correct." The bottleneck isn't generation — it's **review**.
36
51
 
37
- Most developers review AI output by skimming files in their editor, mentally diffing what changed, and then either accepting it or rewriting it by hand. That's slow, error-prone, and throws away the most valuable signal: your expert judgment about *what specifically* was wrong and why.
52
+ Most developers review AI output by skimming files in their editor, mentally diffing what changed, and then either accepting it or rewriting it by hand. That's slow, error-prone, and throws away the most valuable signal: your expert judgment about _what specifically_ was wrong and why.
38
53
 
39
54
  Glassbox gives you a proper diff viewer with annotation categories designed for AI feedback:
40
55
 
41
- | Category | What it tells the AI |
42
- |----------|---------------------|
43
- | **Bug** | "This is broken. Fix it." |
44
- | **Fix needed** | "This needs a specific change." |
45
- | **Style** | "I prefer it done this way." |
46
- | **Pattern to follow** | "This is good. Keep doing this." |
47
- | **Pattern to avoid** | "This is an anti-pattern. Stop." |
48
- | **Note** | Context for the AI to consider. |
49
- | **Remember** | A rule to persist to the AI's long-term config. |
56
+ <img src="assets/demo-annotations.png" alt="Inline annotations with category badges" width="720">
57
+
58
+ | Category | What it tells the AI |
59
+ | --------------------- | ----------------------------------------------- |
60
+ | **Bug** | "This is broken. Fix it." |
61
+ | **Fix needed** | "This needs a specific change." |
62
+ | **Style** | "I prefer it done this way." |
63
+ | **Pattern to follow** | "This is good. Keep doing this." |
64
+ | **Pattern to avoid** | "This is an anti-pattern. Stop." |
65
+ | **Note** | Context for the AI to consider. |
66
+ | **Remember** | A rule to persist to the AI's long-term config. |
50
67
 
51
68
  When you're done, click **Complete Review** and tell your AI tool:
52
69
 
@@ -82,12 +99,89 @@ Then you run `glassbox` again. Your previous annotations carry forward — match
82
99
  - **Structured export** — markdown output with file paths, line numbers, categories, and instructions for AI consumption
83
100
  - **Automatic .gitignore prompt** — reminds you to exclude `.glassbox/` from version control
84
101
  - **Auto port selection** — if the default port is busy, it finds an open one
85
- - **Fully local** — no network calls, no accounts, no telemetry. Your code stays on your machine.
102
+ - **Fully local** — no network calls (unless you opt into AI features), no accounts, no telemetry. Your code stays on your machine.
103
+ - **AI-powered analysis** _(optional)_ — risk scoring, narrative reading order, and guided review to help you focus and learn as you review
104
+
105
+ ---
106
+
107
+ ## AI-Powered Review Intelligence
108
+
109
+ > Entirely optional. Glassbox is fully functional without it.
110
+
111
+ When reviewing a large diff, knowing _where to look first_ is half the battle. Glassbox can optionally connect to an AI provider to analyze your changes and surface what matters:
112
+
113
+ ### Risk Analysis
114
+
115
+ Every file is scored across six dimensions — security, correctness, error handling, maintainability, architecture, and performance — on a 0.0 to 1.0 scale. Files are ranked by their highest-risk dimension, so a single critical issue won't hide behind low averages.
116
+
117
+ When you open a file, inline risk notes highlight the specific lines and concerns the AI flagged, giving you a heads-up before you even start reading.
118
+
119
+ <img src="assets/demo-risk-mode.png" alt="Risk mode with scores and inline risk notes" width="720">
120
+
121
+ ### Narrative Reading Order
122
+
123
+ For large, multi-file changes, the AI determines the optimal reading order: types and interfaces first, then utilities, then business logic, then integration code. Each file gets walkthrough notes that explain what changed and how it connects to the rest of the diff — like having a colleague walk you through their PR.
124
+
125
+ <img src="assets/demo-narrative-mode.png" alt="Narrative mode with reading order and walkthrough notes" width="720">
126
+
127
+ ### Guided Review
128
+
129
+ If you're learning a new language, onboarding to an unfamiliar codebase, or new to programming, Guided Review generates educational annotations inline with the diff. Enable it in Settings and select the topics that apply to you — "Programming," "This codebase," or specific languages. Glassbox runs a separate analysis pass and inserts green "Learn" notes that explain concepts, idioms, and design decisions relevant to your experience level.
130
+
131
+ Guided Review works in all three sidebar modes (folder, risk, and narrative) and runs independently of risk or narrative analysis. When enabled, risk and narrative analysis also adjust their output to be more detailed and educational.
132
+
133
+ ### How to use it
134
+
135
+ Click the shield or book icon in the sidebar to switch from the default folder view to risk or narrative mode. If you haven't configured an API key yet, a settings dialog will prompt you. Analysis runs once and results are cached for the session. To enable Guided Review, open the Settings dialog (gear icon) and check "Enable guided review."
136
+
137
+ <img src="assets/demo-settings.png" alt="Settings dialog with guided review configuration" width="480">
138
+
139
+ ### Supported providers
140
+
141
+ | Provider | Models | Env variable |
142
+ | ------------- | -------------------------------- | ------------------- |
143
+ | **Anthropic** | Claude Sonnet 4, Claude Haiku 4 | `ANTHROPIC_API_KEY` |
144
+ | **OpenAI** | GPT-4o, GPT-4o Mini | `OPENAI_API_KEY` |
145
+ | **Google** | Gemini 2.5 Flash, Gemini 2.5 Pro | `GEMINI_API_KEY` |
146
+
147
+ You can switch providers and models in the settings dialog (gear icon in the sidebar).
148
+
149
+ ### API key storage
150
+
151
+ Your API key never leaves your machine. Glassbox resolves keys in this order:
152
+
153
+ 1. **Environment variables** — if `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `GEMINI_API_KEY` is set, it's used automatically. Nothing is stored.
154
+ 2. **OS keychain** — on macOS (Keychain), Linux (GNOME Keyring / KDE Wallet via `secret-tool`), or Windows (Credential Manager). Keys are encrypted by your operating system and tied to your user account.
155
+ 3. **Config file** — stored in `~/.glassbox/config.json` with `0600` permissions, base64-encoded. Use this as a fallback if your OS keychain isn't available.
156
+
157
+ Keys entered through the settings dialog are stored in the OS keychain by default when available, and never sent anywhere except directly to the AI provider's API.
86
158
 
87
159
  ---
88
160
 
89
161
  ## Install
90
162
 
163
+ ### Desktop app (recommended)
164
+
165
+ Download the latest release for your platform from [GitHub Releases](https://github.com/brianwestphal/glassbox/releases).
166
+
167
+ On first launch, the app will prompt you to install the `glassbox` CLI command. This creates a symlink so you can launch the desktop app from any project directory. You can also install it manually:
168
+
169
+ **macOS:**
170
+ ```bash
171
+ sudo ln -sf "/Applications/Glassbox.app/Contents/Resources/resources/glassbox" /usr/local/bin/glassbox
172
+ ```
173
+
174
+ **Linux:**
175
+ ```bash
176
+ ln -sf /path/to/glassbox/resources/glassbox-linux ~/.local/bin/glassbox
177
+ ```
178
+
179
+ The desktop app includes automatic updates — new versions are downloaded and applied in the background.
180
+
181
+ ### npm
182
+
183
+ Alternatively, install via npm (runs in your browser instead of a native window):
184
+
91
185
  ```bash
92
186
  npm install -g glassbox
93
187
  ```
@@ -128,22 +222,37 @@ glassbox --resume
128
222
 
129
223
  ### All options
130
224
 
131
- | Flag | Description |
132
- |------|-------------|
133
- | *(no flag)* | Same as `--uncommitted` |
134
- | `--uncommitted` | Staged + unstaged + untracked changes |
135
- | `--staged` | Only staged changes |
136
- | `--unstaged` | Only unstaged changes |
137
- | `--commit <sha>` | Changes from a specific commit |
138
- | `--range <from>..<to>` | Changes between two refs |
139
- | `--branch <name>` | Current branch vs the named branch |
140
- | `--files <patterns>` | Specific files (comma-separated globs) |
141
- | `--all` | Entire codebase (all tracked files) |
142
- | `--port <number>` | Port to run on (default: 4173) |
143
- | `--resume` | Resume the latest in-progress review for this mode |
144
- | `--check-for-updates` | Check for a newer version on npm |
145
- | `--debug` | Show build timestamp and debug info |
146
- | `--help` | Show help |
225
+ | Flag | Description |
226
+ | ---------------------- | -------------------------------------------------- |
227
+ | _(no flag)_ | Same as `--uncommitted` |
228
+ | `--uncommitted` | Staged + unstaged + untracked changes |
229
+ | `--staged` | Only staged changes |
230
+ | `--unstaged` | Only unstaged changes |
231
+ | `--commit <sha>` | Changes from a specific commit |
232
+ | `--range <from>..<to>` | Changes between two refs |
233
+ | `--branch <name>` | Current branch vs the named branch |
234
+ | `--files <patterns>` | Specific files (comma-separated globs) |
235
+ | `--all` | Entire codebase (all tracked files) |
236
+ | `--port <number>` | Port to run on (default: 4183) |
237
+ | `--resume` | Resume the latest in-progress review for this mode |
238
+ | `--browser` | Open in browser instead of desktop window |
239
+ | `--check-for-updates` | Check for a newer version on npm |
240
+ | `--debug` | Show build timestamp and debug info |
241
+ | `--help` | Show help |
242
+
243
+ ### Settings file
244
+
245
+ Create `.glassbox/settings.json` in your project directory to configure per-project options:
246
+
247
+ ```json
248
+ {
249
+ "appName": "Glassbox — My Project"
250
+ }
251
+ ```
252
+
253
+ | Key | Description |
254
+ |-----|-------------|
255
+ | `appName` | Custom window title and Dock name (defaults to "Glassbox — _folder name_") |
147
256
 
148
257
  ---
149
258
 
@@ -174,16 +283,19 @@ Point the tool at the file. The export includes an "Instructions for AI Tools" s
174
283
 
175
284
  ## Architecture
176
285
 
177
- | Layer | Technology |
178
- |-------|-----------|
179
- | CLI | TypeScript, Node.js |
180
- | Server | Hono |
181
- | Database | PGLite (embedded PostgreSQL) |
182
- | UI | Custom server-side JSX (no React), vanilla client JS |
183
- | Build | tsup (single-file bundle) |
184
- | Storage | `~/.glassbox/data/` |
286
+ | Layer | Technology |
287
+ | -------- | ---------------------------------------------------- |
288
+ | Desktop | Tauri v2 (native window, auto-updates) |
289
+ | CLI | TypeScript, Node.js |
290
+ | Server | Hono |
291
+ | Database | PGLite (embedded PostgreSQL) |
292
+ | UI | Custom server-side JSX (no React), vanilla client JS |
293
+ | Build | tsup (single-file bundle) |
294
+ | Storage | `~/.glassbox/data/` |
295
+
296
+ Data stays local. The only network calls are an optional once-per-day npm update check and AI analysis requests if you opt in.
185
297
 
186
- Data stays local. The only network call is an optional once-per-day npm update check.
298
+ > **Note:** We're actively developing and testing on macOS. Linux and Windows builds are provided but less tested if you run into issues on those platforms, please [open an issue](https://github.com/brianwestphal/glassbox/issues).
187
299
 
188
300
  ## Development
189
301
 
@@ -192,10 +304,12 @@ git clone <repo-url>
192
304
  cd glassbox
193
305
  npm install
194
306
 
195
- npm run dev -- --uncommitted # Run with tsx (no build step)
196
- npm run build # Build to dist/cli.js
197
- npm run clean # Remove dist and caches
198
- npm link # Symlink for global 'glassbox' command
307
+ npm run dev # Build client assets, then run via tsx
308
+ npm run build # Build to dist/cli.js
309
+ npm run tauri:dev # Run desktop app in dev mode
310
+ npm run tauri:build # Build desktop app for distribution
311
+ npm run clean # Remove dist and caches
312
+ npm link # Symlink for global 'glassbox' command
199
313
  ```
200
314
 
201
315
  ## License