Skip to content

Commit 585ea7f

Browse files
HumanBean17claude
andcommitted
docs: document CLI install/update commands and move completed proposal
Move CLI-INSTALL-PROPOSE.md and PLAN-CLI-INSTALL.md to completed/ now that both PR-I1 (install) and PR-I2 (update) are implemented. Update README.md and JAVA-CODEBASE-RAG-CLI.md to document the new interactive setup wizard (java-codebase-rag install) and the post-upgrade refresh command (java-codebase-rag update). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent fd3f111 commit 585ea7f

4 files changed

Lines changed: 104 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,31 @@ pip install java-codebase-rag
4444
Python **3.11+** required. After install, `java-codebase-rag --help` should print the CLI groups.
4545
The package includes the CocoIndex lifecycle dependency used by `init`, `increment`, `reprocess`, and `erase`.
4646

47+
### Interactive setup (recommended)
48+
49+
Run `java-codebase-rag install` from your Java project root to launch an interactive setup wizard that:
50+
51+
1. Detects Java source directories (Maven/Gradle modules)
52+
2. Configures the embedding model (auto-downloads ~90MB or uses a local path)
53+
3. Selects agent hosts (Claude Code, Qwen Code, GigaCode)
54+
4. Deploys MCP registration, skill, and agent artifacts
55+
5. Generates `.java-codebase-rag.yml` configuration
56+
6. Runs `init` to build the index
57+
58+
```bash
59+
# Interactive mode
60+
java-codebase-rag install
61+
62+
# Non-interactive mode (for CI/automation)
63+
java-codebase-rag install --non-interactive --agent claude-code
64+
```
65+
66+
After `pip install --upgrade java-codebase-rag`, run `java-codebase-rag update` to refresh shipped artifacts.
67+
68+
### Manual registration
69+
70+
If you prefer manual configuration, see [`docs/JAVA-CODEBASE-RAG-CLI.md`](./docs/JAVA-CODEBASE-RAG-CLI.md) for the full CLI reference.
71+
4772
> **Stability disclaimer.** This package does **not** promise backward compatibility. MCP tool contracts, env vars, Lance/Kuzu schemas, config files, and Python APIs may change without a deprecation period. Track `main` and rebuild indexes when ontology or embedding settings change.
4873
4974
---
@@ -84,7 +109,9 @@ If vector hits come back and graph expansion adds neighbor symbols, the install
84109

85110
## Wire into an MCP host
86111

87-
### Claude Code
112+
> **Quick setup:** Run `java-codebase-rag install` from your Java project root. The interactive wizard handles MCP registration, skill deployment, and configuration for Claude Code, Qwen Code, and GigaCode in one step.
113+
114+
### Claude Code (manual)
88115

89116
With the package installed, the console script `java-codebase-rag-mcp` is on your `PATH`. Register it project-scoped:
90117

@@ -167,6 +194,8 @@ Run `java-codebase-rag --help` to list grouped subcommands. Operator playbook wi
167194

168195
| Group | Subcommand | What it does |
169196
|---|---|---|
197+
| Setup | `install` | Interactive setup wizard: config, MCP registration, skill/agent deployment, indexing. |
198+
| Setup | `update` | Refresh shipped artifacts (skill, agent, MCP entry) after pip upgrade. |
170199
| Lifecycle | `init` | First-time index. Refuses if artifacts already exist. |
171200
| Lifecycle | `increment` | CocoIndex catch-up + incremental Kuzu update. `--vectors-only` for Lance only. |
172201
| Lifecycle | `reprocess` | Full Lance + Kuzu rebuild. `--vectors-only` / `--graph-only` for a single phase. |

docs/JAVA-CODEBASE-RAG-CLI.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,80 @@ If `java-codebase-rag` is missing, run the module entrypoint:
1717
.venv/bin/python -m java_codebase_rag.cli --help
1818
```
1919

20+
## Setup commands
21+
22+
### `install`
23+
24+
Interactive setup wizard that walks users through Java source detection, embedding model selection, agent host configuration, artifact deployment, and YAML config generation. Use `--non-interactive` for CI/automation.
25+
26+
```bash
27+
# Interactive mode
28+
java-codebase-rag install
29+
30+
# Non-interactive mode (requires at least one --agent)
31+
java-codebase-rag install --non-interactive --agent claude-code
32+
java-codebase-rag install --non-interactive --agent claude-code --agent qwen-code
33+
34+
# With custom embedding model
35+
java-codebase-rag install --model /path/to/model
36+
37+
# User-scope installation (available globally)
38+
java-codebase-rag install --scope user
39+
```
40+
41+
**Flags:**
42+
- `--non-interactive` — Run without prompts (requires `--agent`).
43+
- `--agent {claude-code,qwen-code,gigacode}` — Agent host to configure (can be passed multiple times).
44+
- `--scope {project,user}` — Installation scope (default: `project`). Project scope writes to `.<host>/` in the project repo; user scope writes to `~/.<host>/` (globally available).
45+
- `--model MODEL` — Embedding model path or `auto` (default: `auto`, downloads `sentence-transformers/all-MiniLM-L6-v2` on first run).
46+
47+
**Exit codes:**
48+
- `0` — Success (all stages completed).
49+
- `1` — Partial success (some stages failed). Re-run `install` to retry failed stages.
50+
- `2` — Fatal error (no Java files found, required flag missing).
51+
52+
**Stages:**
53+
1. Java source detection — Maven/Gradle module roots.
54+
2. Embedding model selection — auto-download or local path.
55+
3. Agent host selection — Claude Code, Qwen Code, GigaCode (multi-select).
56+
4. Install scope — project or user.
57+
5. MCP entrypoint resolution + artifact deployment — config, skill, agent files.
58+
6. Index + finish — YAML generation, `.gitignore` update, `init`.
59+
60+
**Re-running `install`:** If `.java-codebase-rag.yml` exists, the installer shows current values and offers "Update" (pre-filled) or "Start fresh". Existing MCP entries are updated in-place (merged, not duplicated). Skill/agent files trigger overwrite confirmation.
61+
62+
### `update`
63+
64+
Post-upgrade refresh: overwrites skill and agent files with the latest shipped versions and updates the MCP command path. Requires a prior `install` run.
65+
66+
```bash
67+
# Refresh after pip upgrade
68+
pip install --upgrade java-codebase-rag
69+
java-codebase-rag update
70+
71+
# Preview changes without writing
72+
java-codebase-rag update --dry-run
73+
74+
# Force overwrite all artifacts
75+
java-codebase-rag update --force
76+
```
77+
78+
**Flags:**
79+
- `--force` — Overwrite all artifacts even if content matches.
80+
- `--dry-run` — Print changes without writing files.
81+
82+
**Behavior:**
83+
- Detects previously configured agent hosts (scans both project-level and user-level config files).
84+
- Refreshes skill and agent files (versioned assets from the package).
85+
- Updates MCP entrypoint path if `java-codebase-rag-mcp` has moved.
86+
- Runs `increment` on the index if it exists (LanceDB catch-up). Prints graph staleness warning.
87+
- Skips MCP config if the entry already exists and is correct.
88+
89+
**Exit codes:**
90+
- `0` — Success.
91+
- `1` — Partial failure (some artifacts failed to write).
92+
- `2` — No configured hosts found.
93+
2094
## Output mode
2195

2296
- **TTY:** human-readable `pprint` of the payload on stdout (except **successful selective `reprocess`** with `--vectors-only` / `--graph-only`, which prints `Rebuilt:` / `Skipped:` lines instead of dumping the full dict).
File renamed without changes.

0 commit comments

Comments
 (0)