@delorenj/claude-notifications 2.0.0 → 2.1.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/DO.md +5 -0
- package/FIXES-APPLIED.md +195 -0
- package/INTEGRATION.md +445 -0
- package/LAYOUT-INTEGRATION.md +191 -0
- package/QUICK-REFERENCE.md +195 -0
- package/README.md +145 -14
- package/TASK.md +15 -0
- package/ZELLIJ-NOTIFY.md +523 -0
- package/_bmad-output/implementation-artifacts/spec-install-multi-cli-hooks.md +241 -0
- package/bin/claude-notifications.js +417 -312
- package/bin/claude-notify.js +47 -1
- package/bin/zellij-notify.js +346 -0
- package/bun.lock +35 -0
- package/diagnose-zellij.sh +105 -0
- package/examples/settings-with-zellij.json +18 -0
- package/examples/settings-zellij-only.json +18 -0
- package/examples/zellij-notify-examples.sh +143 -0
- package/lib/adapters/_stub.js +35 -0
- package/lib/adapters/auggie.js +10 -0
- package/lib/adapters/claude-code.js +181 -0
- package/lib/adapters/codex.js +10 -0
- package/lib/adapters/copilot.js +10 -0
- package/lib/adapters/gemini.js +10 -0
- package/lib/adapters/index.js +240 -0
- package/lib/adapters/kimi.js +10 -0
- package/lib/adapters/opencode.js +14 -0
- package/lib/adapters/vibe.js +10 -0
- package/lib/config.js +44 -8
- package/lib/tui.js +115 -0
- package/lib/zellij.js +248 -0
- package/package.json +6 -4
- package/postinstall.js +28 -25
- package/preuninstall.js +18 -9
- package/test/adapters/claude-code.test.js +144 -0
- package/test/adapters/patches.test.js +81 -0
- package/test/adapters/registry.test.js +89 -0
- package/test/adapters/stubs.test.js +46 -0
- package/test/cli-json.test.js +79 -0
- package/test/helpers/fake-fs.js +59 -0
- package/test-integration.sh +113 -0
- package/test-notification-plugin.kdl +34 -0
- package/test-updated-layout.sh +75 -0
- package/test-zellij-cli.sh +72 -0
- package/zellij-plugin/.cargo/config.toml +5 -0
- package/zellij-plugin/.github/workflows/ci.yml +97 -0
- package/zellij-plugin/Cargo.lock +3558 -0
- package/zellij-plugin/Cargo.toml +40 -0
- package/zellij-plugin/README.md +290 -0
- package/zellij-plugin/build.sh +179 -0
- package/zellij-plugin/configs/examples/accessibility.kdl +31 -0
- package/zellij-plugin/configs/examples/catppuccin.kdl +32 -0
- package/zellij-plugin/configs/examples/default.kdl +34 -0
- package/zellij-plugin/configs/examples/minimal.kdl +22 -0
- package/zellij-plugin/docs/CONFIGURATION.md +191 -0
- package/zellij-plugin/docs/INTEGRATION.md +333 -0
- package/zellij-plugin/src/animation.rs +451 -0
- package/zellij-plugin/src/colors.rs +407 -0
- package/zellij-plugin/src/config.rs +664 -0
- package/zellij-plugin/src/event_bridge.rs +339 -0
- package/zellij-plugin/src/main.rs +420 -0
- package/zellij-plugin/src/notification.rs +466 -0
- package/zellij-plugin/src/queue.rs +399 -0
- package/zellij-plugin/src/renderer.rs +477 -0
- package/zellij-plugin/src/state.rs +338 -0
- package/zellij-plugin/src/tests.rs +413 -0
- package/.claude/checkpoints/1756392335.json +0 -1
- package/.claude/checkpoints/1756392341.json +0 -1
- package/.claude/checkpoints/1756392347.json +0 -1
- package/.claude/checkpoints/1756392376.json +0 -1
- package/.claude/checkpoints/1756392377.json +0 -1
- package/.claude/checkpoints/1756392386.json +0 -1
- package/.claude/checkpoints/1756392387.json +0 -1
- package/.claude/checkpoints/1756392398.json +0 -1
- package/.claude/checkpoints/1756392400.json +0 -1
- package/.claude/checkpoints/1756392427.json +0 -1
- package/.claude/checkpoints/1756392428.json +0 -1
- package/.claude/checkpoints/1756392486.json +0 -1
- package/.claude/checkpoints/1756392488.json +0 -1
- package/.claude/checkpoints/1756392558.json +0 -1
- package/.claude/checkpoints/1756392559.json +0 -1
- package/.claude/checkpoints/summary-session-20250828-105040.md +0 -57
- package/.claude/checkpoints/task-1756392207.json +0 -1
- package/.claude/checkpoints/task-1756392742.json +0 -1
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
- package/.claude/commands/analysis/README.md +0 -9
- package/.claude/commands/analysis/bottleneck-detect.md +0 -162
- package/.claude/commands/analysis/performance-bottlenecks.md +0 -59
- package/.claude/commands/analysis/performance-report.md +0 -25
- package/.claude/commands/analysis/token-efficiency.md +0 -45
- package/.claude/commands/analysis/token-usage.md +0 -25
- package/.claude/commands/automation/README.md +0 -9
- package/.claude/commands/automation/auto-agent.md +0 -122
- package/.claude/commands/automation/self-healing.md +0 -106
- package/.claude/commands/automation/session-memory.md +0 -90
- package/.claude/commands/automation/smart-agents.md +0 -73
- package/.claude/commands/automation/smart-spawn.md +0 -25
- package/.claude/commands/automation/workflow-select.md +0 -25
- package/.claude/commands/coordination/README.md +0 -9
- package/.claude/commands/coordination/agent-spawn.md +0 -25
- package/.claude/commands/coordination/init.md +0 -44
- package/.claude/commands/coordination/orchestrate.md +0 -43
- package/.claude/commands/coordination/spawn.md +0 -45
- package/.claude/commands/coordination/swarm-init.md +0 -85
- package/.claude/commands/coordination/task-orchestrate.md +0 -25
- package/.claude/commands/github/README.md +0 -11
- package/.claude/commands/github/code-review-swarm.md +0 -514
- package/.claude/commands/github/code-review.md +0 -25
- package/.claude/commands/github/github-modes.md +0 -147
- package/.claude/commands/github/github-swarm.md +0 -121
- package/.claude/commands/github/issue-tracker.md +0 -292
- package/.claude/commands/github/issue-triage.md +0 -25
- package/.claude/commands/github/multi-repo-swarm.md +0 -519
- package/.claude/commands/github/pr-enhance.md +0 -26
- package/.claude/commands/github/pr-manager.md +0 -170
- package/.claude/commands/github/project-board-sync.md +0 -471
- package/.claude/commands/github/release-manager.md +0 -338
- package/.claude/commands/github/release-swarm.md +0 -544
- package/.claude/commands/github/repo-analyze.md +0 -25
- package/.claude/commands/github/repo-architect.md +0 -367
- package/.claude/commands/github/swarm-issue.md +0 -482
- package/.claude/commands/github/swarm-pr.md +0 -285
- package/.claude/commands/github/sync-coordinator.md +0 -301
- package/.claude/commands/github/workflow-automation.md +0 -442
- package/.claude/commands/hooks/README.md +0 -11
- package/.claude/commands/hooks/overview.md +0 -58
- package/.claude/commands/hooks/post-edit.md +0 -117
- package/.claude/commands/hooks/post-task.md +0 -112
- package/.claude/commands/hooks/pre-edit.md +0 -113
- package/.claude/commands/hooks/pre-task.md +0 -111
- package/.claude/commands/hooks/session-end.md +0 -118
- package/.claude/commands/hooks/setup.md +0 -103
- package/.claude/commands/memory/README.md +0 -9
- package/.claude/commands/memory/memory-persist.md +0 -25
- package/.claude/commands/memory/memory-search.md +0 -25
- package/.claude/commands/memory/memory-usage.md +0 -25
- package/.claude/commands/memory/neural.md +0 -47
- package/.claude/commands/memory/usage.md +0 -46
- package/.claude/commands/monitoring/README.md +0 -9
- package/.claude/commands/monitoring/agent-metrics.md +0 -25
- package/.claude/commands/monitoring/agents.md +0 -44
- package/.claude/commands/monitoring/real-time-view.md +0 -25
- package/.claude/commands/monitoring/status.md +0 -46
- package/.claude/commands/monitoring/swarm-monitor.md +0 -25
- package/.claude/commands/optimization/README.md +0 -9
- package/.claude/commands/optimization/auto-topology.md +0 -62
- package/.claude/commands/optimization/cache-manage.md +0 -25
- package/.claude/commands/optimization/parallel-execute.md +0 -25
- package/.claude/commands/optimization/parallel-execution.md +0 -50
- package/.claude/commands/optimization/topology-optimize.md +0 -25
- package/.claude/commands/pair/README.md +0 -261
- package/.claude/commands/pair/commands.md +0 -546
- package/.claude/commands/pair/config.md +0 -510
- package/.claude/commands/pair/examples.md +0 -512
- package/.claude/commands/pair/modes.md +0 -348
- package/.claude/commands/pair/session.md +0 -407
- package/.claude/commands/pair/start.md +0 -209
- package/.claude/commands/sparc/analyzer.md +0 -52
- package/.claude/commands/sparc/architect.md +0 -53
- package/.claude/commands/sparc/batch-executor.md +0 -54
- package/.claude/commands/sparc/coder.md +0 -54
- package/.claude/commands/sparc/debugger.md +0 -54
- package/.claude/commands/sparc/designer.md +0 -53
- package/.claude/commands/sparc/documenter.md +0 -54
- package/.claude/commands/sparc/innovator.md +0 -54
- package/.claude/commands/sparc/memory-manager.md +0 -54
- package/.claude/commands/sparc/optimizer.md +0 -54
- package/.claude/commands/sparc/orchestrator.md +0 -132
- package/.claude/commands/sparc/researcher.md +0 -54
- package/.claude/commands/sparc/reviewer.md +0 -54
- package/.claude/commands/sparc/sparc-modes.md +0 -174
- package/.claude/commands/sparc/swarm-coordinator.md +0 -54
- package/.claude/commands/sparc/tdd.md +0 -54
- package/.claude/commands/sparc/tester.md +0 -54
- package/.claude/commands/sparc/workflow-manager.md +0 -54
- package/.claude/commands/stream-chain/pipeline.md +0 -121
- package/.claude/commands/stream-chain/run.md +0 -70
- package/.claude/commands/swarm/analysis.md +0 -95
- package/.claude/commands/swarm/development.md +0 -96
- package/.claude/commands/swarm/examples.md +0 -168
- package/.claude/commands/swarm/maintenance.md +0 -102
- package/.claude/commands/swarm/optimization.md +0 -117
- package/.claude/commands/swarm/research.md +0 -136
- package/.claude/commands/swarm/testing.md +0 -131
- package/.claude/commands/training/README.md +0 -9
- package/.claude/commands/training/model-update.md +0 -25
- package/.claude/commands/training/neural-patterns.md +0 -74
- package/.claude/commands/training/neural-train.md +0 -25
- package/.claude/commands/training/pattern-learn.md +0 -25
- package/.claude/commands/training/specialization.md +0 -63
- package/.claude/commands/truth/start.md +0 -143
- package/.claude/commands/verify/check.md +0 -50
- package/.claude/commands/verify/start.md +0 -128
- package/.claude/commands/workflows/README.md +0 -9
- package/.claude/commands/workflows/development.md +0 -78
- package/.claude/commands/workflows/research.md +0 -63
- package/.claude/commands/workflows/workflow-create.md +0 -25
- package/.claude/commands/workflows/workflow-execute.md +0 -25
- package/.claude/commands/workflows/workflow-export.md +0 -25
- package/.claude/config.json +0 -36
- package/.claude/settings.json +0 -162
- package/.claude-flow/metrics/agent-metrics.json +0 -1
- package/.claude-flow/metrics/performance.json +0 -9
- package/.claude-flow/metrics/system-metrics.json +0 -230
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/FIXES.md +0 -75
- package/test-results.md +0 -163
package/ZELLIJ-NOTIFY.md
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
# zellij-notify CLI
|
|
2
|
+
|
|
3
|
+
A powerful command-line tool for sending visual notifications to Zellij tabs and panes.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Basic notification
|
|
9
|
+
zellij-notify "Build complete!"
|
|
10
|
+
|
|
11
|
+
# Success notification with title
|
|
12
|
+
zellij-notify -t success --title "Tests" "All tests passed"
|
|
13
|
+
|
|
14
|
+
# Error to specific tab
|
|
15
|
+
zellij-notify -n "Backend" -t error "Server crashed"
|
|
16
|
+
|
|
17
|
+
# Quick disappearing message (5 seconds)
|
|
18
|
+
zellij-notify -q "Starting deployment..."
|
|
19
|
+
|
|
20
|
+
# Dismissable alert (stays until Ctrl+N)
|
|
21
|
+
zellij-notify -d -t error -p critical "PRODUCTION DOWN"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
The CLI is installed automatically with `@delorenj/claude-notifications`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g @delorenj/claude-notifications
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This provides three commands:
|
|
33
|
+
- `claude-notify` - Trigger Claude Code notifications
|
|
34
|
+
- `zellij-notify` - Send notifications to Zellij (this tool)
|
|
35
|
+
- `claude-notifications` - Package management
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
zellij-notify [OPTIONS] <MESSAGE>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Arguments
|
|
44
|
+
|
|
45
|
+
- `<MESSAGE>` - The notification message to display (required)
|
|
46
|
+
|
|
47
|
+
### Options
|
|
48
|
+
|
|
49
|
+
#### Tab Targeting
|
|
50
|
+
|
|
51
|
+
| Option | Description |
|
|
52
|
+
|--------|-------------|
|
|
53
|
+
| `-n, --tab-name <NAME>` | Target tab by name |
|
|
54
|
+
| `-i, --tab-index <INDEX>` | Target tab by 1-based index (1, 2, 3, ...) |
|
|
55
|
+
| `-a, --all` | Send to all tabs |
|
|
56
|
+
|
|
57
|
+
#### Notification Appearance
|
|
58
|
+
|
|
59
|
+
| Option | Description |
|
|
60
|
+
|--------|-------------|
|
|
61
|
+
| `-t, --type <TYPE>` | Notification type: `success`, `error`, `warning`, `info`, `attention`, `progress` (default: `info`) |
|
|
62
|
+
| `-p, --priority <PRIORITY>` | Priority: `low`, `normal`, `high`, `critical` (default: `normal`) |
|
|
63
|
+
| `--title <TITLE>` | Notification title (default: "Notification") |
|
|
64
|
+
|
|
65
|
+
#### Duration & Dismissal
|
|
66
|
+
|
|
67
|
+
| Option | Description |
|
|
68
|
+
|--------|-------------|
|
|
69
|
+
| `--ttl <SECONDS>` | Auto-dismiss after N seconds (default: 300 / 5 minutes) |
|
|
70
|
+
| `-d, --dismissable` | Require manual dismissal with Ctrl+N (overrides TTL) |
|
|
71
|
+
| `-q, --quick` | Quick notification (5 seconds, equivalent to `--ttl 5`) |
|
|
72
|
+
|
|
73
|
+
#### Other
|
|
74
|
+
|
|
75
|
+
| Option | Description |
|
|
76
|
+
|--------|-------------|
|
|
77
|
+
| `--plugin <NAME>` | Plugin name (default: `zellij_visual_notifications`) |
|
|
78
|
+
| `-l, --list-tabs` | List all tabs and exit |
|
|
79
|
+
| `-h, --help` | Show help message |
|
|
80
|
+
|
|
81
|
+
## Notification Types
|
|
82
|
+
|
|
83
|
+
| Type | Color | Icon | Use Case |
|
|
84
|
+
|------|-------|------|----------|
|
|
85
|
+
| `success` | Green | ✅ | Task completed, tests passed, deployment succeeded |
|
|
86
|
+
| `error` | Red | ❌ | Build failed, errors occurred, operation failed |
|
|
87
|
+
| `warning` | Yellow | ⚠️ | Warnings, deprecated APIs, non-critical issues |
|
|
88
|
+
| `info` | Blue | ℹ️ | General information, status updates |
|
|
89
|
+
| `attention` | Purple | 👁️ | Needs your attention (default for Claude waiting) |
|
|
90
|
+
| `progress` | Cyan | 🔄 | Long-running task in progress |
|
|
91
|
+
|
|
92
|
+
## Priority Levels
|
|
93
|
+
|
|
94
|
+
| Priority | Behavior |
|
|
95
|
+
|----------|----------|
|
|
96
|
+
| `low` | Background notification, subtle |
|
|
97
|
+
| `normal` | Standard notification (default) |
|
|
98
|
+
| `high` | Demands attention, shown prominently |
|
|
99
|
+
| `critical` | Urgent, highest priority in queue |
|
|
100
|
+
|
|
101
|
+
## Examples
|
|
102
|
+
|
|
103
|
+
### Basic Usage
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Simple notification to current tab
|
|
107
|
+
zellij-notify "Hello from zellij-notify!"
|
|
108
|
+
|
|
109
|
+
# With notification type
|
|
110
|
+
zellij-notify -t success "Build completed successfully"
|
|
111
|
+
|
|
112
|
+
# With type and priority
|
|
113
|
+
zellij-notify -t error -p high "Critical error in production"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Tab Targeting
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# List all tabs first
|
|
120
|
+
zellij-notify --list-tabs
|
|
121
|
+
|
|
122
|
+
# Send to specific tab by index (1-based)
|
|
123
|
+
zellij-notify -i 1 "Message for first tab"
|
|
124
|
+
zellij-notify -i 2 "Message for second tab"
|
|
125
|
+
|
|
126
|
+
# Send to tab by name
|
|
127
|
+
zellij-notify -n "Backend" "Server restarted"
|
|
128
|
+
zellij-notify -n "Frontend" "Hot reload complete"
|
|
129
|
+
|
|
130
|
+
# Broadcast to all tabs
|
|
131
|
+
zellij-notify -a "System maintenance in 5 minutes"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Duration Control
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Quick 5-second notification
|
|
138
|
+
zellij-notify -q "Starting task..."
|
|
139
|
+
|
|
140
|
+
# Custom 30-second TTL
|
|
141
|
+
zellij-notify --ttl 30 "Deployment in progress"
|
|
142
|
+
|
|
143
|
+
# 1-minute notification
|
|
144
|
+
zellij-notify --ttl 60 -t info "Build running..."
|
|
145
|
+
|
|
146
|
+
# Dismissable (stays until Ctrl+N)
|
|
147
|
+
zellij-notify -d -t attention "Please review pull request"
|
|
148
|
+
|
|
149
|
+
# Critical dismissable alert
|
|
150
|
+
zellij-notify -d -t error -p critical "DATABASE CONNECTION LOST"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Real-World Scenarios
|
|
154
|
+
|
|
155
|
+
#### Build Notifications
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Starting
|
|
159
|
+
zellij-notify -t progress -q "Building project..."
|
|
160
|
+
|
|
161
|
+
# Success
|
|
162
|
+
zellij-notify -t success --title "Build" "Build completed in 42s"
|
|
163
|
+
|
|
164
|
+
# Failure
|
|
165
|
+
zellij-notify -t error --title "Build Failed" "Syntax error on line 123"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### Test Results
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Running tests
|
|
172
|
+
zellij-notify -t progress --title "Tests" "Running test suite..."
|
|
173
|
+
|
|
174
|
+
# Success
|
|
175
|
+
zellij-notify -t success --title "Tests" "All 157 tests passed ✅"
|
|
176
|
+
|
|
177
|
+
# Failure
|
|
178
|
+
zellij-notify -t error --title "Tests" "3 tests failed ❌"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Deployment Pipeline
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Start
|
|
185
|
+
zellij-notify -t info "Deployment started"
|
|
186
|
+
|
|
187
|
+
# Progress updates (to all tabs)
|
|
188
|
+
zellij-notify -a -t progress "Building Docker image..."
|
|
189
|
+
sleep 30
|
|
190
|
+
zellij-notify -a -t progress "Pushing to registry..."
|
|
191
|
+
sleep 20
|
|
192
|
+
zellij-notify -a -t progress "Deploying to production..."
|
|
193
|
+
sleep 15
|
|
194
|
+
|
|
195
|
+
# Complete
|
|
196
|
+
zellij-notify -a -t success -p high "🚀 Deployed to production!"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Long-Running Tasks
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Start task
|
|
203
|
+
zellij-notify -t progress "Analyzing 10,000 files..."
|
|
204
|
+
|
|
205
|
+
# Completion notification (dismissable, requires acknowledgment)
|
|
206
|
+
zellij-notify -d -t success --title "Analysis Complete" \
|
|
207
|
+
"Found 42 issues. Review required."
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### Multi-Tab Workflow
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# Terminal 1 (tab 1): Backend development
|
|
214
|
+
zellij-notify -i 1 -t info "Backend: Hot reload ready"
|
|
215
|
+
|
|
216
|
+
# Terminal 2 (tab 2): Frontend development
|
|
217
|
+
zellij-notify -i 2 -t info "Frontend: Dev server running on :3000"
|
|
218
|
+
|
|
219
|
+
# Terminal 3 (tab 3): Database
|
|
220
|
+
zellij-notify -i 3 -t warning "Database: Migration pending"
|
|
221
|
+
|
|
222
|
+
# Broadcast to all when done
|
|
223
|
+
zellij-notify -a -t success "All services ready 🎉"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### Error Alerts
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Low priority (logged, not urgent)
|
|
230
|
+
zellij-notify -t warning -p low "Cache miss rate high"
|
|
231
|
+
|
|
232
|
+
# Normal priority
|
|
233
|
+
zellij-notify -t warning "API rate limit: 80% used"
|
|
234
|
+
|
|
235
|
+
# High priority (demands attention)
|
|
236
|
+
zellij-notify -t error -p high "Database slow query detected"
|
|
237
|
+
|
|
238
|
+
# Critical (requires immediate action)
|
|
239
|
+
zellij-notify -d -t error -p critical "DISK SPACE: 95% FULL"
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Scripting & Automation
|
|
243
|
+
|
|
244
|
+
### Build Script Integration
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
#!/bin/bash
|
|
248
|
+
# build.sh
|
|
249
|
+
|
|
250
|
+
zellij-notify -t info "Build started..."
|
|
251
|
+
|
|
252
|
+
if npm run build; then
|
|
253
|
+
zellij-notify -t success --title "Build" "Build completed successfully"
|
|
254
|
+
else
|
|
255
|
+
zellij-notify -d -t error --title "Build Failed" "Check logs for details"
|
|
256
|
+
exit 1
|
|
257
|
+
fi
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Test Runner Integration
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
#!/bin/bash
|
|
264
|
+
# test.sh
|
|
265
|
+
|
|
266
|
+
zellij-notify -t progress "Running tests..."
|
|
267
|
+
|
|
268
|
+
TEST_OUTPUT=$(npm test 2>&1)
|
|
269
|
+
TEST_EXIT=$?
|
|
270
|
+
|
|
271
|
+
if [ $TEST_EXIT -eq 0 ]; then
|
|
272
|
+
PASSED=$(echo "$TEST_OUTPUT" | grep -o '[0-9]* passed' | grep -o '[0-9]*')
|
|
273
|
+
zellij-notify -t success --title "Tests" "$PASSED tests passed"
|
|
274
|
+
else
|
|
275
|
+
FAILED=$(echo "$TEST_OUTPUT" | grep -o '[0-9]* failed' | grep -o '[0-9]*')
|
|
276
|
+
zellij-notify -d -t error --title "Tests Failed" "$FAILED tests failed"
|
|
277
|
+
exit 1
|
|
278
|
+
fi
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Git Hook Integration
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# .git/hooks/pre-push
|
|
285
|
+
|
|
286
|
+
#!/bin/bash
|
|
287
|
+
# Run tests before push
|
|
288
|
+
|
|
289
|
+
zellij-notify -q "Running pre-push tests..."
|
|
290
|
+
|
|
291
|
+
if npm test; then
|
|
292
|
+
zellij-notify -t success -q "Tests passed, pushing..."
|
|
293
|
+
exit 0
|
|
294
|
+
else
|
|
295
|
+
zellij-notify -d -t error -p critical "Tests failed! Push blocked."
|
|
296
|
+
exit 1
|
|
297
|
+
fi
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Watch Script
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
#!/bin/bash
|
|
304
|
+
# watch-and-notify.sh
|
|
305
|
+
|
|
306
|
+
while inotifywait -r -e modify,create,delete ./src; do
|
|
307
|
+
zellij-notify -q "Files changed, rebuilding..."
|
|
308
|
+
|
|
309
|
+
if make build; then
|
|
310
|
+
zellij-notify -t success -q "Build complete"
|
|
311
|
+
else
|
|
312
|
+
zellij-notify -t error --ttl 10 "Build failed"
|
|
313
|
+
fi
|
|
314
|
+
done
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Cron Job Notifications
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# In your cron job
|
|
321
|
+
0 2 * * * /path/to/backup.sh && \
|
|
322
|
+
ZELLIJ=0 zellij-notify -t success "Backup completed" || \
|
|
323
|
+
ZELLIJ=0 zellij-notify -d -t error "Backup failed"
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Integration with Other Tools
|
|
327
|
+
|
|
328
|
+
### Make Integration
|
|
329
|
+
|
|
330
|
+
```makefile
|
|
331
|
+
# Makefile
|
|
332
|
+
|
|
333
|
+
.PHONY: build test deploy
|
|
334
|
+
|
|
335
|
+
build:
|
|
336
|
+
@zellij-notify -t info "Building..."
|
|
337
|
+
@npm run build && \
|
|
338
|
+
zellij-notify -t success "Build complete" || \
|
|
339
|
+
zellij-notify -t error "Build failed"
|
|
340
|
+
|
|
341
|
+
test:
|
|
342
|
+
@zellij-notify -t progress "Running tests..."
|
|
343
|
+
@npm test && \
|
|
344
|
+
zellij-notify -t success "Tests passed" || \
|
|
345
|
+
zellij-notify -d -t error "Tests failed"
|
|
346
|
+
|
|
347
|
+
deploy:
|
|
348
|
+
@zellij-notify -a -t info "Starting deployment..."
|
|
349
|
+
@./deploy.sh && \
|
|
350
|
+
zellij-notify -a -t success -p high "Deployed!" || \
|
|
351
|
+
zellij-notify -a -d -t error -p critical "Deploy failed!"
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Docker Compose
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# After docker-compose up
|
|
358
|
+
docker-compose up -d && \
|
|
359
|
+
zellij-notify -t success "Containers started" || \
|
|
360
|
+
zellij-notify -t error "Container startup failed"
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### CI/CD Integration
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# In your CI/CD pipeline
|
|
367
|
+
if [ "$CI" = "true" ]; then
|
|
368
|
+
# Use webhook instead
|
|
369
|
+
curl -X POST https://your-webhook.com/notify
|
|
370
|
+
else
|
|
371
|
+
# Local development - use zellij-notify
|
|
372
|
+
zellij-notify -t success "Pipeline passed"
|
|
373
|
+
fi
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## Tips & Best Practices
|
|
377
|
+
|
|
378
|
+
### 1. Use Appropriate Types
|
|
379
|
+
|
|
380
|
+
Match notification types to the situation:
|
|
381
|
+
- `info` for status updates
|
|
382
|
+
- `progress` for long-running tasks
|
|
383
|
+
- `success` for completed operations
|
|
384
|
+
- `warning` for non-critical issues
|
|
385
|
+
- `error` for failures
|
|
386
|
+
- `attention` for items requiring user action
|
|
387
|
+
|
|
388
|
+
### 2. Set Appropriate TTLs
|
|
389
|
+
|
|
390
|
+
- Quick operations: `-q` (5 seconds)
|
|
391
|
+
- Progress updates: `--ttl 10-30`
|
|
392
|
+
- Completed tasks: Default (300 seconds)
|
|
393
|
+
- Requires action: `-d` (dismissable)
|
|
394
|
+
|
|
395
|
+
### 3. Use Priorities Wisely
|
|
396
|
+
|
|
397
|
+
- `low` - Logged events, debug info
|
|
398
|
+
- `normal` - Standard notifications (default)
|
|
399
|
+
- `high` - Important events, errors
|
|
400
|
+
- `critical` - System failures, requires immediate action
|
|
401
|
+
|
|
402
|
+
### 4. Tab Targeting Strategy
|
|
403
|
+
|
|
404
|
+
- Current tab: Default, most operations
|
|
405
|
+
- Specific tab: When operation affects specific service
|
|
406
|
+
- All tabs: System-wide events, shutdowns, critical alerts
|
|
407
|
+
|
|
408
|
+
### 5. Chain Notifications
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
zellij-notify -q "Starting..." && \
|
|
412
|
+
long_task && \
|
|
413
|
+
zellij-notify -t success "Done!" || \
|
|
414
|
+
zellij-notify -t error "Failed!"
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
## Troubleshooting
|
|
418
|
+
|
|
419
|
+
### "Not in a Zellij session"
|
|
420
|
+
|
|
421
|
+
You must run `zellij-notify` from inside a Zellij session:
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
# Start Zellij first
|
|
425
|
+
zellij
|
|
426
|
+
|
|
427
|
+
# Then use zellij-notify
|
|
428
|
+
zellij-notify "Test"
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### "Tab not found"
|
|
432
|
+
|
|
433
|
+
List available tabs:
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
zellij-notify --list-tabs
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Then use the correct index or name.
|
|
440
|
+
|
|
441
|
+
### "Failed to send notification"
|
|
442
|
+
|
|
443
|
+
1. Check plugin is loaded:
|
|
444
|
+
```bash
|
|
445
|
+
ls -lh ~/.config/zellij/plugins/zellij_visual_notifications.wasm
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
2. Verify plugin is in your layout
|
|
449
|
+
|
|
450
|
+
3. Test direct pipe:
|
|
451
|
+
```bash
|
|
452
|
+
zellij pipe -p zellij_visual_notifications -- '{"type":"info","message":"test"}'
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### Notifications not appearing
|
|
456
|
+
|
|
457
|
+
1. Check plugin configuration in layout
|
|
458
|
+
2. Ensure `enabled true` in plugin config
|
|
459
|
+
3. Restart Zellij session
|
|
460
|
+
4. Check plugin logs (if available)
|
|
461
|
+
|
|
462
|
+
## Advanced Usage
|
|
463
|
+
|
|
464
|
+
### Custom Plugin Name
|
|
465
|
+
|
|
466
|
+
If you've renamed the plugin:
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
zellij-notify --plugin my_custom_plugin "Message"
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Programmatic Usage
|
|
473
|
+
|
|
474
|
+
```javascript
|
|
475
|
+
const { sendNotification } = require('@delorenj/claude-notifications/lib/zellij');
|
|
476
|
+
|
|
477
|
+
sendNotification({
|
|
478
|
+
type: 'success',
|
|
479
|
+
message: 'Task complete',
|
|
480
|
+
priority: 'high',
|
|
481
|
+
ttl: 30000 // milliseconds
|
|
482
|
+
});
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### Environment Variables
|
|
486
|
+
|
|
487
|
+
You can set defaults via environment:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
export ZELLIJ_NOTIFY_TYPE=success
|
|
491
|
+
export ZELLIJ_NOTIFY_PRIORITY=high
|
|
492
|
+
|
|
493
|
+
zellij-notify "Will use env defaults"
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
## Comparison with Other Notification Methods
|
|
497
|
+
|
|
498
|
+
| Method | Pros | Cons |
|
|
499
|
+
|--------|------|------|
|
|
500
|
+
| `zellij-notify` | Visual, in-context, non-disruptive | Requires Zellij, visual only |
|
|
501
|
+
| `claude-notify` | Audio + Visual, works everywhere | May be disruptive |
|
|
502
|
+
| `notify-send` | System-level, standard | Requires desktop environment |
|
|
503
|
+
| Desktop apps | Rich UI, persistent | Not terminal-integrated |
|
|
504
|
+
| Webhooks | Remote notifications | Requires network, setup |
|
|
505
|
+
|
|
506
|
+
## See Also
|
|
507
|
+
|
|
508
|
+
- [claude-notify](README.md) - Audio + visual notifications for Claude Code
|
|
509
|
+
- [Zellij documentation](https://zellij.dev/)
|
|
510
|
+
- [Visual notifications plugin](./zellij-plugin/)
|
|
511
|
+
|
|
512
|
+
## License
|
|
513
|
+
|
|
514
|
+
MIT License - Same as @delorenj/claude-notifications
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
**Ready to supercharge your Zellij workflow?**
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
npm install -g @delorenj/claude-notifications
|
|
522
|
+
zellij-notify "Let's go! 🚀"
|
|
523
|
+
```
|