Skip to content

Commit 05e77fa

Browse files
committed
docs(readme): add Debugging section for OPENCODER_DEBUG environment variable
Signed-off-by: leocavalcante <leo@cavalcante.dev>
1 parent e6b78fd commit 05e77fa

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,32 @@ import { name, version, description, agents } from "opencode-plugin-opencoder"
142142

143143
The plugin currently provides a minimal hooks structure that can be extended in the future. Agent registration is handled via the postinstall script since the OpenCode plugin API does not yet support dynamic agent registration.
144144

145+
## Debugging
146+
147+
Enable debug logging to see plugin activity:
148+
149+
```bash
150+
OPENCODER_DEBUG=1 opencode @opencoder
151+
```
152+
153+
When enabled, the plugin logs:
154+
155+
| Event | Information Logged |
156+
|-------|-------------------|
157+
| `event` | Event type, property keys |
158+
| `tool.execute.before` | Tool name, session ID, call ID, argument keys |
159+
| `tool.execute.after` | Tool name, session ID, call ID, title, output length |
160+
161+
Log output format:
162+
163+
```
164+
[2025-01-18T12:00:00.000Z] [opencoder] Event received {
165+
"directory": "/path/to/project",
166+
"type": "session.created",
167+
"properties": ["sessionID", "model"]
168+
}
169+
```
170+
145171
## Development
146172

147173
```bash

0 commit comments

Comments
 (0)