@hjanuschka/pi-nanny
Parental control extension for Pi - helps you go to bed instead of having 47 creative ideas at 3 AM
Package details
Install @hjanuschka/pi-nanny from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@hjanuschka/pi-nanny- Package
@hjanuschka/pi-nanny- Version
1.1.0- Published
- Feb 11, 2026
- Downloads
- 10/mo ยท 5/wk
- Author
- hjanuschka
- License
- MIT
- Types
- extension
- Size
- 27.2 KB
- Dependencies
- 0 dependencies ยท 1 peer
Pi manifest JSON
{
"extensions": [
"pi-nanny.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
๐๏ธ Pi-Nanny Extension
"My ADHD ass having 47 creative new ideas at 3 am instead of sleeping"
Pi-Nanny is a parental control extension for Pi that helps you maintain a healthy sleep schedule by nagging you to go to bed when you're coding at ungodly hours.
Born from this Twitter thread where @badlogicgames said "do it" after @hjanuschka suggested we need "some 'its over go to bed' extension!"
Features
โจ Progressive Enforcement
- ๐ Gentle warnings (midnight - 1 AM)
- ๐จ Strict mode after 5 ignored warnings
- ๐ด Hard exit at 1:00 AM - automatic shutdown with funny messages
๐ด Snooze System
- Temporary override with
/nanny snooze <minutes> - Quick snooze with
Ctrl+Shift+S - Can't snooze past hard exit time
๐ Status Tracking
- Persistent footer showing bedtime status
- Warning counter for repeat offenders
- Countdown to hard exit
๐ฒ Random Exit Messages
- "Good night sucker! ๐ด"
- "Git commit yourself to bed. NOW. ๐๏ธ"
- "404: Wakefulness not found. Redirecting to sleep. ๐"
- ...and 17 more!
Installation
Quick Install (Recommended)
# Install from npm (easiest)
pi install npm:@hjanuschka/pi-nanny
# Or install from git
pi install git:github.com/hjanuschka/pi-nanny@v1.0.0
# Try without installing
pi -e npm:@hjanuschka/pi-nanny
Manual Installation
Global (All Projects)
# Copy to extensions directory
mkdir -p ~/.pi/agent/extensions
cp pi-nanny.ts ~/.pi/agent/extensions/
# Or symlink for development
ln -s $(pwd)/pi-nanny.ts ~/.pi/agent/extensions/
The extension will auto-load in all Pi sessions. Use /reload to reload after edits.
Project-Local
# Copy to project extensions
mkdir -p .pi/extensions
cp pi-nanny.ts .pi/extensions/
Usage
Commands
/nanny test [bedtime|hardexit|normal] - Test Mode
Simulate different times for testing without waiting until midnight:
bedtime- Simulate midnight (gentle warnings)hardexit- Simulate 1 AM (forced shutdown)normal- Switch back to real time
/nanny test bedtime # See bedtime warnings
/nanny test hardexit # Trigger shutdown (careful!)
/nanny test normal # Back to real time
Can also use CLI flag:
pi -e ./pi-nanny.ts --nanny-test-time=0 # Midnight
pi -e ./pi-nanny.ts --nanny-test-time=1 # 1 AM
/nanny - Check Status
Shows current configuration and bedtime status:
- Enabled/disabled state
- Bedtime hours
- Hard exit time
- Current violations
- Snooze status
/nanny snooze [minutes] - Snooze Warnings
Temporarily disable bedtime enforcement (default: 15 minutes).
- Cannot snooze past hard exit hour
- Resets some of your warning counter
- Use wisely!
/nanny snooze 30 # Snooze for 30 minutes
/nanny snooze # Snooze for 15 minutes (default)
/nanny config - Configure Hours
Update bedtime schedule:
- Bedtime start (default: 0 = midnight)
- Bedtime end (default: 6 = 6 AM)
- Hard exit hour (default: 1 = 1 AM)
/nanny disable - Turn Off
Disable Pi-Nanny for the current session.
/nanny enable - Turn On
Re-enable Pi-Nanny after disabling.
/nanny reset - Reset Warnings
Reset the warning counter and strict mode.
Keyboard Shortcuts
Ctrl+Shift+S- Quick 15-minute snooze (only during bedtime, before hard exit)
Status Line
Pi-Nanny adds a status indicator to the footer:
๐ Bedtime! (ends in 5 hours)- Warning mode๐จ Bedtime! Hard exit in 45m- Approaching hard exit๐ด Snooze: 12m remaining- Currently snoozed๐จ HARD EXIT - Shutting down soon!- Past 1 AM
Configuration
Default configuration:
{
bedtimeStart: 0, // Midnight
bedtimeEnd: 6, // 6 AM
hardExitHour: 1, // 1 AM - force quit
strictMode: false, // Starts gentle
enabled: true
}
How It Works
Midnight - 1 AM (Warning Mode)
- Gentle reminders on each prompt
- Escalates to "firm" after 3 warnings
- Activates strict mode after 5 warnings
Strict Mode
- Blocks each prompt with confirmation dialog
- Auto-timeout after 10 seconds
- Adds guilt to every bypass
1 AM - Hard Exit
- 30-second countdown dialog
- No snooze allowed
- Automatic
ctx.shutdown() - Random funny exit message
Exit Messages
Sample messages shown during hard exit:
- "Good night sucker! ๐ด"
- "That's it. I'm pulling the plug. Sweet dreams! ๐"
- "Your 3 AM ideas can wait. Trust me. ๐"
- "Git commit yourself to bed. NOW. ๐๏ธ"
- "Stackoverflow will still be there in the morning. Bye! ๐"
- "404: Wakefulness not found. Redirecting to sleep. ๐"
- "Ctrl+Alt+Delete your bad sleep habits. Good night! โจ๏ธ"
Examples
Starting Pi at 2 AM
$ pi
๐จ MANDATORY BEDTIME
It's past 1:00 AM. Pi is shutting down in 30 seconds.
Ctrl+Alt+Delete your bad sleep habits. Good night! โจ๏ธ
No snooze available. Get some sleep!
[Yes] [No (default)]
Warning During Bedtime
๐ด Even GPUs need to sleep sometimes.
Snoozing Past Hard Exit
/nanny snooze 60
โ ๏ธ Can't snooze past 1:00 AM (hard exit). Max snooze: 45 minutes
Development
Built with Pi's extension API. Key features used:
- Event interception -
input,agent_start,session_start - UI components -
ctx.ui.confirm(),ctx.ui.notify(),ctx.ui.setStatus() - Custom commands -
/nannywith subcommands - Keyboard shortcuts -
Ctrl+Shift+S - Graceful shutdown -
ctx.shutdown()
Credits
- Idea: @kshvbgde's late-night ADHD tweet
- Suggestion: @hjanuschka (that's me!)
- Blessing: @badlogicgames said "do it"
- Framework: Pi by @badlogicgames
License
MIT - Use at your own risk of actually getting good sleep.
Contributing
Got better exit messages? More creative nag lines? PRs welcome!
Remember: The bugs will still be there tomorrow. Your sleep schedule won't.