Skip to content

Commit e46d517

Browse files
barkzclaude
andauthored
Add installer and clean up repo hygiene (#11)
* Remove tracked __pycache__ artifacts The .pyc files under glean_code/ and tests/ were committed before the __pycache__/ ignore rule existed, so .gitignore never applied to them. Removes all 35 tracked artifacts. Also adds two ignore rules: - .metadata_never_index, which stops macOS Spotlight indexing the repo (the tracked .pyc files were hijacking Cmd+Space searches for "glean") - build.noindex/, the zipapp build output directory Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Add installer, clean up repo hygiene --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent f81902d commit e46d517

39 files changed

Lines changed: 591 additions & 10 deletions

‎.gitignore‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ glean_code/__pycache__/
66
.claude/settings.json
77
git/
88

9-
# Build output (zipapp staging dir and the .pyz artifact)
10-
# .noindex suffix keeps macOS Spotlight from indexing the artifact
11-
build/
12-
build.noindex/
9+
# Keeps macOS Spotlight from indexing the repo (stops .pyc/.py name collisions
10+
# with the Glean.app launcher in Cmd+Space)
11+
.metadata_never_index
1312

1413
# Never commit secrets (tokens may match GLEAN_* or glean_tok_* patterns)
1514
.env
1615
.env.*
1716
*.pem
1817
auth.json
19-
git/

‎README.md‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A local, terminal-first client for the Glean Client REST API. Inspired by Claude
4040

4141
## Getting started
4242

43-
### Install and run
43+
### Run it straight from the repo
4444

4545
```bash
4646
cd glean-code-cli
@@ -49,9 +49,30 @@ python3 -m glean_code
4949

5050
Python 3.9 or newer. No pip install required. Only the standard library is used.
5151

52-
### Create an alias
52+
### Or install it
5353

54-
After opening a new terminal just run `glean`.
54+
```bash
55+
python3 install.py
56+
```
57+
58+
This builds a single-file zipapp (~84 KB, still stdlib-only) and installs it as
59+
`glean` in `~/.local/bin`. On macOS it also creates `~/Applications/Glean.app` and
60+
registers it with LaunchServices, so the REPL is launchable from Spotlight —
61+
`Cmd+Space` → "Glean" → Enter opens it in a Terminal window.
62+
63+
| Flag | Effect |
64+
| --- | --- |
65+
|_(none)_| Install the CLI and, on macOS, the Spotlight app |
66+
|`--cli-only`| Skip the macOS app bundle |
67+
|`--dev`| App launches from the working tree, so edits apply with no rebuild |
68+
|`--prefix DIR`| Install the `glean` executable somewhere other than `~/.local/bin`|
69+
|`--verify`| Report what is currently installed |
70+
|`--uninstall`| Remove everything the installer created (config is left alone) |
71+
72+
Re-run `python3 install.py` after pulling changes to refresh the snapshot, or install
73+
once with `--dev` and skip that step entirely.
74+
75+
### Or just alias it
5576

5677
```bash
5778
alias glean="PYTHONPATH=<YOUR_PATH>/glean-code-cli python3 -m glean_code"
@@ -187,6 +208,7 @@ Setup for all three clients, the tool table, and the mock-mode rationale: **[doc
187208

188209
```text
189210
glean-code-cli/
211+
install.py CLI + macOS app installer (python3 install.py)
190212
glean_mcp.py MCP server entry point
191213
glean_code/
192214
__main__.py python -m glean_code
@@ -203,7 +225,7 @@ glean-code-cli/
203225
auth_commands.py /auth command handlers
204226
auth/ OAuth 2.1 + PKCE: oauth, pkce, callback_server,
205227
token_store, manager
206-
tests/ 15 test modules, stdlib unittest only
228+
tests/ 16 test modules, stdlib unittest only
207229
docs/ full reference set — see below
208230
```
209231

@@ -221,7 +243,7 @@ Or without pytest:
221243
python3 -m unittest discover tests/
222244
```
223245

224-
699 tests covering the client and every mock response, commands and dispatch, config, UI, auth, completion, help docs, the mock corpus, indexing-walk, scaffold, and the MCP server. Development notes: [docs/TESTING.md](docs/TESTING.md).
246+
721 tests covering the client and every mock response, commands and dispatch, config, UI, auth, completion, help docs, the mock corpus, indexing-walk, scaffold, the installer, and the MCP server. Development notes: [docs/TESTING.md](docs/TESTING.md).
225247

226248
## Documentation
227249

-284 Bytes
Binary file not shown.
-277 Bytes
Binary file not shown.
-268 Bytes
Binary file not shown.
-226 Bytes
Binary file not shown.
-9.08 KB
Binary file not shown.
-2.14 KB
Binary file not shown.
-2.31 KB
Binary file not shown.
-32.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)