| name | breathe-cli-resonance-breathing |
| description | Terminal-based paced resonance breathing for vagal tone training and heart rate variability improvement |
| triggers | ["help me set up breathe for resonance breathing","how do I use breathe-cli for HRV training","configure breathing exercises in terminal","find my personal resonance frequency with breathe","set up custom breathing ratios and presets","integrate breathe-cli into my wellness routine","troubleshoot breathe breathing app","create breathing session with specific duration"] |
Breathe CLI — Resonance Breathing Skill
Skill by ara.so — Devtools Skills collection.
Breathe CLI is a terminal application for paced resonance breathing at ~6 breaths per minute, designed for vagal tone training and improving heart rate variability (HRV). It's a single Python file with no dependencies, supporting macOS and Windows 11. The app provides audio cues, visual progress bars, and session logging for daily practice.
What It Does
Breathe CLI paces slow breathing at resonance frequency (typically 4.5-6.5 bpm) to amplify respiratory sinus arrhythmia (RSA) and improve cardiac vagal tone. It's based on clinical research showing benefits for heart failure patients and autonomic balance. The app includes presets for different times of day and allows custom breath ratios.
Installation
Direct Download
curl -O https://raw.githubusercontent.com/marekkowalczyk/breathe-cli/main/breathe.py
chmod +x breathe.py
./breathe.py
ln -s "$(pwd)/breathe.py" /usr/local/bin/breathe
breathe
Via pip
pip install breathe-cli
breathe
Via Homebrew (macOS)
brew tap marekkowalczyk/breathe
brew install breathe
breathe
Basic Usage
Quick Start
breathe
breathe --preset calm
breathe --preset balanced
breathe --preset extended
breathe --list-presets
Custom Sessions
breathe --duration 5
breathe --ratio 4-6
breathe --duration 12 --ratio 4-6
breathe -d 8 -r 5-5
Session Control
During a session, use these keys:
space — Pause/resume (resume restarts from beginning of INHALE)
s — Mute/unmute audio cues
q or Ctrl+C — Quit immediately
Sound and Logging Options
breathe --no-sound
breathe -n
breathe --quiet
breathe -q
breathe --no-log
breathe --log
Breath Ratio Constraints
The app enforces safety constraints based on clinical protocols:
- Inhale: 3-10 seconds
- Exhale: 3-10 seconds
- Total cycle: ≥8 seconds (max 7.5 bpm)
- Exhale/inhale ratio: ≤2.0
- No breath holds: Three-number ratios like
4-7-8 are rejected
Valid ratios for common frequencies:
breathe --ratio 6-7
breathe --ratio 6-6
breathe --ratio 5-6
breathe --ratio 5-5
breathe --ratio 4-6
Finding Personal Resonance Frequency
Individual resonance frequency varies (4.5-6.5 bpm). If you have HRV biofeedback hardware (chest strap + software like Kubios), you can test:
Testing Protocol
breathe --ratio 5-5 -d 3 --no-log
breathe --ratio 5-6 -d 3 --no-log
breathe --ratio 6-6 -d 3 --no-log
breathe --ratio 6-7 -d 3 --no-log
Use the frequency that produces the highest RMSSD or widest HR oscillations.
Configuration & Presets
Time-of-Day Auto-Select
When run without arguments, breathe selects preset by time:
| Time | Preset | Duration | Ratio | BPM |
|---|
| Before noon | balanced | 10 min | 5s-5s | 6 |
| 12:00-16:59 | extended | 20 min | 4s-6s | 6 |
| 17:00+ | calm | 15 min | 4s-6s | 6 |
Creating Custom Routines
breathe -p balanced -d 8
breathe -d 20 -r 4-7
breathe -p calm -q
breathe -d 3 -n --no-log
Session Logging
Sessions are automatically logged unless --no-log is used.
breathe --log
Log location varies by OS:
- macOS:
~/Library/Application Support/breathe/sessions.log
- Linux:
~/.local/share/breathe/sessions.log
- Windows:
%APPDATA%\breathe\sessions.log
Advanced Patterns
Scripting Daily Practice
#!/bin/bash
HOUR=$(date +%H)
if [ $HOUR -lt 9 ]; then
breathe -p balanced -d 5 -q
elif [ $HOUR -lt 12 ]; then
breathe -p balanced -q
else
breathe -q
fi
Integrating with Cron/Launchd
0 8 * * * /usr/local/bin/terminal-notifier -message "Time for breathing practice" -title "Breathe"
Custom Ratios for Different Goals
breathe -r 5-5 -d 10
breathe -r 4-6 -d 15
breathe -r 4-8 -d 12
breathe -r 6-7 -d 15
Safety Information
breathe --safety
Key safety constraints:
- No breath retention: Continuous breathing only, no holds between phases
- No rapid breathing: Minimum 8-second cycles (max 7.5 bpm)
- Exhale limits: Exhale max 2x inhale length to prevent CO2 depletion
- Immediate exit:
q or Ctrl+C always works, terminal always restored
Troubleshooting
Audio Not Working (macOS)
which afplay
afplay /System/Library/Sounds/Glass.aiff
breathe --no-sound
Audio Not Working (Windows)
python -c "import winsound; winsound.Beep(1000, 200)"
breathe --no-sound
Terminal Display Issues
reset
printf '\033[?25h\033[0m'
Invalid Ratio Errors
breathe -r 3-4
breathe -r 4-4
breathe -r 3-7
breathe -r 3-6
Python Version Issues
python3 --version
which python3
Integration Examples
With Meditation Scripts
import subprocess
import time
def guided_session():
print("Starting 5-minute centering...")
time.sleep(5)
print("\nBeginning breathwork...")
subprocess.run(['breathe', '-d', '10', '-r', '4-6', '-q'])
print("\nReturning to normal breathing...")
time.sleep(60)
if __name__ == '__main__':
guided_session()
With Tmux/Screen Sessions
tmux new-session -d -s breathe 'breathe -p calm'
tmux attach -t breathe
With Focus Timers
#!/bin/bash
while true; do
echo "Work period: 25 minutes"
sleep 1500
echo "Break time: breathe for 5 minutes"
breathe -d 5 -q
read -p "Continue? (y/n) " -n 1 -r
echo
[[ ! $REPLY =~ ^[Yy]$ ]] && break
done
Command Reference
All Flags
| Flag | Short | Description |
|---|
--preset NAME | -p | Use named preset (balanced/calm/extended) |
--duration MIN | -d | Session length in minutes (1-60) |
--ratio IN-EX | -r | Breath ratio, e.g. 5-5 or 4-6 |
--no-sound | -n | Disable audio cues |
--quiet | -q | Suppress startup warnings |
--no-log | | Don't log this session |
--log | | Print log file path and exit |
--safety | | Print safety information and exit |
--list-presets | | Print preset table and exit |
--version | | Print version and exit |
Version & Help
breathe --version
breathe --help
Best Practices
- Consistency over perfection: Daily 10-minute sessions are more effective than occasional 30-minute sessions
- Same time daily: Practice at the same time to build habit and improve measurement consistency
- Find your frequency: Use the default 6 bpm unless you've tested your personal resonance frequency with HRV hardware
- Longer exhale for calm: Use 4-6 or 4-7 ratios in evening for parasympathetic emphasis
- Track progress: Keep logs enabled to monitor adherence
- Start small: Begin with 5 minutes if new to slow breathing
- Sit upright: Practice sitting with straight spine for optimal breathing mechanics
Platform-Specific Notes
macOS
- Uses
/usr/bin/afplay for audio cues
- Logs to
~/Library/Application Support/breathe/
- Works on macOS 10.13+
Windows 11
- Uses
winsound module for audio
- Logs to
%APPDATA%\breathe\
- Requires Windows Terminal for best experience
Linux
- Audio cues not currently supported
- Use
--no-sound flag
- Logs to
~/.local/share/breathe/