Skip to content

Commit 9a57aa2

Browse files
committed
switch to npm-based install
1 parent c2113ac commit 9a57aa2

12 files changed

Lines changed: 67 additions & 1128 deletions

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# opencode-trace
22

33
This is a plugin designed to capture the raw json requests sent to the LLM, and the raw responses back (after streaming-delta consolidation). It saves them into ~/opencode-trace
4-
- For end-to-end build+install and testing: `npm run build` then `cp dist/opencode-trace.ts ~/.config/opencode/plugins/`, and then just run `opencode run --dangerously-skip-permissions "why is grass green?"` to test it. This will re-use the existing opencode API key / oauth credentials.
5-
- For development, no build+install is needed. Undo the previous global install `rm ~/.config/opencode/plugins/opencode-trace.ts` and then `OPENCODE_CONFIG="/absolute/path/to/opencode-trace/integration-test.json" opencode run --dangerously-skip-permissions "why is the sky blue?"`
6-
- For development: `npm install` once, then `npm run typecheck` or `npm run lint`
4+
- End users should install it as an npm plugin via `"plugin": ["@ljw1004/opencode-trace"]` in `~/.config/opencode/opencode.json`.
5+
- For development: `npm install` once, and change the plugin line to `["/path/to/opencode-trace/index.ts"]`. Then each time you edit, `npm run typecheck` and `npm run lint` and then exercise it `opencode run --dangerously-skip-permissions "why is the sky blue?"`. (It's using the existing opencode configuration to pick up your already-configured auth).
6+
- For iterating on the viewer, you can copy `viewer.js` into your ~/opencode-trace directory, or copy examples into this directory, and they'll preferentially pick up `viewer.js` over their embedded viewer code.

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ This opencode plugin lets you see the raw json requests made to the LLM, and the
55

66
## Installation
77

8-
1. Download https://raw.githubusercontent.com/ljw1004/opencode-trace/refs/heads/main/dist/opencode-trace.ts into ~/.config/opencode/plugins
9-
2. Restart opencode and use it
10-
3. You'll see each transcript stored in ~/opencode-trace
8+
Add the package to your OpenCode config:
119

12-
To uninstall, `rm ~/.config/opencode/plugins/opencode-trace.ts`
10+
```json
11+
{
12+
"$schema": "https://opencode.ai/config.json",
13+
"plugin": ["@ljw1004/opencode-trace"]
14+
}
15+
```
16+
17+
Restart OpenCode and you'll see each transcript stored in `~/opencode-trace`.

build.mjs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)