@lugalokinho/signalme
v1.1.1
Published
Multiplatform agent semaphore tool playing audio alerts and managing lifecycle hooks
Readme
SignalMe 🚦
SignalMe is a lightweight, zero-dependency, cross-platform developer semaphore tool for AI agent workflows. It triggers visual alerts and audio chimes to notify you when your agentic tools (Claude Code, Cursor Composer, Antigravity, or generic shell scripts) complete their tasks or pause to ask for input/permissions.
Architecture & How It Works
SignalMe works as a centralized registry and sound player utility:
- State Registry: Configurations are stored locally in your home directory at
~/.signalme/config.json. This registry holds paths to your success, error, and attention sounds. - Platform Audio Players: Spawns native child-processes to play audio without installing heavy native C++ bindings or node libraries:
- macOS: Spawns native
afplay. - Linux: Spawns
ffplaywith headless configuration flags. - Windows: Spawns PowerShell
System.Media.SoundPlayer(completely headless) with a fallback to Windows Media Player CLI.
- macOS: Spawns native
- Hooks Integration: Dynamically injects script executions into agent settings (like Claude Code's lifecycle hooks and Cursor's terminal configs) to automate alerts.
Installation
Install signalme globally using npm:
npm install -g @lugalokinho/signalmeGetting Started
- Initialize the configuration directory and register native OS sound alerts:
signalme init - Verify the installation by playing a success chime:
signalme play success
Local Development Setup
If you want to contribute or build/test changes locally on your system, follow this guide:
Step 1: Clone and Navigate to Directory
Ensure you are in the project root folder:
cd side-projects/agent-semaphoreStep 2: Install Node Dependencies
npm installStep 3: Compile TypeScript Code
npm run buildStep 4: Create Global Link (npm link)
Register the local build executable globally:
npm linkNow, typing signalme in any directory will run your local development build.
Local Development Workflow
If you want to edit the code and test changes in real-time, rebuilding constantly can be tedious. Use these techniques:
Live Rebuilding (Watch Mode)
Open a terminal in the background and run the watch compiler:
npx tsc --watchAs you modify .ts files in src/, they will automatically compile to dist/, immediately updating the behavior of your global signalme command!
Testing via TSX (Without Building)
If you want to run the TypeScript files directly without compiling them first, use npx tsx:
npx tsx src/index.ts play successCLI Command Reference
signalme init
Initializes the ~/.signalme configuration folder, creates config.json with default OS sounds, and maps placeholders:
signalme initsignalme play <type>
Triggers immediate playback of one of your registered sound classes:
signalme play success # Task success sound
signalme play error # Task error/failure sound
signalme play attention # Action Required / Stopped prompt soundsignalme enable <vendor> / signalme disable <vendor>
Wires automated hooks for specific agent environments:
Claude Code:
signalme enable --claude- What it does: Reads your global
~/.claude/settings.jsonfile, parses the JSON structure, and cleanly inserts hook triggers forStop(success) andPermissionRequest(attention) events without disturbing other hooks. - To undo:
signalme disable --claude
- What it does: Reads your global
Cursor IDE:
signalme enable --cursor- What it does: Injects
"terminal.integrated.bellToAlert": trueand"terminal.integrated.enableBell": trueinto your global Cursor usersettings.jsonfile so terminal bells automatically bubble up system notifications. - Note: Ensure "Play sound on agent completion" is turned on under Cursor Settings (Cmd+Shift+J) -> Features -> Composer.
- To undo:
signalme disable --cursor
- What it does: Injects
Antigravity / Custom Shell Runs:
signalme enable --antigravity- What it does: Registers
antigravityin the local config file and prints a reusable shell wrapper functionsem()that you can add to your~/.zshrcor~/.bashrc:sem() { "$@" local status=$? if [ $status -eq 0 ]; then signalme play success else signalme play error fi return $status } - Usage: Prefix any long-running agent command with
sem, e.g.,sem agy "fix typescript compiler errors in src/".
- What it does: Registers
Customizing Sound Effects
To change the sounds played by the CLI, edit your local settings registry at ~/.signalme/config.json.
Example configuration using custom local files:
{
"version": "1.0.0",
"sounds": {
"success": "/Users/yourname/Music/chime.mp3",
"error": "/Users/yourname/Music/alarm.mp3",
"attention": "/Users/yourname/Downloads/misc/buzina-palhaco.mp3"
},
"enabledDrivers": ["claude"]
}Publishing to npm
This project uses standard-version for semantic versioning, release tag management, and changelog auto-generation.
To publish a new release:
- Ensure your terminal session is authenticated to npm:
npm login - Run the publication script:
What this script does:npm run publish:package- Runs
npm run buildto compile TypeScript todist/. - Runs
npx standard-versionto bump the version, generate/updateCHANGELOG.md, and commit/tag the version bump. - Pushes the version tags to GitHub (
origin main). - Publishes the package to the npm registry.
- Runs
Troubleshooting
1. command not found: signalme
Ensure your npm global bin folder is in your shell's $PATH. You can check where npm installs global binaries by running:
npm prefix -gEnsure that path's bin/ subfolder is added to your environment path.
2. File Permissions
If you encounter permission errors running npm link, you may need to run it with admin privileges depending on your Node configuration:
sudo npm linkAlternatively, configure npm to install global packages under your home directory to avoid sudo requirements.
3. Sound Not Playing
- macOS: Ensure you can run
afplaymanually in terminal. - Linux: Ensure
ffplayis installed on your system (usually comes with theffmpegpackage). Runsudo apt-get install ffmpegif missing. - Windows: Verify PowerShell execution policies permit scripts if PowerShell execution fails.
