omnish 1.6.6 → 2.0.0
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 +32 -0
- package/README.md +26 -18
- package/config.example.json +1 -0
- package/dist/downloads/omnish-claude/install.sh +174 -0
- package/dist/downloads/omnish-claude/uninstall.sh +114 -0
- package/dist/downloads/omnish-claude.tar.gz +0 -0
- package/dist/downloads/omnish-cursor/install.sh +162 -0
- package/dist/downloads/omnish-cursor/uninstall.sh +107 -0
- package/dist/downloads/omnish-cursor.tar.gz +0 -0
- package/dist/index.js +424 -392
- package/dist/omnish-claude/README.md +80 -0
- package/dist/omnish-claude/hooks/omnish-notify.py +213 -0
- package/dist/omnish-claude/hooks/omnish-notify.sh +13 -0
- package/dist/omnish-claude/install.sh +174 -0
- package/dist/omnish-claude/omnish-notify.json.example +8 -0
- package/dist/omnish-claude/scripts/doctor.sh +99 -0
- package/dist/omnish-claude/skill/SKILL.md +39 -0
- package/dist/omnish-claude/skill/files-and-sharing.md +94 -0
- package/dist/omnish-claude/skill/notifications.md +113 -0
- package/dist/omnish-claude/skill/setup-paths.md +81 -0
- package/dist/omnish-claude/uninstall.sh +114 -0
- package/dist/omnish-cursor/README.md +176 -0
- package/dist/omnish-cursor/hooks/__pycache__/omnish-notify.cpython-313.pyc +0 -0
- package/dist/omnish-cursor/hooks/omnish-notify.py +563 -0
- package/dist/omnish-cursor/hooks/omnish-notify.sh +13 -0
- package/dist/omnish-cursor/hooks/omnish-session-start.sh +48 -0
- package/dist/omnish-cursor/install.sh +162 -0
- package/dist/omnish-cursor/omnish-notify.json.example +13 -0
- package/dist/omnish-cursor/rules/omnish-notify.mdc +45 -0
- package/dist/omnish-cursor/scripts/doctor.sh +126 -0
- package/dist/omnish-cursor/skill/SKILL.md +129 -0
- package/dist/omnish-cursor/skill/files-and-sharing.md +94 -0
- package/dist/omnish-cursor/skill/notifications.md +155 -0
- package/dist/omnish-cursor/skill/setup-paths.md +81 -0
- package/dist/omnish-cursor/uninstall.sh +107 -0
- package/dist/ui/assets/{index-aUJGrxrr.js → index-BwG51a2I.js} +10 -10
- package/dist/ui/index.html +16 -1
- package/package.json +12 -4
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# File sharing with Omnish
|
|
2
|
+
|
|
3
|
+
Omnish moves files **host ↔ chat**. Per-chat cwd applies (same as `!` commands). Use **`/sendto *`** for broadcast to all allowlisted peers unless the user needs one recipient.
|
|
4
|
+
|
|
5
|
+
## Outbound: host → chat
|
|
6
|
+
|
|
7
|
+
### From chat (`/send` or `/file`)
|
|
8
|
+
|
|
9
|
+
Works in the current chat's working directory:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
/send ./photo.png
|
|
13
|
+
/send ./a.pdf,./b.png -- Two files
|
|
14
|
+
/send *.mp4
|
|
15
|
+
/send **/*.mp4
|
|
16
|
+
/send "/path with spaces/file.bin" -- Caption here
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Limits: `fileSendMaxBytes` in config (`0` = no omnish cap on standalone; platform hop may have separate relay limits).
|
|
20
|
+
|
|
21
|
+
### From terminal (`omnish i` + `/sendto`)
|
|
22
|
+
|
|
23
|
+
Requires **`omnish run`** on the same machine.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
omnish i -c '/sendto * ./promo.mp4'
|
|
27
|
+
omnish i -c '/sendto * intro.png,deck.pdf -- Launch materials'
|
|
28
|
+
omnish i -c '/sendto wa ./photo.png' # all allowlisted WA
|
|
29
|
+
omnish i -c '/sendto tg **/*.mp4 -- Video batch' # all allowlisted TG
|
|
30
|
+
omnish i -c '/sendto +15551234567 ./file.pdf' # explicit E.164
|
|
31
|
+
omnish i -c '/sendto tg:123456789 ./report.pdf' # explicit Telegram id
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Plain text (not a file attachment):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
omnish i -c '/sendto * --text Deploy finished OK'
|
|
38
|
+
omnish i -c '/sendto * -t=Status OK'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Destination | Meaning |
|
|
42
|
+
| ----------- | ----------------------------------- |
|
|
43
|
+
| `*` | All allowlisted WhatsApp + Telegram |
|
|
44
|
+
| `wa` | All allowlisted WhatsApp |
|
|
45
|
+
| `tg` | All allowlisted Telegram |
|
|
46
|
+
| `+E164` | One WhatsApp number |
|
|
47
|
+
| `tg:<id>` | One Telegram chat id |
|
|
48
|
+
|
|
49
|
+
Change cwd in REPL: `!cd /path/to/project` before `/sendto`.
|
|
50
|
+
|
|
51
|
+
## Inbound: chat → host
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
/receive # show current save mode
|
|
55
|
+
/receive here # save to this chat's cwd
|
|
56
|
+
/receive default # global default root
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Inbound paths appear as `Saved: …` on **your machine** (even in platform attached mode).
|
|
60
|
+
|
|
61
|
+
Config keys:
|
|
62
|
+
|
|
63
|
+
- `fileReceiveRootMode`: `downloads`, `cwd`, `fixed`, etc.
|
|
64
|
+
- `fileReceiveRootPath`: when mode is `fixed`
|
|
65
|
+
- `fileReceiveMaxBytes`: size cap (`0` = unlimited)
|
|
66
|
+
- `fileInboxSubdir`: subfolder under receive root
|
|
67
|
+
|
|
68
|
+
## Platform attached mode differences
|
|
69
|
+
|
|
70
|
+
| Feature | Standalone | Platform attached |
|
|
71
|
+
| ---------------------------- | --------------------------- | ----------------------------------------------- |
|
|
72
|
+
| `/send` in chat | Direct to messenger on host | Device → platform WebSocket → relay → messenger |
|
|
73
|
+
| Inbound media | Saved locally | Relay forwards bytes; **device** saves locally |
|
|
74
|
+
| `omnish i /sendto` | Local control channel | Same, via platform WebSocket |
|
|
75
|
+
| Allowlists for `wa`/`tg`/`*` | Local config | Platform `GET /v1/me` when credentials set |
|
|
76
|
+
|
|
77
|
+
Explicit `+E164` / `tg:id` always work on both.
|
|
78
|
+
|
|
79
|
+
## Agent workflow: file round-trip test
|
|
80
|
+
|
|
81
|
+
1. Confirm gateway: `omnish status`
|
|
82
|
+
2. In chat cwd, create test file: `!echo test > omnish-file-test.txt`
|
|
83
|
+
3. Send: `/send ./omnish-file-test.txt -- omnish test`
|
|
84
|
+
4. Or CLI: `omnish i -c '/sendto * ./omnish-file-test.txt -- omnish test'`
|
|
85
|
+
5. User confirms receipt on mobile
|
|
86
|
+
|
|
87
|
+
## Troubleshooting
|
|
88
|
+
|
|
89
|
+
- `No files matched` — wrong cwd; use `!pwd` or `!cd`
|
|
90
|
+
- `wa`/`tg`/`*` recipient error — empty allowlist; configure on platform or `omnish allow`
|
|
91
|
+
- File too large — raise `fileSendMaxBytes`; check platform `PLATFORM_REPLY_FILE_MAX_BYTES` if attached
|
|
92
|
+
- File named `--text` — use path `./--text`
|
|
93
|
+
|
|
94
|
+
Full reference: `docs/files-send-receive.md`, `docs/guides/interactive-cli.md`.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Omnish notifications
|
|
2
|
+
|
|
3
|
+
Keep terminal noise local; push **curated briefs** to mobile. Default destination: **`*`** (all allowlisted peers). Works on standalone and platform attached gateways.
|
|
4
|
+
|
|
5
|
+
## Status message format
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
omnish i -c '/sendto * -t <title> -- <brief>'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Message types:
|
|
12
|
+
|
|
13
|
+
| Type | When |
|
|
14
|
+
| ------------ | ------------------------------ |
|
|
15
|
+
| **Ack** | Task accepted |
|
|
16
|
+
| **Progress** | Major phase change (sparingly) |
|
|
17
|
+
| **Question** | Needs human input |
|
|
18
|
+
| **Done** | Finished with outcome |
|
|
19
|
+
| **Blocked** | Failure or dependency |
|
|
20
|
+
|
|
21
|
+
Rules:
|
|
22
|
+
|
|
23
|
+
1. Do not stream raw logs to chat.
|
|
24
|
+
2. One or two sentences; mobile-friendly.
|
|
25
|
+
3. Ask before sending files unless requested.
|
|
26
|
+
4. Include Cursor `conversation_id` when notifying from Cursor agent work.
|
|
27
|
+
|
|
28
|
+
## IDE automatic notifications (Cursor / Claude Code)
|
|
29
|
+
|
|
30
|
+
Install the bundle for your editor:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
omnish agents install cursor # ~/.cursor hooks + skill
|
|
34
|
+
omnish agents install claude # ~/.claude Stop hook + skill
|
|
35
|
+
omnish agents install all # both
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or from repo: `bash contrib/omnish-cursor/install.sh` · `bash contrib/omnish-claude/install.sh`
|
|
39
|
+
|
|
40
|
+
Stop hook sends when agent work is substantive (tools used, real outcome). Skips trivial Q&A and aborted turns.
|
|
41
|
+
|
|
42
|
+
Config `~/.cursor/omnish-notify.json` or `~/.claude/omnish-notify.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"enabled": true,
|
|
47
|
+
"peer": "*",
|
|
48
|
+
"min_assistant_chars": 120,
|
|
49
|
+
"notify_on_error": true,
|
|
50
|
+
"skip_aborted": true,
|
|
51
|
+
"include_full_chat_id": true
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Log: `~/.cursor/hooks/omnish-notify.log`
|
|
56
|
+
|
|
57
|
+
## Manual and agent-driven sends
|
|
58
|
+
|
|
59
|
+
Helper script (from omnish repo root):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bash scripts/agent-notify.sh "Deploy Done" "main branch live; chat abc123"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Uses `OMNISH_PEER_KEY` if set, else `OMNISH_JOB_OWNER_PEER`, else `*`.
|
|
66
|
+
|
|
67
|
+
Env from `/run` and chat agent daemon:
|
|
68
|
+
|
|
69
|
+
| Variable | Purpose |
|
|
70
|
+
| ---------------------------- | ------------------------------------ |
|
|
71
|
+
| `OMNISH_PEER_KEY` | Initiator peer |
|
|
72
|
+
| `OMNISH_NOTIFY_CMD` | Template with `/sendto peer` |
|
|
73
|
+
| `OMNISH_COMMUNICATION_BRIEF` | Guidance when `recipesNotifyEnabled` |
|
|
74
|
+
|
|
75
|
+
For broadcast, omit `OMNISH_PEER_KEY` and use `/sendto *` explicitly.
|
|
76
|
+
|
|
77
|
+
## Chat-native notifications
|
|
78
|
+
|
|
79
|
+
**Background jobs** — notify on completion:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
/bg -N -n deploy git pull && npm run build
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Cowork** — conditional notify:
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
/cowork set backup when failure
|
|
89
|
+
/cowork set heartbeat when state-change
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Board / specialists** — status via same `/sendto` pattern (see `docs/guides/system-agents-and-run.md`).
|
|
93
|
+
|
|
94
|
+
## Test notification
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
omnish i -c '/sendto * -t Omnish Test -- cursor hook ok'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Requires `omnish run` and non-empty allowlist (or platform token routing).
|
|
101
|
+
|
|
102
|
+
## Avoid duplicate pings
|
|
103
|
+
|
|
104
|
+
When Cursor stop hook is installed, agents should not send a second **Done** for the same completion. Use Progress/Question/Blocked during work; let the hook handle final Done unless the user disables hooks.
|
|
105
|
+
|
|
106
|
+
## Troubleshooting
|
|
107
|
+
|
|
108
|
+
| Issue | Check |
|
|
109
|
+
| --------------- | ------------------------------------------- |
|
|
110
|
+
| No message | `omnish status`; gateway running; allowlist |
|
|
111
|
+
| Hook skips | Log file; turn may be trivial or aborted |
|
|
112
|
+
| Wrong recipient | `peer` in `omnish-notify.json` |
|
|
113
|
+
| Platform mode | Token + probe; allowlists on dashboard |
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Omnish setup paths
|
|
2
|
+
|
|
3
|
+
Choose exactly one primary path. All paths end with **`omnish run`** on the machine that executes shell commands.
|
|
4
|
+
|
|
5
|
+
## Platform attached mode (recommended for multi-device)
|
|
6
|
+
|
|
7
|
+
Messengers (WhatsApp/Telegram) link on the **hosted platform**; each device runs `omnish run` with an account token.
|
|
8
|
+
|
|
9
|
+
1. Create account on platform dashboard (e.g. `https://tunnel.omnish.dev/dashboard/`).
|
|
10
|
+
2. Link WhatsApp (QR) and/or Telegram (bot token) on the dashboard; save allowlists there.
|
|
11
|
+
3. On each execution host:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g omnish
|
|
15
|
+
omnish platform login --url https://tunnel.omnish.dev --token YOUR_ACCOUNT_TOKEN
|
|
16
|
+
omnish config show platform # verify URL + token source (masked)
|
|
17
|
+
omnish platform probe # connectivity check
|
|
18
|
+
omnish run # foreground, or: omnish start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
4. From allowlisted chat: `!pwd`, `!help`.
|
|
22
|
+
|
|
23
|
+
**Notes:**
|
|
24
|
+
|
|
25
|
+
- No local `omnish link` required for WhatsApp when fully platform-attached.
|
|
26
|
+
- Files: outbound `/send` and `omnish i /sendto` use device → platform → messenger; inbound media saves on **your device** paths.
|
|
27
|
+
- Docs: `docs/guides/platform-attached-mode.md`, `docs/guides/platform-reference.md`.
|
|
28
|
+
|
|
29
|
+
## Standalone WhatsApp
|
|
30
|
+
|
|
31
|
+
Shell and Baileys session on the same host.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g omnish
|
|
35
|
+
omnish link # scan QR (Linked devices)
|
|
36
|
+
omnish allow +15551234567 # E.164 allowlist
|
|
37
|
+
omnish run
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Private chats only (no groups). Session under data dir `auth/`. Re-link if session missing in `omnish status`.
|
|
41
|
+
|
|
42
|
+
## Standalone Telegram
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g omnish
|
|
46
|
+
omnish link --tg YOUR_BOT_TOKEN
|
|
47
|
+
# message bot /id to learn your tg id, then:
|
|
48
|
+
omnish allow tg:123456789
|
|
49
|
+
omnish run
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Set `gatewayMode` to `telegram` or `both` in config if using both channels.
|
|
53
|
+
|
|
54
|
+
## Background gateway
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
omnish start # background pidfile
|
|
58
|
+
omnish stop
|
|
59
|
+
omnish service install # boot hints (systemd / LaunchAgent / Task Scheduler)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
See `docs/guides/background-and-boot.md`.
|
|
63
|
+
|
|
64
|
+
## Verify any path
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
omnish status
|
|
68
|
+
omnish security --json # optional scriptable audit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
From chat (allowlisted): `!echo omnish-ok`
|
|
72
|
+
|
|
73
|
+
## Common failures
|
|
74
|
+
|
|
75
|
+
| Symptom | Fix |
|
|
76
|
+
| ---------------------------------- | ---------------------------------------------------------------------- |
|
|
77
|
+
| `gateway process: not running` | `omnish run` or `omnish start` |
|
|
78
|
+
| `session: missing` (standalone WA) | `omnish link` |
|
|
79
|
+
| `denied` in logs | Add sender to allowlist; check LID mapping with `omnish run --verbose` |
|
|
80
|
+
| Platform probe fails | Check URL/token; `omnish config show platform` |
|
|
81
|
+
| `/sendto` no delivery | Gateway must run; allowlist non-empty for `*` |
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Remove Omnish Claude Code bundle entries from ~/.claude (keeps unrelated hooks).
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
CLAUDE_DIR="${CLAUDE_DIR:-$HOME/.claude}"
|
|
6
|
+
SETTINGS_JSON="$CLAUDE_DIR/settings.json"
|
|
7
|
+
HOOK_CMD="$CLAUDE_DIR/hooks/omnish-notify.sh"
|
|
8
|
+
|
|
9
|
+
REMOVE_HOOKS=1
|
|
10
|
+
REMOVE_SKILL=1
|
|
11
|
+
REMOVE_CONFIG=0
|
|
12
|
+
|
|
13
|
+
usage() {
|
|
14
|
+
cat <<EOF
|
|
15
|
+
Usage: $(basename "$0") [options]
|
|
16
|
+
|
|
17
|
+
Remove Omnish Claude Code integration installed by install.sh.
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
--hooks-only Remove Stop hook + hook scripts only
|
|
21
|
+
--skill-only Remove ~/.claude/skills/omnish only
|
|
22
|
+
--with-config Also delete ~/.claude/omnish-notify.json
|
|
23
|
+
-h, --help Show this help
|
|
24
|
+
EOF
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
while [[ $# -gt 0 ]]; do
|
|
28
|
+
case "$1" in
|
|
29
|
+
--hooks-only)
|
|
30
|
+
REMOVE_HOOKS=1
|
|
31
|
+
REMOVE_SKILL=0
|
|
32
|
+
shift
|
|
33
|
+
;;
|
|
34
|
+
--skill-only)
|
|
35
|
+
REMOVE_HOOKS=0
|
|
36
|
+
REMOVE_SKILL=1
|
|
37
|
+
shift
|
|
38
|
+
;;
|
|
39
|
+
--with-config)
|
|
40
|
+
REMOVE_CONFIG=1
|
|
41
|
+
shift
|
|
42
|
+
;;
|
|
43
|
+
-h | --help)
|
|
44
|
+
usage
|
|
45
|
+
exit 0
|
|
46
|
+
;;
|
|
47
|
+
*)
|
|
48
|
+
echo "error: unknown option: $1" >&2
|
|
49
|
+
usage >&2
|
|
50
|
+
exit 1
|
|
51
|
+
;;
|
|
52
|
+
esac
|
|
53
|
+
done
|
|
54
|
+
|
|
55
|
+
if [[ "$REMOVE_HOOKS" -eq 1 && -f "$SETTINGS_JSON" ]]; then
|
|
56
|
+
python3 - "$SETTINGS_JSON" "$HOOK_CMD" <<'PY'
|
|
57
|
+
import json
|
|
58
|
+
import sys
|
|
59
|
+
from pathlib import Path
|
|
60
|
+
|
|
61
|
+
settings_path = Path(sys.argv[1])
|
|
62
|
+
hook_cmd = sys.argv[2]
|
|
63
|
+
if not settings_path.is_file():
|
|
64
|
+
raise SystemExit(0)
|
|
65
|
+
data = json.loads(settings_path.read_text(encoding="utf-8"))
|
|
66
|
+
hooks = data.get("hooks") or {}
|
|
67
|
+
existing = hooks.get("Stop") or []
|
|
68
|
+
if not isinstance(existing, list):
|
|
69
|
+
raise SystemExit(0)
|
|
70
|
+
filtered = []
|
|
71
|
+
changed = False
|
|
72
|
+
for group in existing:
|
|
73
|
+
if not isinstance(group, dict):
|
|
74
|
+
filtered.append(group)
|
|
75
|
+
continue
|
|
76
|
+
inner = group.get("hooks") or []
|
|
77
|
+
new_inner = [
|
|
78
|
+
h for h in inner
|
|
79
|
+
if not (isinstance(h, dict) and h.get("command") == hook_cmd)
|
|
80
|
+
]
|
|
81
|
+
if len(new_inner) != len(inner):
|
|
82
|
+
changed = True
|
|
83
|
+
if new_inner:
|
|
84
|
+
group = dict(group)
|
|
85
|
+
group["hooks"] = new_inner
|
|
86
|
+
filtered.append(group)
|
|
87
|
+
if changed:
|
|
88
|
+
if filtered:
|
|
89
|
+
hooks["Stop"] = filtered
|
|
90
|
+
else:
|
|
91
|
+
hooks.pop("Stop", None)
|
|
92
|
+
settings_path.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
|
|
93
|
+
print(f"updated {settings_path} (removed omnish Stop hook)")
|
|
94
|
+
else:
|
|
95
|
+
print(f"no omnish Stop hook in {settings_path}")
|
|
96
|
+
PY
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if [[ "$REMOVE_HOOKS" -eq 1 ]]; then
|
|
100
|
+
rm -f "$CLAUDE_DIR/hooks/omnish-notify.sh" "$CLAUDE_DIR/hooks/omnish-notify.py"
|
|
101
|
+
echo "removed hook scripts"
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
if [[ "$REMOVE_SKILL" -eq 1 ]]; then
|
|
105
|
+
rm -rf "$CLAUDE_DIR/skills/omnish"
|
|
106
|
+
echo "removed $CLAUDE_DIR/skills/omnish"
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
if [[ "$REMOVE_CONFIG" -eq 1 ]]; then
|
|
110
|
+
rm -f "$CLAUDE_DIR/omnish-notify.json"
|
|
111
|
+
echo "removed $CLAUDE_DIR/omnish-notify.json"
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
echo "Done. Restart Claude Code if hooks were removed."
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Omnish Cursor integration
|
|
2
|
+
|
|
3
|
+
Install Omnish in Cursor for file sharing, mobile notifications, and Done briefs when Agent finishes useful work.
|
|
4
|
+
|
|
5
|
+
Works with any Omnish setup:
|
|
6
|
+
|
|
7
|
+
- Local WhatsApp / Telegram (`omnish link`, `omnish run`)
|
|
8
|
+
- Platform attached mode (`platform_url` + `platform_token`, `omnish run`)
|
|
9
|
+
- Mixed allowlists (`wa:+…`, `tg:…`, LID peers)
|
|
10
|
+
|
|
11
|
+
Default notification target is `*` (all allowlisted peers). No channel-specific ids baked in.
|
|
12
|
+
|
|
13
|
+
## Quick install
|
|
14
|
+
|
|
15
|
+
**Offline (bundled with omnish — no omnish.dev):**
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
omnish agents install cursor
|
|
19
|
+
omnish agents install claude
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
From allowlisted chat (when `agentInstallFromChat` is enabled):
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
/agents install cursor
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Online (curl):**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -fsSL https://omnish.dev/downloads/omnish-cursor/install.sh | bash
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
From a local omnish clone:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bash contrib/omnish-cursor/install.sh
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Partial install:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
./install.sh --hooks-only # Cursor hooks + rule + notify config
|
|
44
|
+
./install.sh --skill-only # Cursor skill + doctor script only
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Requires: **Cursor** (hooks), **python3**, **omnish** on `PATH` for hooks install.
|
|
48
|
+
|
|
49
|
+
## What it installs
|
|
50
|
+
|
|
51
|
+
| Path | Purpose |
|
|
52
|
+
| ------------------------------------------- | -------------------------------------- |
|
|
53
|
+
| `~/.cursor/skills/omnish/SKILL.md` | Full setup/usage skill for the agent |
|
|
54
|
+
| `~/.cursor/skills/omnish/scripts/doctor.sh` | Health check script |
|
|
55
|
+
| `~/.cursor/hooks/omnish-notify.py` | Stop-hook logic (smart send / skip) |
|
|
56
|
+
| `~/.cursor/hooks/omnish-notify.sh` | Stop hook wrapper |
|
|
57
|
+
| `~/.cursor/hooks/omnish-session-start.sh` | Injects notify policy each session |
|
|
58
|
+
| `~/.cursor/rules/omnish-notify.mdc` | Always-on agent guidance |
|
|
59
|
+
| `~/.cursor/omnish-notify.json` | Notify config (created if missing) |
|
|
60
|
+
| `~/.cursor/hooks.json` | Merges `sessionStart` + `stop` entries |
|
|
61
|
+
|
|
62
|
+
Restart Cursor after install (or reload **Hooks** in Settings).
|
|
63
|
+
|
|
64
|
+
## Verify
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
bash ~/.cursor/skills/omnish/scripts/doctor.sh
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Test notify (gateway must run):
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
omnish i -c '/sendto * -t Omnish Test -- cursor bundle ok'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Omnish skill
|
|
77
|
+
|
|
78
|
+
The installed skill guides Cursor to:
|
|
79
|
+
|
|
80
|
+
1. Choose setup path (platform / WhatsApp / Telegram)
|
|
81
|
+
2. Configure gateway and allowlists
|
|
82
|
+
3. Use chat commands (`!`, `/bg`, `/apps`, `/run`, `/cowork`)
|
|
83
|
+
4. Share files (`/send`, `/receive`, `omnish i /sendto *`)
|
|
84
|
+
5. Send curated notifications (hooks, manual, `/bg -N`)
|
|
85
|
+
|
|
86
|
+
Reference files live beside the skill: `setup-paths.md`, `files-and-sharing.md`, `notifications.md`.
|
|
87
|
+
|
|
88
|
+
## Notify config (`~/.cursor/omnish-notify.json`)
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"enabled": true,
|
|
93
|
+
"peer": "*",
|
|
94
|
+
"min_assistant_chars": 120,
|
|
95
|
+
"notify_on_error": true,
|
|
96
|
+
"skip_aborted": true,
|
|
97
|
+
"include_full_chat_id": true
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| Key | Default | Meaning |
|
|
102
|
+
| ----------------------- | ------- | ---------------------------------------- |
|
|
103
|
+
| `enabled` | `true` | Master switch |
|
|
104
|
+
| `peer` | `"*"` | `/sendto` destination |
|
|
105
|
+
| `min_assistant_chars` | `120` | Notify on long text-only completions |
|
|
106
|
+
| `notify_on_error` | `true` | Notify when agent ends with error |
|
|
107
|
+
| `skip_aborted` | `true` | Skip user-aborted turns |
|
|
108
|
+
| `include_full_chat_id` | `true` | Full `conversation_id` in brief |
|
|
109
|
+
| `summary_max_chars` | `300` | Outcome summary length in main message |
|
|
110
|
+
| `followup_max_chars` | `1000` | Max chars per follow-up message |
|
|
111
|
+
| `max_followup_messages` | `2` | Extra messages after main brief |
|
|
112
|
+
| `send_followups` | `true` | Send follow-ups for long request/outcome |
|
|
113
|
+
|
|
114
|
+
## When stop-hook notifications send
|
|
115
|
+
|
|
116
|
+
**Send** when the agent turn included real work (file edits, shell, subagents, substantive outcome).
|
|
117
|
+
|
|
118
|
+
**Skip** when aborted or trivial Q&A.
|
|
119
|
+
|
|
120
|
+
Example main brief (newlines render as title + body in chat):
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Cursor Done: Fix auth hooks
|
|
124
|
+
|
|
125
|
+
Status: Done
|
|
126
|
+
Chat: 01866f06-…
|
|
127
|
+
Workspace: omnish
|
|
128
|
+
|
|
129
|
+
You asked:
|
|
130
|
+
Fix notification messaging in cursor hooks and skill
|
|
131
|
+
|
|
132
|
+
Outcome:
|
|
133
|
+
Hook now sends structured multi-line briefs; long content goes in follow-up messages.
|
|
134
|
+
|
|
135
|
+
Tools: 6 action(s)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Delivered as:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
omnish i -c '/sendto * -t Cursor Done: Fix auth hooks -- Status: Done
|
|
142
|
+
Chat: …
|
|
143
|
+
…'
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Long requests or outcomes may add `Cursor · Request` and `Cursor · Outcome` follow-ups.
|
|
147
|
+
|
|
148
|
+
## Prerequisites
|
|
149
|
+
|
|
150
|
+
1. `npm i -g omnish`
|
|
151
|
+
2. Gateway: `omnish run` (or `omnish start`)
|
|
152
|
+
3. Allowlist or platform token configured
|
|
153
|
+
4. Cursor with hooks enabled
|
|
154
|
+
|
|
155
|
+
Platform attached mode: [docs/guides/platform-attached-mode.md](../../docs/guides/platform-attached-mode.md)
|
|
156
|
+
|
|
157
|
+
## Troubleshooting
|
|
158
|
+
|
|
159
|
+
| Issue | Check |
|
|
160
|
+
| ----------------- | ------------------------------------------ |
|
|
161
|
+
| No mobile message | `omnish status`, allowlist, platform token |
|
|
162
|
+
| Hook never runs | Cursor Settings → Hooks; restart Cursor |
|
|
163
|
+
| Always skipped | `~/.cursor/hooks/omnish-notify.log` |
|
|
164
|
+
| Skill not found | `./install.sh --skill-only` |
|
|
165
|
+
|
|
166
|
+
## Uninstall
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
curl -fsSL https://omnish.dev/downloads/omnish-cursor/uninstall.sh | bash
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Or from a downloaded copy: `./uninstall.sh` (add `--with-config` to remove notify json).
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
Same as omnish (MIT). Share freely.
|