@hjanuschka/pi-nanny

Parental control extension for Pi - helps you go to bed instead of having 47 creative ideas at 3 AM

Package details

extension

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

  1. Midnight - 1 AM (Warning Mode)

    • Gentle reminders on each prompt
    • Escalates to "firm" after 3 warnings
    • Activates strict mode after 5 warnings
  2. Strict Mode

    • Blocks each prompt with confirmation dialog
    • Auto-timeout after 10 seconds
    • Adds guilt to every bypass
  3. 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 - /nanny with subcommands
  • Keyboard shortcuts - Ctrl+Shift+S
  • Graceful shutdown - ctx.shutdown()

Credits

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.