pi-auto-theme
v1.1.1
Published
Auto-sync pi theme with OS appearance
Readme
pi-auto-theme
A simple extension for the pi coding agent that automatically changes the theme from dark to light (and vice versa) based on the theme of your operating system.

Features
- Instant Reactions: This extension does NOT depend on 'polling' every N seconds. Instead, it uses crossterm-system-theme with a native listener for theme changes, allowing it to react to OS-level theme changes instantly.
- (Note: It does fall back to a 3-second poll in certain Linux desktop environments if it cannot find a way to listen natively, but this rarely happens.)
- No Clutter: This pi extension is lightweight. It adds a single
/themecommand to allow manual overrides. - Commands:
/theme auto: Syncs the theme with your OS natively./theme dark: Overrides auto-sync and forces dark theme./theme light: Overrides auto-sync and forces light theme.
Installation
Install the extension globally:
pi install npm:pi-auto-themeInstall it only for the current project:
pi install npm:pi-auto-theme -lOr run it temporarily without installing:
pi -e npm:pi-auto-themeIf you have cloned the repository, you can run it from the local directory:
pi -e ./index.tsHow it works
When the extension is loaded, it checks the current OS theme and immediately sets the pi UI theme. It also sets up a native theme change listener using crossterm-system-theme. If your OS switches between Light and Dark mode, the pi TUI will update instantly without restarting the session.
License
ISC
