A small Go CLI for calculating sleep and wake times around 90-minute sleep cycles.
sleepycli helps you answer questions like:
- “If I sleep now, when should I wake up?”
- “If I want to wake up at 07:00, when should I go to bed?”
- “How many full sleep cycles fit between two times?”
The tool supports four main modes: calculate from now, from a target wake time, from a target sleep time, or across a window of time.
- Interactive TUI mode when run without flags
- Calculate wake times from the current time
- Calculate bedtimes for a target wake time
- Calculate wake times for a target sleep time
- Calculate full sleep cycles within a sleep window
- Configurable fall-asleep buffer
- Configurable minimum and maximum cycle count
- Input validation for modes, time format, and cycle ranges
- Custom help output
- Bash completion script
- Pull request CI for linting and tests
The calculator uses a 90-minute sleep cycle and adds an optional buffer to represent the time it takes to fall asleep.
Defaults:
- Sleep cycle:
90 minutes - Buffer:
15 minutes - Displayed cycles:
4to6
Download the latest binary and completion script from the releases page.
tar -xzf sleepycli_<version>_<os>_<arch>.tar.gz
chmod +x sleepycli
sudo mv sleepycli /usr/local/bin/sleepycliTo enable bash completion, add this to your ~/.bashrc:
source <(curl -sL https://github.com/TyostoKarry/sleepycli/releases/latest/download/sleepycli-completion.bash)Extract the .zip archive and move sleepycli.exe to a folder in your PATH.
If you have Go installed:
go install github.com/TyostoKarry/sleepycli@latestgit clone https://github.com/TyostoKarry/sleepycli.git
cd sleepycli
go build -o sleepycli .Run sleepycli without any flags to launch the interactive TUI:
sleepycli- Navigate with
↑/↓ - Press
enteron a mode to select it and type your time - Adjust settings (buffer, cycle range) from the settings section
- Press
enterto confirm — the result is printed to your terminal - Press
qto quit without output
sleepycli [mode] [options]Choose exactly one mode.
Calculate wake times starting from the current time.
sleepycli --nowCalculate suggested bedtimes for a target wake time.
sleepycli --wake 07:00Calculate suggested wake times for a target sleep time.
sleepycli --sleep 22:30Calculate how many complete sleep cycles fit inside a time window.
sleepycli --from 22:00 --to 07:00sleepycli --wake 07:00 --buffer 30sleepycli --sleep 23:00 --cycles-min 3 --cycles-max 7To wake up at 07:00
──────────────────────────────
Assuming 15 min to fall asleep
6 cycles → sleep at 21:45 (9h 00m)
5 cycles → sleep at 23:15 (7h 30m)
4 cycles → sleep at 00:45 (6h 00m)
Between 22:00 and 07:00
──────────────────────────────
Assuming 15 min to fall asleep
5 complete cycles (7h 30m)
75 minutes remaining
| Flag | Description | Default |
|---|---|---|
-n, --now |
Calculate wake times from the current time | - |
-w, --wake HH:MM |
Calculate bedtimes for a target wake time | - |
-s, --sleep HH:MM |
Calculate wake times for a target sleep time | - |
-f, --from HH:MM |
Start of sleep window, used with --to |
- |
-t, --to HH:MM |
End of sleep window, used with --from |
- |
-b, --buffer int |
Minutes needed to fall asleep | 15 |
-m, --cycles-min int |
Minimum cycles to show | 4 |
-x, --cycles-max int |
Maximum cycles to show | 6 |
-g, --good-night |
Print random good night ASCII art | - |
-v, --version |
Print version | - |
-h, --help |
Show help | - |
- Time format is 24-hour
HH:MM - Short hour values like
7:00are accepted - Modes cannot be combined
--fromand--tomust be used together--now,--wakeand--sleepare mutually exclusive--cycles-mincannot be greater than--cycles-max- Buffer and cycle values cannot be negative
The repository includes a pull request workflow that:
- runs
golangci-lint - runs
go test ./... - triggers on pull requests targeting
main