opencode-raven 2.1.5 → 2.1.7
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/CHANGELOG.md +220 -0
- package/README.md +212 -317
- package/index.ts +679 -438
- package/package.json +22 -4
package/README.md
CHANGED
|
@@ -1,317 +1,212 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| MCP |
|
|
104
|
-
|
|
105
|
-
| Context7 | `https://mcp.context7.com/mcp` |
|
|
106
|
-
| Exa
|
|
107
|
-
| Grep.app | `https://mcp.grep.app` | Public API
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
Use `ravenInstructions` for extra Raven-only guidance, such as how to use custom MCPs:
|
|
215
|
-
|
|
216
|
-
```json
|
|
217
|
-
{
|
|
218
|
-
"ravenInstructions": "For Linear requests, prefer assigned open issues and include issue keys in the answer."
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
## Routing And Exceptions
|
|
223
|
-
|
|
224
|
-
By default, Raven routes these built-in tools and auto-routes globally configured MCPs by detected server name:
|
|
225
|
-
|
|
226
|
-
| Config | Default |
|
|
227
|
-
|--------|---------|
|
|
228
|
-
| `routeTools` | `grep`, `glob`, `webfetch`, `fetch`, `websearch`, `bash` |
|
|
229
|
-
| `routeToolKeywords` | none |
|
|
230
|
-
|
|
231
|
-
Global MCPs configured in OpenCode are auto-routed through Raven by server name. For example, an MCP named `linear` routes tools named `linear_*`. This works for any MCP whose OpenCode tool names use the normal `<server>_<tool>` prefix. Matching is case-insensitive.
|
|
232
|
-
|
|
233
|
-
If a server uses suffix-style or mixed tool names, route by keyword instead. For example, `exa` catches names like `web_search_exa` and `web_fetch_exa`:
|
|
234
|
-
|
|
235
|
-
```txt
|
|
236
|
-
/raven route keyword add exa
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
If an MCP is routed but one tool should remain direct, add the exact tool to `excludeTools`:
|
|
240
|
-
|
|
241
|
-
```json
|
|
242
|
-
{
|
|
243
|
-
"excludeTools": ["my_mcp_validate"]
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
To route one specific tool without routing the whole MCP server:
|
|
248
|
-
|
|
249
|
-
```txt
|
|
250
|
-
/raven route tool add linear_search_issues
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
`bash` is intercepted only while `bash` is included in `routeTools` and the command matches a primary search/discovery pattern.
|
|
254
|
-
|
|
255
|
-
| Pattern | Examples |
|
|
256
|
-
|---------|----------|
|
|
257
|
-
| Content search | `rg`, `grep`, `egrep`, `fgrep`, `git grep`, `ack`, `ag`, `findstr`, `Select-String` |
|
|
258
|
-
| Filesystem exploration | `Get-ChildItem -Recurse`, `gci -Recurse`, `Get-ChildItem -Filter`, `find -name`, `find -type`, `ls -R`, `ls --recursive`, `dir /s` |
|
|
259
|
-
| Shell bypass | `cmd /c dir /s`, `cmd /c findstr`, `cmd /c find`, `cmd /c tree` |
|
|
260
|
-
|
|
261
|
-
Unrestricted for non-Raven agents: `read`, `task`, `subtask`, `raven_seek`, non-routed tools, and non-search `bash` commands.
|
|
262
|
-
|
|
263
|
-
Allowed output filters: piped filters like `command | grep ...`, `command | rg ...`, `command | findstr ...`, and `command | head ...` are allowed. Raven only blocks search commands when they are used as primary discovery commands, not when they filter bounded output from another command.
|
|
264
|
-
|
|
265
|
-
To stop routing search-like bash commands, remove `bash` from `routeTools`:
|
|
266
|
-
|
|
267
|
-
```txt
|
|
268
|
-
/raven route tool remove bash
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
Quoted content and shell comments in bash commands are stripped before pattern matching. For example, `echo "use grep here"` and `# use grep later` do not trigger routing.
|
|
272
|
-
|
|
273
|
-
## What Raven Saves
|
|
274
|
-
|
|
275
|
-
Raven saves context from tool call results and raw MCP output by moving the work into a Raven session and returning a compact answer. On-demand MCPs also avoid loading full MCP tool schemas into the main OpenCode session because Raven connects to them internally through `raven_mcp`.
|
|
276
|
-
|
|
277
|
-
MCPs configured directly in OpenCode `opencode.jsonc` still load globally and may increase the main session's starting context. Use `onDemandMcpServers` for MCPs you want Raven to keep behind the context firewall.
|
|
278
|
-
|
|
279
|
-
`/raven stats` uses a balanced estimate: Raven's final session token total minus the first Raven assistant turn's input/cache baseline, then minus the compact answer returned to the main session. This counts tool/web/MCP result context Raven handled while avoiding Raven's starting prompt and tool-schema overhead.
|
|
280
|
-
|
|
281
|
-
`Avoided MCP schema load` is a separate estimate based on full loaded on-demand MCP tool schemas discovered by Raven but not loaded into the main model. Failed or pending MCPs do not count toward this total. It is stored in autogenerated MCP metadata and shown separately from delegated session savings.
|
|
282
|
-
|
|
283
|
-
## How It Works
|
|
284
|
-
|
|
285
|
-
| Hook | What it does |
|
|
286
|
-
|------|--------------|
|
|
287
|
-
| `config` | Registers Raven agent, loads MCP routing guidance, and starts on-demand MCP health/metadata checks. Bundled MCPs are on-demand by default, not injected into global OpenCode MCP config. |
|
|
288
|
-
| `tool` | Registers `raven_seek` and Raven-only `raven_mcp`. `raven_seek` creates Raven sessions with timeout, error recovery, timing, and session tree visibility. Tracks context saved for stats. |
|
|
289
|
-
| `chat.message` | Tracks agent to session mapping for allowlist and Raven exclusion. |
|
|
290
|
-
| `event` | Shows startup update and MCP failure notifications after the TUI event stream is ready. |
|
|
291
|
-
| `command.execute.before` | Handles `/raven help`, routing commands, MCP commands, update checks, model settings, timeout, and stats. |
|
|
292
|
-
| `tool.execute.before` | Hard-blocks configured tools/MCPs for non-Raven, non-excluded agents. Error output gives the next `raven_seek(query="...")` call or recovery instructions if Raven's provider is unavailable. Tracks direct Raven subagent calls for stats. |
|
|
293
|
-
| `tool.execute.after` | Tracks direct `@Raven` calls for context-saved stats. |
|
|
294
|
-
|
|
295
|
-
Raven routing guidance is loaded through OpenCode instructions at startup. Subagent prompts are not modified; if a non-Raven agent calls a routed tool, Raven blocks it and returns the exact `raven_seek(query="...")` call to use.
|
|
296
|
-
|
|
297
|
-
## Agent Capabilities
|
|
298
|
-
|
|
299
|
-
Raven itself has access to these tools, blocked for other agents when configured by the plugin:
|
|
300
|
-
|
|
301
|
-
| Tool / MCP | Purpose |
|
|
302
|
-
|------------|---------|
|
|
303
|
-
| `read`, `glob`, `grep`, `list` | Local codebase inspection |
|
|
304
|
-
| `bash` | Full local shell access, including `rg`, `grep`, `dir`, `ls`, `Get-ChildItem`, and `find` |
|
|
305
|
-
| `external_directory` | Allowed, with no permission prompts when accessing paths outside the workspace |
|
|
306
|
-
| `raven_mcp` | Raven-only bridge to on-demand remote/local MCP servers |
|
|
307
|
-
| Context7 | On-demand library/framework/SDK/API docs |
|
|
308
|
-
| Exa AI | On-demand web search, news, pages, products |
|
|
309
|
-
| Grep.app | On-demand public GitHub examples |
|
|
310
|
-
|
|
311
|
-
`raven_seek` is denied inside Raven itself so Raven cannot recursively call its own wrapper tool. Raven uses direct tools, globally available MCPs, and `raven_mcp` for on-demand MCPs instead.
|
|
312
|
-
|
|
313
|
-
Raven returns compact findings: answer, sources, relevant details, recommended next step, and uncertainty.
|
|
314
|
-
|
|
315
|
-
## Disclaimer
|
|
316
|
-
|
|
317
|
-
opencode-raven is not built by the OpenCode team and is not affiliated with OpenCode in any way.
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>opencode-raven</h1>
|
|
3
|
+
<p><strong>Keep noisy tool work out of your main OpenCode context.</strong></p>
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://www.npmjs.com/package/opencode-raven"><img src="https://img.shields.io/npm/v/opencode-raven.svg" alt="npm version" /></a>
|
|
6
|
+
<a href="https://www.npmjs.com/package/opencode-raven"><img src="https://img.shields.io/npm/dm/opencode-raven.svg" alt="npm downloads" /></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/npm/l/opencode-raven.svg" alt="license" /></a>
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<table>
|
|
12
|
+
<tr>
|
|
13
|
+
<td width="28%" align="center" valign="middle">
|
|
14
|
+
<img src="Raven.png" alt="Raven" width="180" />
|
|
15
|
+
</td>
|
|
16
|
+
<td valign="top">
|
|
17
|
+
<h2>Why Raven</h2>
|
|
18
|
+
<p>Raven delegates search, web, documentation, GitHub, command-inspection, and MCP work to a focused subagent, then returns a compact answer to the main session.</p>
|
|
19
|
+
<ul>
|
|
20
|
+
<li>Routes OpenCode tools and globally configured MCPs through <code>raven_seek</code>.</li>
|
|
21
|
+
<li>Keeps optional on-demand MCP schemas out of the main model's tool list.</li>
|
|
22
|
+
<li>Preconfigures Context7, Exa, and Grep.app endpoints.</li>
|
|
23
|
+
<li>Tracks estimated main-session context avoided by delegation.</li>
|
|
24
|
+
</ul>
|
|
25
|
+
</td>
|
|
26
|
+
</tr>
|
|
27
|
+
</table>
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
Raven requires OpenCode 1.15.12 or newer. Add it to `opencode.jsonc`:
|
|
32
|
+
|
|
33
|
+
```jsonc
|
|
34
|
+
{
|
|
35
|
+
"plugin": ["opencode-raven"]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Restart OpenCode, then run `/raven` to verify the loaded version, model, routing, MCP health, and estimated savings.
|
|
40
|
+
|
|
41
|
+
OpenCode resolves the package from npm and caches it automatically.
|
|
42
|
+
|
|
43
|
+
## Example
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<img src="example.gif" alt="Raven automatically delegating web research while reducing main-session context" />
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
In this run, Raven handled the search-heavy web research in a child session and returned only the compact findings, keeping roughly 71K tokens of estimated tool and search context from flooding the main session. Actual savings vary by task, model, and tool output.
|
|
50
|
+
|
|
51
|
+
## How It Works
|
|
52
|
+
|
|
53
|
+
**Raven works automatically.** Ask OpenCode for what you need as usual. You do not need to mention Raven, run a command, or manually call a delegation tool.
|
|
54
|
+
|
|
55
|
+
1. Your agent attempts to use a routed search, fetch, shell-discovery, or MCP tool.
|
|
56
|
+
2. Raven blocks the noisy direct call and gives the agent the exact `raven_seek` retry.
|
|
57
|
+
3. The agent continues automatically through a linked Raven child session.
|
|
58
|
+
4. Raven performs the tool-heavy work and returns only compact findings to the main session.
|
|
59
|
+
|
|
60
|
+
The main model receives Raven's final answer instead of its raw tool output. Child sessions remain available in OpenCode's session/subagent view for inspection.
|
|
61
|
+
|
|
62
|
+
For direct control, mention `@Raven` in any chat. This sends the request straight to the Raven agent, but it is optional and not required for automatic routing.
|
|
63
|
+
|
|
64
|
+
Under the hood, Raven registers two tools:
|
|
65
|
+
|
|
66
|
+
| Tool | Purpose |
|
|
67
|
+
|------|---------|
|
|
68
|
+
| `raven_seek` | Creates a linked Raven child session and returns its compact result. |
|
|
69
|
+
| `raven_mcp` | Raven-only bridge to MCPs configured under `onDemandMcpServers`. |
|
|
70
|
+
|
|
71
|
+
OpenCode's built-in tools already exist; Raven routes selected calls instead of replacing those tools. Global MCPs also remain globally registered, so their schemas still enter the main session even when Raven routes their calls.
|
|
72
|
+
|
|
73
|
+
On-demand MCPs are different: Raven discovers and calls them internally, so their full schemas are not registered globally. Enabled servers are probed after startup to discover tools and health, then per-session connections are opened when Raven uses them. "On-demand" describes schema exposure and normal use, not the absence of a startup health probe.
|
|
74
|
+
|
|
75
|
+
## Configuration
|
|
76
|
+
|
|
77
|
+
Raven creates its global configuration here:
|
|
78
|
+
|
|
79
|
+
```txt
|
|
80
|
+
~/.config/opencode/opencode-raven/raven-config.json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Manual edits require an OpenCode restart. `/raven on`, `/raven off`, routing changes, and timeout changes apply immediately unless the command says otherwise.
|
|
84
|
+
|
|
85
|
+
| Field | Fresh-install default | Description |
|
|
86
|
+
|-------|-----------------------|-------------|
|
|
87
|
+
| `enabled` | `true` | Enables hard routing. It does not disable Raven's update check or MCP health probes. |
|
|
88
|
+
| `model` | From `Raven.md` | Raven model override. Availability and pricing depend on the provider. |
|
|
89
|
+
| `reasoning_effort` | `low` | Raven model reasoning option. |
|
|
90
|
+
| `ravenInstructions` | `""` | Extra Raven-only instructions. |
|
|
91
|
+
| `routeTools` | Search/fetch tools plus `bash` | Exact tools routed through Raven. `bash` only intercepts search-like commands. |
|
|
92
|
+
| `routeToolKeywords` | `[]` | Case-insensitive tool-name substrings, useful for nonstandard MCP tool names. |
|
|
93
|
+
| `onDemandMcpDescriptionDetail` | `"full"` | `full` includes tool names and short summaries; `minimized` includes capability summaries only. |
|
|
94
|
+
| `onDemandMcpServers` | Context7, Exa, Grep.app | Remote HTTP/SSE or local stdio MCP definitions. |
|
|
95
|
+
| `excludeAgents` | `[]` | Agents allowed to bypass routing. |
|
|
96
|
+
| `excludeTools` | `[]` | Exact tools never routed by Raven. |
|
|
97
|
+
| `timeout` | `600` | Raven delegation and fallback MCP timeout in seconds; minimum 10. |
|
|
98
|
+
|
|
99
|
+
## On-Demand MCPs
|
|
100
|
+
|
|
101
|
+
Fresh installs include:
|
|
102
|
+
|
|
103
|
+
| MCP | Endpoint | Authentication |
|
|
104
|
+
|-----|----------|----------------|
|
|
105
|
+
| Context7 | `https://mcp.context7.com/mcp` | Optional key for higher limits |
|
|
106
|
+
| Exa | `https://mcp.exa.ai/mcp` | Optional key for higher limits |
|
|
107
|
+
| Grep.app | `https://mcp.grep.app` | Public API |
|
|
108
|
+
|
|
109
|
+
Provider access policies can change. `/raven mcp` shows the result of Raven's current startup probe.
|
|
110
|
+
|
|
111
|
+
Merge changes into the existing `onDemandMcpServers` object; replacing it removes omitted defaults. Header and environment values support `{env:VARIABLE}` placeholders.
|
|
112
|
+
|
|
113
|
+
Custom remote MCP or keyed endpoint:
|
|
114
|
+
|
|
115
|
+
```jsonc
|
|
116
|
+
{
|
|
117
|
+
"onDemandMcpServers": {
|
|
118
|
+
"myDocs": {
|
|
119
|
+
"type": "remote",
|
|
120
|
+
"url": "https://example.com/mcp",
|
|
121
|
+
"headers": { "Authorization": "Bearer {env:MY_DOCS_TOKEN}" }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Custom local stdio MCP:
|
|
128
|
+
|
|
129
|
+
```jsonc
|
|
130
|
+
{
|
|
131
|
+
"onDemandMcpServers": {
|
|
132
|
+
"myLocal": {
|
|
133
|
+
"type": "local",
|
|
134
|
+
"command": ["bunx", "some-mcp-server"],
|
|
135
|
+
"environment": { "API_KEY": "{env:MY_LOCAL_KEY}" },
|
|
136
|
+
"cwd": "C:\\path\\to\\workspace",
|
|
137
|
+
"timeout": 60000
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Per-server `timeout` values are milliseconds. Local servers inherit the OpenCode process environment. Set `enabled: false` to keep an entry without probing or loading it.
|
|
144
|
+
|
|
145
|
+
Generated MCP metadata and main-model guidance live beside `raven-config.json`. Refresh them with `/raven mcp refresh [server]`.
|
|
146
|
+
|
|
147
|
+
## Routing
|
|
148
|
+
|
|
149
|
+
Default routed tools are `grep`, `glob`, `webfetch`, `fetch`, `websearch`, and search-like `bash` commands.
|
|
150
|
+
|
|
151
|
+
Global MCPs are automatically routed when their OpenCode tool names use the normal `<server>_<tool>` prefix. Use a keyword for suffix-style names:
|
|
152
|
+
|
|
153
|
+
```txt
|
|
154
|
+
/raven route keyword add exa
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Route or unroute exact tools:
|
|
158
|
+
|
|
159
|
+
```txt
|
|
160
|
+
/raven route tool add linear_search_issues
|
|
161
|
+
/raven route tool remove bash
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`excludeTools` leaves selected tools direct even if their MCP prefix is routed. `excludeAgents` bypasses routing for selected agents.
|
|
165
|
+
|
|
166
|
+
When `bash` is routed, Raven intercepts primary discovery commands such as `rg`, recursive `grep`, `find -name`, `dir /s`, and `Get-ChildItem -Recurse`, including common quoted shell wrappers. Bounded output filters such as `command | grep ...` remain direct.
|
|
167
|
+
|
|
168
|
+
## Commands
|
|
169
|
+
|
|
170
|
+
| Command | Action |
|
|
171
|
+
|---------|--------|
|
|
172
|
+
| `/raven` | Show status, routing, MCP health, version, model, timeout, and stats. |
|
|
173
|
+
| `/raven help` | Show command help. |
|
|
174
|
+
| `/raven on` / `/raven off` | Enable or disable hard routing. |
|
|
175
|
+
| `/raven route` | Show and edit routed tools and keywords. |
|
|
176
|
+
| `/raven mcp` | Show on-demand MCP health and generated metadata. |
|
|
177
|
+
| `/raven mcp refresh [server]` | Recheck MCP health and regenerate metadata. |
|
|
178
|
+
| `/raven mcp detail full|minimized` | Set generated guidance detail; restart afterward. |
|
|
179
|
+
| `/raven model <provider/model>` | Change Raven's model; restart afterward. |
|
|
180
|
+
| `/raven effort <value>` | Change Raven's reasoning effort; restart afterward. |
|
|
181
|
+
| `/raven timeout <seconds>` | Change the delegation timeout. |
|
|
182
|
+
| `/raven stats` | Show estimated context avoided. |
|
|
183
|
+
| `/raven update` | Check npm, clear Raven's OpenCode package cache when needed, and show restart instructions. |
|
|
184
|
+
|
|
185
|
+
## Security And Privacy
|
|
186
|
+
|
|
187
|
+
Raven is optimized for autonomous inspection:
|
|
188
|
+
|
|
189
|
+
- It has read, search, unrestricted shell, external-directory, and configured MCP access without normal permission prompts.
|
|
190
|
+
- Its `edit` tool is denied, but shell access is not a read-only sandbox and can modify the system.
|
|
191
|
+
- Queries are sent to Raven's configured model provider.
|
|
192
|
+
- Remote MCP requests are sent to their services; local MCP entries launch local commands and inherit environment values.
|
|
193
|
+
- Startup performs an npm update check and probes enabled on-demand MCPs.
|
|
194
|
+
|
|
195
|
+
Review `Raven.md` and your MCP commands before using Raven in sensitive environments.
|
|
196
|
+
|
|
197
|
+
## Context Estimates
|
|
198
|
+
|
|
199
|
+
`/raven stats` reports delegated-session context and avoided on-demand MCP schema bytes. These are heuristic estimates based on OpenCode token metadata and serialized schemas, not billing measurements or guaranteed savings.
|
|
200
|
+
|
|
201
|
+
## Troubleshooting
|
|
202
|
+
|
|
203
|
+
- Provider or quota failure: run `/raven model <provider/model>`, then restart OpenCode.
|
|
204
|
+
- MCP failure: run `/raven mcp`, then `/raven mcp refresh <server>` after correcting its URL, command, environment, or credentials.
|
|
205
|
+
- Stale plugin version: run `/raven update`, restart OpenCode, and follow the cache-clearing instructions it prints if needed.
|
|
206
|
+
- Remove Raven: delete `"opencode-raven"` from `plugin`, restart, then optionally remove `~/.config/opencode/opencode-raven/`.
|
|
207
|
+
|
|
208
|
+
See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
209
|
+
|
|
210
|
+
## Disclaimer
|
|
211
|
+
|
|
212
|
+
opencode-raven is an independent project and is not affiliated with the OpenCode team. Released under the [MIT License](LICENSE).
|