basemind-opencode 0.2.6 → 0.4.0-rc.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/package.json +1 -1
- package/skills/basemind-cli/SKILL.md +155 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "basemind-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-rc.1",
|
|
4
4
|
"description": "Full AI context layer over MCP — tree-sitter code-map, document RAG (PDF/Office/HTML/email + OCR + reranker), shared agent memory, on-demand web crawl, git history + blame + per-symbol diff. 300+ languages, 8 coding-agent harnesses, content-addressed Fjall + LanceDB.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-context",
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: basemind-cli
|
|
3
|
+
description: >-
|
|
4
|
+
Navigate codebases and manage caches via the basemind CLI — outlines, symbol search,
|
|
5
|
+
reference/caller lookups, git history, blame, and diffs. For headless scripting, CI, or when
|
|
6
|
+
driving the CLI more efficiently than interactive MCP calls. Shares the same index as the
|
|
7
|
+
MCP server.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# basemind CLI — the scriptable interface
|
|
11
|
+
|
|
12
|
+
basemind has two equally-weighted surfaces: MCP (interactive tool calls) and CLI (scriptable commands).
|
|
13
|
+
They share the same `.basemind/` index and are safe to run alongside each other. Reach for the CLI
|
|
14
|
+
when you're scripting, batching queries, running in headless environments, or CI.
|
|
15
|
+
|
|
16
|
+
## Capabilities
|
|
17
|
+
|
|
18
|
+
- **Code map across 300+ languages** — tree-sitter outlines, symbol search, references, callers,
|
|
19
|
+
call graphs, implementations, dependents.
|
|
20
|
+
- **Full-text + symbol search** — indexed regex over content and substring symbol lookup.
|
|
21
|
+
- **Git intelligence** — history, blame, and structural diffs at symbol resolution, plus churn.
|
|
22
|
+
- **Document RAG over 90+ file formats** — PDFs, Office, HTML, email, images (OCR) → semantic search.
|
|
23
|
+
- **Shared memory** — per-repo, scope-keyed key-value + semantic memory across sessions.
|
|
24
|
+
- **Web crawl** — scrape / follow-link crawl into the searchable document store.
|
|
25
|
+
- **Cache management** — stats, garbage collection, selective and full clears.
|
|
26
|
+
|
|
27
|
+
## When to reach for it
|
|
28
|
+
|
|
29
|
+
- Running in headless environments or CI pipelines.
|
|
30
|
+
- Batching multiple queries without interactive delays.
|
|
31
|
+
- Integrating basemind into shell scripts or non-MCP tooling.
|
|
32
|
+
- Controlling tool routing explicitly (no agent routing decisions).
|
|
33
|
+
- Clearing caches destructively (only the CLI allows `--component all`).
|
|
34
|
+
|
|
35
|
+
## Command routing (copy this into your mental model)
|
|
36
|
+
|
|
37
|
+
| Question | Command | Notes |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| "Where is X defined?" | `basemind query symbol "X"` | Substring match, optional `--kind` filter. |
|
|
40
|
+
| "What's the shape of file F?" | `basemind query outline path/F` | Add `--l2` for calls + docs. |
|
|
41
|
+
| "What calls X?" (any name) | `basemind query references "X"` | Name match, no scope resolution. |
|
|
42
|
+
| "What calls this specific definition?" | `basemind query callers path name [--kind]` | Specific definition lookup. |
|
|
43
|
+
| "Trace the call graph?" | `basemind query call-graph "name" [--direction --max-depth]` | BFS over calls. |
|
|
44
|
+
| "What implements / extends X?" | `basemind query implementations "X"` | Rust, Python, TS/TSX, JS. |
|
|
45
|
+
| "What imports module M?" | `basemind query dependents "M"` | Reverse-lookup via imports. |
|
|
46
|
+
| "What files are indexed?" | `basemind query list-files [--language --path-contains]` | Filter by language/path. |
|
|
47
|
+
| "What changed recently?" | `basemind git recent-changes [--limit N]` | Recent commits with paths. |
|
|
48
|
+
| "When did symbol X last change?" | `basemind git symbol-history path name` | Cross-commit structural hash. |
|
|
49
|
+
| "Who wrote this line / symbol?" | `basemind git blame-file path` / `blame-symbol path name` | Per-line / per-symbol. |
|
|
50
|
+
| "Where's the churn?" | `basemind git hot-files [--limit N]` | Churn-ranked files. |
|
|
51
|
+
| "What's dirty in the working tree?" | `basemind git working-tree-status` | Staged/unstaged summary. |
|
|
52
|
+
| "Diff a file between revs?" | `basemind git diff-file path old new` / `diff-outline path` | File / outline diffs. |
|
|
53
|
+
| "What's indexed?" | `basemind query status` | File count, languages, cache dir. |
|
|
54
|
+
| "What's HEAD / branch?" | `basemind query repo-info` | Branch, HEAD, origin. |
|
|
55
|
+
| "Regex over file contents?" | `basemind query grep "pattern" [--language --path-contains]` | Full-text search. |
|
|
56
|
+
| "Semantic search over docs?" | `basemind memory search-documents "query"` | Needs `documents` feature. |
|
|
57
|
+
| "Recall something stored earlier?" | `basemind memory get "key"` / `list` / `search "q"` | KNN + exact match. |
|
|
58
|
+
| "Remember this for future sessions?" | `basemind memory put "key" "value"` | Delete with `memory delete "key"`. |
|
|
59
|
+
| "Cache size?" | `basemind cache stats` | On-disk size + orphan accounting. |
|
|
60
|
+
| "Reclaim cache space?" | `basemind cache gc` | Reclaim orphaned blobs. Safe alongside serve. |
|
|
61
|
+
| "Clear caches?" | `basemind cache clear --component blobs\|views\|all` | Destructive; use CLI not MCP. |
|
|
62
|
+
| "Pull this URL into RAG?" | `basemind web scrape <url>` | Single page (requires `--features crawl`). |
|
|
63
|
+
| "Ingest a docs site?" | `basemind web crawl <seed-url>` | Link-following crawl. |
|
|
64
|
+
| "What URLs exist on this site?" | `basemind web map <url>` | Sitemap + link discovery. |
|
|
65
|
+
| "Keep index fresh?" | `basemind watch [--no-serve]` | Live re-index. `--no-serve` = no MPC server. |
|
|
66
|
+
| "Refresh the index after edits?" | `basemind scan` | Full or incremental scan. |
|
|
67
|
+
| "Per-tool activity summary?" | `basemind telemetry` | Histogram + estimated tokens saved. |
|
|
68
|
+
|
|
69
|
+
## Output format
|
|
70
|
+
|
|
71
|
+
By default, all commands return **human-readable text**. For machine consumption, add the global `--json` flag:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
basemind query symbol "parseQuery" --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This returns the raw `JsonSchema`-derived response structure, same as MCP.
|
|
78
|
+
|
|
79
|
+
## Setup (one-time per repo)
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
basemind scan
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This walks the tree, parses with tree-sitter, and writes the content-addressed blob store +
|
|
86
|
+
Fjall inverted index under `.basemind/`. A few seconds for small repos, ~22 s for an ~80k-file
|
|
87
|
+
TypeScript monorepo.
|
|
88
|
+
|
|
89
|
+
Re-run `basemind scan` after large changes, or run `basemind watch` to keep the index fresh.
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
|
|
93
|
+
### Find where a symbol is defined
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
basemind query symbol "MapCache"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Output:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
src/mcp/mod.rs:79:1 MapCache (struct)
|
|
103
|
+
src/mcp/mod.rs:88:1 MapCache (impl)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Show a file's outline before opening it
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
basemind query outline src/mcp/tools.rs --l2
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Get all references to a function
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
basemind query references "process_file"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Find all callers of a specific definition
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
basemind query callers src/scanner.rs "process_file" --json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Show recent commits with changed files
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
basemind git recent-changes --limit 5
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Blame a symbol to see when its body last changed
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
basemind git blame-symbol src/scanner.rs "process_file"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Manage cache space
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
basemind cache stats
|
|
140
|
+
basemind cache gc # reclaim orphaned blobs
|
|
141
|
+
basemind cache clear --component blobs # clear blobs only
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Notes
|
|
145
|
+
|
|
146
|
+
- All paths are repository-relative with forward-slash separators.
|
|
147
|
+
- The CLI opens the index read-only; safe to run alongside a live `basemind serve` process.
|
|
148
|
+
- Lists are capped (`--limit`, default 100, max 1000).
|
|
149
|
+
- Matching on symbol names is substring-based; `find_references("bar")` matches `Foo::bar()` and `bar()` alike.
|
|
150
|
+
- Git tools require basemind to be running inside a git repository.
|
|
151
|
+
- Intelligence tools (`search_documents`, `memory_*`) require basemind to be built with `--features full`
|
|
152
|
+
(or the individual `documents` / `memory` flags).
|
|
153
|
+
- Memory is scoped by the normalized `origin` remote URL — clones of the same repo share memory;
|
|
154
|
+
unrelated repos do not see each other's entries.
|
|
155
|
+
- Web ingestion tools (`web_scrape`, `web_crawl`, `web_map`) require `--features crawl`.
|