https://github.com/championswimmer/pi-auto-theme
pi coding agent - auto dark/light theme extension
https://github.com/championswimmer/pi-auto-theme
dark-mode light-mode pi pi-agent pi-coding-agent system-theme
Last synced: 1 day ago
JSON representation
pi coding agent - auto dark/light theme extension
- Host: GitHub
- URL: https://github.com/championswimmer/pi-auto-theme
- Owner: championswimmer
- Created: 2026-04-08T02:07:31.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-02T23:39:42.000Z (about 2 months ago)
- Last Synced: 2026-06-10T19:29:02.808Z (6 days ago)
- Topics: dark-mode, light-mode, pi, pi-agent, pi-coding-agent, system-theme
- Language: TypeScript
- Homepage:
- Size: 1.17 MB
- Stars: 9
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-pi-coding-agent - championswimmer-pi-auto-theme - auto dark/light theme extension | ⭐9 | ~1mo ago | (Extensions)
README
# pi-auto-theme
[](https://www.npmjs.com/package/pi-auto-theme)
A simple extension for the [pi coding agent](https://github.com/badlogic/pi-mono) 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](https://github.com/championswimmer/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 `/theme` command 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:
```bash
pi install npm:pi-auto-theme
```
Install it only for the current project:
```bash
pi install npm:pi-auto-theme -l
```
Or run it temporarily without installing:
```bash
pi -e npm:pi-auto-theme
```
If you have cloned the repository, you can run it from the local directory:
```bash
pi -e ./index.ts
```
## How 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