Skip to content

Commit b86934b

Browse files
committed
docs: update readme
1 parent 283aa8e commit b86934b

File tree

4 files changed

+126
-11
lines changed

4 files changed

+126
-11
lines changed

.opencode/plugin/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { compose } from "../../packages/compose/dist/main"
2+
import { notification } from "../../packages/notification/dist/main"
3+
4+
export const main = compose([notification()])

.opencode/plugin/notification.ts

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

README.md

Lines changed: 122 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,125 @@
1-
# pkg-placeholder
1+
# opencode-plugins
22

3-
haha
4-
5-
> **Note**:
6-
> Replace `pkg-placeholder` and `_description_` globally to use this template.
3+
A collection of plugins for [opencode](https://opencode.ai), providing composable utilities for plugin composition, debugging, and notifications.
74

85
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E519XS7W)
6+
7+
## Packages
8+
9+
This monorepo contains three opencode plugins:
10+
11+
### `opencode-plugin-compose`
12+
13+
Compose multiple opencode plugins into a single plugin that runs all hooks in sequence.
14+
15+
```ts
16+
import { compose } from "opencode-plugin-compose";
17+
18+
const composedPlugin = compose([pluginA, pluginB, pluginC]);
19+
```
20+
21+
**Features:**
22+
23+
- Sequentially executes all plugin hooks (event, chat.message, chat.params, permission.ask, tool.execute.before/after)
24+
- Maintains hook execution order
25+
26+
---
27+
28+
### `opencode-plugin-inspector`
29+
30+
Real-time web interface for debugging and monitoring plugin hook events.
31+
32+
```ts
33+
import { inspector } from "opencode-plugin-inspector";
34+
35+
const inspectorPlugin = inspector({ port: 6969 }); // port optional, defaults to 6969
36+
```
37+
38+
**Features:**
39+
40+
- Web UI accessible at `http://localhost:6969`
41+
- Built with React and Tailwind CSS
42+
43+
---
44+
45+
### `opencode-plugin-notification`
46+
47+
Desktop notifications for session idle events with customizable commands and timing.
48+
49+
```ts
50+
import { notification } from "opencode-plugin-notification";
51+
52+
const notificationPlugin = notification({
53+
idleTime: 60000, // 1 minute (default)
54+
notificationCommand: ["notify-send", "--app-name", "opencode"], // default
55+
additionalCommands: [["canberra-gtk-play", "-i", "complete"]], // default
56+
getMessage: async ({ sessionID, client }) => {
57+
// Custom message logic
58+
return "Custom notification message";
59+
},
60+
});
61+
```
62+
63+
**Features:**
64+
65+
- Configurable idle time threshold
66+
- Custom notification commands (defaults to `notify-send`)
67+
- Optional sound commands
68+
69+
## Installation
70+
71+
Install individual packages:
72+
73+
```bash
74+
npm install opencode-plugin-compose
75+
npm install opencode-plugin-inspector
76+
npm install opencode-plugin-notification
77+
```
78+
79+
I would recommend installing as optional dependency
80+
81+
## Development
82+
83+
This project uses [Turborepo](https://turbo.build) for monorepo management and [pnpm](https://pnpm.io) for package management.
84+
85+
### Prerequisites
86+
87+
- Node.js 18+
88+
- pnpm 8+
89+
- Bun (for inspector package)
90+
91+
### Setup
92+
93+
```bash
94+
# Install dependencies
95+
pnpm install
96+
97+
# Build all packages
98+
pnpm run build
99+
100+
# Start development mode (watches for changes)
101+
pnpm run dev
102+
```
103+
104+
### Working on individual packages
105+
106+
```bash
107+
# Work on a specific package
108+
cd packages/compose
109+
pnpm run dev
110+
```
111+
112+
### Scripts
113+
114+
- `pnpm run build` - Build all packages
115+
- `pnpm run dev` - Start development mode for all packages
116+
- `pnpm run lint` - Lint the codebase
117+
- `pnpm run typecheck` - Run TypeScript type checking
118+
119+
## License
120+
121+
[MIT](./LICENSE)
122+
123+
## Support
124+
125+
If you find this project useful, consider supporting via [Ko-fi](https://ko-fi.com/E1E519XS7W).

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656
"turbo": "^2.5.5",
5757
"typescript": "^5.9.2"
5858
},
59-
"optionalDependencies": {
60-
"opencode-plugin-notification": "workspace:*"
61-
},
6259
"packageManager": "pnpm@10.14.0",
6360
"pnpm": {
6461
"onlyBuiltDependencies": [

0 commit comments

Comments
 (0)