Skip to content

Commit 17199b5

Browse files
barkzclaude
andauthored
Fix stale docs and remove a non-working Spotlight rule (#12)
.gitignore claimed .metadata_never_index stops Spotlight indexing the repo. It does not: macOS only honors that marker at volume roots, not in arbitrary directories. Verified by creating a file in the repo and watching Spotlight index it seconds later despite the marker. Removes the rule and the comment rather than leaving advice that does not work. The real fix for the Cmd+Space collision is keeping .pyc files out of the tree, so both CLAUDE.md and the README now document PYTHONPYCACHEPREFIX. CLAUDE.md also had two stale claims: - referenced a ./glean-code launcher that does not exist in the repo - said 604 tests; the suite is 721 Adds install.py to the CLAUDE.md commands block, since it is now the documented way to install the CLI and the macOS app bundle. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent e46d517 commit 17199b5

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎.gitignore‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ glean_code/__pycache__/
66
.claude/settings.json
77
git/
88

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
12-
139
# Never commit secrets (tokens may match GLEAN_* or glean_tok_* patterns)
1410
.env
1511
.env.*

‎CLAUDE.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ Glean Code is a terminal-first REPL client for the Glean REST API (chat, search,
1010

1111
```bash
1212
# Run the REPL
13-
python3 -m glean_code # or ./glean-code
13+
python3 -m glean_code
14+
15+
# Install it (builds a stdlib-only zipapp; adds a macOS Spotlight app bundle)
16+
python3 install.py # --cli-only, --dev, --prefix, --verify, --uninstall
1417

1518
# Pipe a single command (non-interactive; cli.py detects a non-tty stdin)
1619
echo'/search "q2 plan"'| python3 -m glean_code
1720

18-
# Run the full test suite (604 tests, stdlib unittest — works with or without pytest)
21+
# Run the full test suite (721 tests, stdlib unittest — works with or without pytest)
1922
python3 -m pytest tests/
2023
python3 -m unittest discover tests/
2124

@@ -27,6 +30,11 @@ python3 -m unittest tests.test_commands.TestParseArgs.test_flag_with_value
2730

2831
There is no build step, no `pip install`, no linter config, and no `pyproject.toml`/`setup.py`. Tests use only the stdlib (`unittest`, `unittest.mock`) and make no network calls.
2932

33+
`install.py` is the only thing that produces an artifact: it stages the package in a temp
34+
directory and emits a zipapp, so nothing is ever built inside the repo. On macOS set
35+
`PYTHONPYCACHEPREFIX=~/.cache/python` to keep `__pycache__` out of the working tree —
36+
Spotlight indexes stray `.pyc` files and they hijack Cmd+Space searches for "glean".
37+
3038
## Mock vs. live mode (central design idea)
3139

3240
Every command works **offline by default**. `Config.effective_mode` resolves to `live` only when a token + instance are present (`auto` mode), otherwise `mock`. The single chokepoint is in [glean_code/client.py](glean_code/client.py): `_post` / `_indexing_post` check `effective_mode` and return `_mock_response(path, body)` / `_mock_indexing_response(path, body)` instead of hitting the network. This means **mock responses are keyed by REST path**, and every new endpoint needs a matching mock shape or it won't work offline (and tests, which run in mock mode, will fail).

‎README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ Or without pytest:
243243
python3 -m unittest discover tests/
244244
```
245245

246+
On macOS, keep bytecode caches out of the working tree — Spotlight indexes stray `.pyc`
247+
files, and they outrank the `Glean.app` launcher in `Cmd+Space`:
248+
249+
```bash
250+
export PYTHONPYCACHEPREFIX="$HOME/.cache/python"
251+
```
252+
246253
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).
247254

248255
## Documentation

0 commit comments

Comments
 (0)