The then field
Thethen field allows you to run custom commands when work or break sessions complete. This is useful for playing sounds, triggering scripts, or integrating with other tools.
List of commands to run after session completionEach command is specified as an array:
[command, arg1, arg2, ...]Basic syntax
pomo.yaml
Commands are specified as arrays, not strings. Use
[spd-say, "Hello"] instead of "spd-say Hello".Command execution behavior
Timeout
All commands run with a 5-second timeout. If a command takes longer than 5 seconds, it will be terminated.Source: actions/actions.go:15
Auto-cancellation
Commands are automatically cancelled when you start the next session. This prevents sound notifications or scripts from running after you’ve moved on.Execution order
Multiple commands in thethen array run sequentially in the order specified:
pomo.yaml
Sound notifications
Play sounds when sessions complete using platform-specific audio commands.Linux
Linux
Use Or use text-to-speech:
paplay (PulseAudio) or spd-say (speech dispatcher):macOS
macOS
Use Or use text-to-speech:
afplay (built-in audio player) or say (text-to-speech):Windows
Windows
Use PowerShell to play sounds:Or use Windows speech:
Example configurations
Custom scripts
Run custom scripts when sessions complete:pomo.yaml
Example script
work-done.sh
Terminal
Integration examples
Slack notification
Slack notification
Send a Slack message when sessions complete:Or use a script:
notify-slack.sh
Smart home integration
Smart home integration
Control smart lights or devices:
Logging and analytics
Logging and analytics
Log session completion:
log-session.sh
System actions
System actions
Perform system actions:
Error handling
If a command fails, Pomo logs the error but continues execution:Command failures don’t stop Pomo. Check terminal logs if commands aren’t working as expected.
Debugging commands
Test commands manually before adding them to your config:Terminal
Best practices
- Keep commands short - Remember the 5-second timeout
- Use absolute paths - Avoid relying on
$PATHor relative paths - Test commands first - Run them manually before adding to config
- Use scripts for complex tasks - Move multi-step logic to separate scripts
- Handle errors gracefully - Commands may fail; don’t rely on them completing
- Use background processes - For tasks that should continue after Pomo starts the next session