moshi-opencode-hooks 1.0.12 → 1.0.13
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/README.md +66 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,38 +1,74 @@
|
|
|
1
1
|
# moshi-opencode-hooks
|
|
2
2
|
|
|
3
|
-
OpenCode plugin
|
|
3
|
+
OpenCode plugin that sends real-time events to the [Moshi](https://getmoshi.app) iOS app for live activity integration.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Motivation
|
|
8
|
+
|
|
9
|
+
[Moshi](https://getmoshi.app) is an iOS SSH app that provides live activity widgets on the lock screen and Dynamic Island. While it already supports Cloud Code, this plugin brings the same live activity experience to [OpenCode](https://opencode.ai) users.
|
|
10
|
+
|
|
11
|
+
Track your coding session progress in real-time:
|
|
12
|
+
- See which tool is currently running
|
|
13
|
+
- Get notified when permissions are needed
|
|
14
|
+
- Know when your task completes
|
|
4
15
|
|
|
5
16
|
## Setup
|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Events
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
```bash
|
|
19
|
+
# 1. Install the plugin (pulls from npm)
|
|
20
|
+
bunx moshi-opencode-hooks setup
|
|
21
|
+
|
|
22
|
+
# 2. Add your Moshi token
|
|
23
|
+
bunx moshi-opencode-hooks token YOUR_TOKEN_HERE
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That's it! OpenCode will now send events to Moshi whenever you start a session or run a tool.
|
|
27
|
+
|
|
28
|
+
### Manual Setup
|
|
29
|
+
|
|
30
|
+
Add to `~/.config/opencode/opencode.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"$schema": "https://opencode.ai/config.json",
|
|
35
|
+
"plugin": ["moshi-opencode-hooks"]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Events
|
|
40
|
+
|
|
41
|
+
The plugin sends these events to Moshi:
|
|
42
|
+
|
|
43
|
+
| OpenCode Event | Moshi Display |
|
|
44
|
+
|----------------|--------------|
|
|
45
|
+
| `session.created` | Session started |
|
|
46
|
+
| `tool.execute.before` | Running tool (Bash, Edit, Write, Read, Glob, Grep, Task) |
|
|
47
|
+
| `tool.execute.after` | Tool finished |
|
|
48
|
+
| `permission.ask` | Permission required |
|
|
49
|
+
| `session.idle` | Task complete |
|
|
34
50
|
|
|
35
51
|
## Requirements
|
|
36
52
|
|
|
37
|
-
- OpenCode
|
|
38
|
-
- Moshi iOS app with Cloud Code
|
|
53
|
+
- [OpenCode](https://opencode.ai)
|
|
54
|
+
- [Moshi iOS app](https://getmoshi.app) with Cloud Code subscription
|
|
55
|
+
|
|
56
|
+
## Moshi Token
|
|
57
|
+
|
|
58
|
+
Get your token from the Moshi iOS app:
|
|
59
|
+
1. Open Moshi → Settings → Coding Agents
|
|
60
|
+
2. Copy the hook token
|
|
61
|
+
|
|
62
|
+
## Uninstall
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bunx moshi-opencode-hooks uninstall
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## How It Works
|
|
69
|
+
|
|
70
|
+
The plugin hooks into OpenCode's plugin system and subscribes to session and tool events. When events occur, they're normalized and POSTed to the Moshi API endpoint, which pushes updates to your live activity.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|