@whynothugo/pi-auto-theme

Pi extension to automatically switch theme based on terminal dark/light mode.

Package details

extension

Install @whynothugo/pi-auto-theme from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@whynothugo/pi-auto-theme
Package
@whynothugo/pi-auto-theme
Version
1.0.0
Published
May 5, 2026
Downloads
not available
Author
whynothugo
License
unknown
Types
extension
Size
3 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-auto-theme

pi-coding-agent extension to automatically switch theme based on terminal background color.

Installation

Install with:

pi install https://git.sr.ht/~whynothugo/pi-auto-theme

Overview

  • On session start, queries the terminal's background color using OSC 11
  • Calculates the luminance of the background color
  • Switches to light theme for light backgrounds, dark for dark backgrounds
  • Listens for future background color changes.

Requires a terminal that supports OSC 11 query/response for background color

LICENCE

Licensed under the ISC licence. See LICENCE for details.