add tmux session detection and spiceflow links
- Detect tmux session name when running inside tmux - Add spiceflow-url config option for session links in notifications - Include clickable "Open in Spiceflow" link in Discord messages - Add `iamwaiting status` command to show full configuration - Separate toggle status from configuration display - Update installation docs to use symlink instead of bbin Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,9 +16,10 @@ The tool integrates with Claude Code's hook system to send real-time notificatio
|
||||
|
||||
The entire implementation is a single Babashka script (`iamwaiting`) with these key functions:
|
||||
|
||||
- `load-config` - Loads webhook URL and toggles from config file or environment variable
|
||||
- `load-config` - Loads webhook URL, toggles, and Spiceflow URL from config file or environment variables
|
||||
- `send-discord-webhook` - Makes HTTP POST request to Discord webhook API
|
||||
- `format-waiting-message` - Formats the notification message with project context
|
||||
- `get-tmux-session` - Detects current tmux session name (if running inside tmux)
|
||||
- `format-waiting-message` - Formats the notification message with project context, tmux session, and Spiceflow link
|
||||
- `setup-config` - Interactive setup wizard for webhook configuration
|
||||
- `test-webhook` - Sends a test message to verify configuration
|
||||
- `send-waiting-notification` - Main function that sends the notification (respects toggles)
|
||||
@@ -33,6 +34,7 @@ Configuration is stored in `~/.iamwaiting/config.edn` with the following structu
|
||||
```clojure
|
||||
{:webhook-url "https://discord.com/api/webhooks/..."
|
||||
:user-id "123456789012345678" ; Optional: Discord user ID for @mentions
|
||||
:spiceflow-url "https://hostname:5173" ; Optional: Spiceflow URL for session links
|
||||
:toggles {:idle-prompt true ; Enable idle prompt notifications
|
||||
:permission-prompt true ; Enable permission prompt notifications
|
||||
:permission-prompt-ping true}} ; Enable @mentions on permission prompts
|
||||
@@ -41,6 +43,7 @@ Configuration is stored in `~/.iamwaiting/config.edn` with the following structu
|
||||
Alternatively, configuration can be set via environment variables:
|
||||
- `IAMWAITING_WEBHOOK_URL` - Discord webhook URL (required)
|
||||
- `IAMWAITING_USER_ID` - Discord user ID for @mentions (optional)
|
||||
- `IAMWAITING_SPICEFLOW_URL` - Spiceflow base URL for session links (optional)
|
||||
|
||||
### Notification Toggles
|
||||
|
||||
@@ -96,13 +99,13 @@ The `:permission-prompt-ping` toggle controls whether you get @mentioned (pinged
|
||||
|
||||
## Installation
|
||||
|
||||
Install via bbin (recommended):
|
||||
Install via symlink (recommended):
|
||||
|
||||
```bash
|
||||
bbin install git@git.ajet.fyi:ajet-industries/iamwaiting.git
|
||||
ln -s /path/to/repos/iamwaiting/iamwaiting ~/.local/bin/iamwaiting
|
||||
```
|
||||
|
||||
This installs `iamwaiting` to `~/.local/bin/iamwaiting` (ensure `~/.local/bin` is in your PATH).
|
||||
This creates a symlink at `~/.local/bin/iamwaiting` pointing to the script (ensure `~/.local/bin` is in your PATH). Using a symlink means changes to the script are immediately available without reinstalling.
|
||||
|
||||
## Common Commands
|
||||
|
||||
@@ -116,6 +119,9 @@ iamwaiting setup
|
||||
|
||||
# Test the webhook configuration
|
||||
iamwaiting test
|
||||
|
||||
# Show current configuration
|
||||
iamwaiting status
|
||||
```
|
||||
|
||||
### Usage
|
||||
@@ -198,13 +204,17 @@ The tool uses Discord's webhook API which requires:
|
||||
Notifications include:
|
||||
- ⏳ Waiting indicator
|
||||
- 📁 Current working directory / project name
|
||||
- 🖥️ Tmux session name (if running inside tmux)
|
||||
- 🔗 Spiceflow session link (if Spiceflow URL configured and running in tmux)
|
||||
- 🕐 Timestamp (HH:mm:ss format)
|
||||
- @mention (if user ID is configured, it's a permission prompt, and ping toggle is enabled)
|
||||
|
||||
Example message (idle prompt):
|
||||
Example message (with Spiceflow link):
|
||||
```
|
||||
⏳ **Claude is waiting** in `ajet-industries`
|
||||
📁 Path: `/home/user/repos/ajet-industries`
|
||||
🖥️ Tmux: `spiceflow-bold-sun-9841`
|
||||
🔗 **[Open in Spiceflow](https://hostname:5173/session/spiceflow-bold-sun-9841)**
|
||||
🕐 Time: 14:23:45
|
||||
```
|
||||
|
||||
@@ -212,16 +222,17 @@ Example message (permission prompt with ping enabled):
|
||||
```
|
||||
<@123456789012345678> ⏳ **Claude is waiting** in `ajet-industries`
|
||||
📁 Path: `/home/user/repos/ajet-industries`
|
||||
🖥️ Tmux: `spiceflow-bold-sun-9841`
|
||||
🔗 **[Open in Spiceflow](https://hostname:5173/session/spiceflow-bold-sun-9841)**
|
||||
🕐 Time: 14:23:45
|
||||
📢 Type: `permission_prompt`
|
||||
```
|
||||
|
||||
Example message (permission prompt with ping disabled):
|
||||
Example message (without tmux/Spiceflow):
|
||||
```
|
||||
⏳ **Claude is waiting** in `ajet-industries`
|
||||
📁 Path: `/home/user/repos/ajet-industries`
|
||||
🕐 Time: 14:23:45
|
||||
📢 Type: `permission_prompt`
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
@@ -236,6 +247,7 @@ Example message (permission prompt with ping disabled):
|
||||
Uses Babashka standard libraries:
|
||||
- `babashka.http-client` - HTTP requests to Discord API
|
||||
- `babashka.fs` - File system operations for config management
|
||||
- `babashka.process` - Shell command execution (for tmux session detection)
|
||||
- `cheshire.core` - JSON encoding/decoding
|
||||
- `clojure.string` - String manipulation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user