Skip to content

feat: add ghostty-import extension — convert 463 Ghostty themes to Pi format#10

Open
arosstale wants to merge 2 commits intodisler:mainfrom
arosstale:feat/ghostty-theme-converter
Open

feat: add ghostty-import extension — convert 463 Ghostty themes to Pi format#10
arosstale wants to merge 2 commits intodisler:mainfrom
arosstale:feat/ghostty-theme-converter

Conversation

@arosstale
Copy link
Copy Markdown

What

Adds a ghostty-import extension that bridges Ghostty's 463 community themes to Pi's theme system.

Commands

Command Description
/ghostty Dracula Fetch, convert, and save the Dracula theme to .pi/themes/dracula.json
/ghostty Catppuccin Mocha Same for any of 463 themes
/ghostty-list Browse all available Ghostty themes
/ghostty-list nord Filter themes matching "nord"

How it works

  1. Fetches the Ghostty theme file from GitHub (raw key = value format)
  2. Parses the 16-color ANSI palette + background/foreground/cursor/selection
  3. Maps palette colors to Pi's vars (red, green, yellow, blue, purple, cyan)
  4. Derives all 70+ Pi colors keys from the 6 base colors (surface, selection, bgRed, bgGreen, etc.)
  5. Saves to .pi/themes/<slug>.json — ready for /theme or -t flag

Example conversion

Ghostty input:

background = #282a36
foreground = #f8f8f2
palette = 1=#ff5555
palette = 2=#50fa7b

Pi output:

{
  "name": "dracula",
  "vars": {
    "bg": "#282a36",
    "fg": "#f8f8f2",
    "red": "#ff5555",
    "green": "#50fa7b",
    ...
  },
  "colors": { ... all 70+ keys mapped ... }
}

Usage

just ext-ghostty
# or
pi -e extensions/ghostty-import.ts -e extensions/theme-cycler.ts
  • Zero new dependencies
  • Stacks with theme-cycler for Ctrl+X/Q switching between imported themes
  • Includes justfile recipe

Changes:
- .pi/damage-control-rules.yaml: 279 → 610 lines (full disler upstream)
- pi-power.bat: loads pi-pai v3 instead of damage-control.ts (no overlap)
- pi-max.bat: full extension stack + pi-pai v3
- mprocs.yaml: multi-process config for 10 Pi instances
- start-all.bat, start-picks.bat: batch runners for Windows

pi-pai v3 replaces damage-control.ts when loaded — same YAML, same patterns,
plus /pai /ralph /rate commands, ISC tracking, and live TUI widget.
… format

Adds /ghostty <name> command that fetches any Ghostty theme from
iTerm2-Color-Schemes (463 themes), parses the key=value format,
maps the 16-color ANSI palette to Pi's theme vars/colors structure,
and saves the result to .pi/themes/<slug>.json.

Also adds /ghostty-list [filter] to browse and filter available themes.

Conversion maps:
- palette[1-6] → red, green, yellow, blue, purple, cyan
- background → bg, derived bgDark, bgDeep, surface
- foreground → fg, derived fgSoft, comment
- selection-background → selection
- Generates all 70+ Pi color keys from 6 base palette colors

Zero new dependencies. Uses fetch() for GitHub API/raw content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant