Skip to content

Commit d7be5a8

Browse files
author
CortexLM
committed
refactor: use 'vgrep install <agent>' subcommand structure
- vgrep install claude-code - vgrep install opencode - vgrep install codex - vgrep install droid Also centered ASCII art in README.
1 parent d0ac815 commit d7be5a8

File tree

2 files changed

+66
-45
lines changed

2 files changed

+66
-45
lines changed

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
[![GitHub stars](https://img.shields.io/github/stars/CortexLM/vgrep)](https://github.com/CortexLM/vgrep/stargazers)
1010
[![Rust](https://img.shields.io/badge/rust-1.75+-orange.svg)](https://www.rust-lang.org/)
1111

12-
```
13-
██╗ ██╗ ██████╗ ██████╗ ███████╗██████╗
14-
██║ ██║██╔════╝ ██╔══██╗██╔════╝██╔══██╗
15-
██║ ██║██║ ███╗██████╔╝█████╗ ██████╔╝
16-
╚██╗ ██╔╝██║ ██║██╔══██╗██╔══╝ ██╔═══╝
17-
╚████╔╝ ╚██████╔╝██║ ██║███████╗██║
18-
╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝
19-
```
12+
<pre>
13+
██╗ ██╗ ██████╗ ██████╗ ███████╗██████╗
14+
██║ ██║██╔════╝ ██╔══██╗██╔════╝██╔══██╗
15+
██║ ██║██║ ███╗██████╔╝█████╗ ██████╔╝
16+
╚██╗ ██╔╝██║ ██║██╔══██╗██╔══╝ ██╔═══╝
17+
╚████╔╝ ╚██████╔╝██║ ██║███████╗██║
18+
╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝
19+
</pre>
2020

2121
**Search code by meaning, not just keywords. 100% offline. Zero cloud dependencies.**
2222

@@ -264,17 +264,22 @@ Output:
264264

265265
νgrεp supports assisted installation for popular coding agents:
266266

267-
| Command | Description |
268-
|---------|-------------|
269-
| `vgrep install-claude-code` | Install for Claude Code |
270-
| `vgrep install-opencode` | Install for OpenCode |
271-
| `vgrep install-codex` | Install for Codex |
272-
| `vgrep install-droid` | Install for Factory Droid |
267+
```bash
268+
vgrep install <agent> # Install integration
269+
vgrep uninstall <agent> # Remove integration
270+
```
271+
272+
| Agent | Command |
273+
|-------|---------|
274+
| Claude Code | `vgrep install claude-code` |
275+
| OpenCode | `vgrep install opencode` |
276+
| Codex | `vgrep install codex` |
277+
| Factory Droid | `vgrep install droid` |
273278

274279
### Usage with Claude Code
275280

276281
```bash
277-
vgrep install-claude-code
282+
vgrep install claude-code
278283
vgrep serve # Start server
279284
vgrep watch # Index your project
280285
# Claude Code can now use vgrep for semantic search
@@ -283,11 +288,11 @@ vgrep watch # Index your project
283288
### Usage with Factory Droid
284289

285290
```bash
286-
vgrep install-droid
291+
vgrep install droid
287292
# vgrep auto-starts when you begin a Droid session
288293
```
289294

290-
To uninstall, use `vgrep uninstall-<agent>` (e.g., `vgrep uninstall-droid`).
295+
To uninstall: `vgrep uninstall <agent>` (e.g., `vgrep uninstall droid`).
291296

292297
---
293298

src/cli/commands.rs

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -134,29 +134,41 @@ enum Commands {
134134
action: Option<ConfigAction>,
135135
},
136136

137-
/// Install vgrep integration for Claude Code
138-
InstallClaudeCode,
139-
140-
/// Uninstall vgrep from Claude Code
141-
UninstallClaudeCode,
142-
143-
/// Install vgrep integration for OpenCode
144-
InstallOpencode,
145-
146-
/// Uninstall vgrep from OpenCode
147-
UninstallOpencode,
148-
149-
/// Install vgrep integration for Codex
150-
InstallCodex,
137+
/// Install vgrep integration for coding agents
138+
Install {
139+
#[command(subcommand)]
140+
agent: InstallAgent,
141+
},
151142

152-
/// Uninstall vgrep from Codex
153-
UninstallCodex,
143+
/// Uninstall vgrep integration from coding agents
144+
Uninstall {
145+
#[command(subcommand)]
146+
agent: UninstallAgent,
147+
},
148+
}
154149

155-
/// Install vgrep integration for Factory Droid
156-
InstallDroid,
150+
#[derive(Subcommand)]
151+
enum InstallAgent {
152+
/// Install for Claude Code
153+
ClaudeCode,
154+
/// Install for OpenCode
155+
Opencode,
156+
/// Install for Codex
157+
Codex,
158+
/// Install for Factory Droid
159+
Droid,
160+
}
157161

158-
/// Uninstall vgrep from Factory Droid
159-
UninstallDroid,
162+
#[derive(Subcommand)]
163+
enum UninstallAgent {
164+
/// Uninstall from Claude Code
165+
ClaudeCode,
166+
/// Uninstall from OpenCode
167+
Opencode,
168+
/// Uninstall from Codex
169+
Codex,
170+
/// Uninstall from Factory Droid
171+
Droid,
160172
}
161173

162174
#[derive(Subcommand)]
@@ -307,14 +319,18 @@ impl Cli {
307319
Some(Commands::Status) => run_status(&config),
308320
Some(Commands::Models { action }) => run_models(action, &mut config),
309321
Some(Commands::Config { action }) => run_config(action, &mut config),
310-
Some(Commands::InstallClaudeCode) => super::install::install_claude_code(),
311-
Some(Commands::UninstallClaudeCode) => super::install::uninstall_claude_code(),
312-
Some(Commands::InstallOpencode) => super::install::install_opencode(),
313-
Some(Commands::UninstallOpencode) => super::install::uninstall_opencode(),
314-
Some(Commands::InstallCodex) => super::install::install_codex(),
315-
Some(Commands::UninstallCodex) => super::install::uninstall_codex(),
316-
Some(Commands::InstallDroid) => super::install::install_droid(),
317-
Some(Commands::UninstallDroid) => super::install::uninstall_droid(),
322+
Some(Commands::Install { agent }) => match agent {
323+
InstallAgent::ClaudeCode => super::install::install_claude_code(),
324+
InstallAgent::Opencode => super::install::install_opencode(),
325+
InstallAgent::Codex => super::install::install_codex(),
326+
InstallAgent::Droid => super::install::install_droid(),
327+
},
328+
Some(Commands::Uninstall { agent }) => match agent {
329+
UninstallAgent::ClaudeCode => super::install::uninstall_claude_code(),
330+
UninstallAgent::Opencode => super::install::uninstall_opencode(),
331+
UninstallAgent::Codex => super::install::uninstall_codex(),
332+
UninstallAgent::Droid => super::install::uninstall_droid(),
333+
},
318334
None => {
319335
print_quick_help();
320336
Ok(())

0 commit comments

Comments
 (0)