skip to content

CLI

Commands

Every ttheme command, with its arguments, actions and options. This page is made from the same source as ttheme help all, so the two never disagree.

Table of contents

ttheme help <command> prints one of them in your terminal, and ttheme <command> --help does the same without running it. A bare ttheme opens Preview and Browse.

Before ttheme is set up, init, uninstall and info run through npx or bunx in place of ttheme:

npx @kecan0406/ttheme@latest info

Every command exits 0 when it is done, 1 when it failed, 2 when nothing changed because you cancelled or what it would write is already there, 3 on invalid input, with the message naming what it takes, and 4 when a network request failed. Closing a bare ttheme exits 0.

This tab

use

ttheme use <palette>

Use a palette in this tab — by its name alone where one installed palette has it: ttheme use ayanami-rei

guide: Use ttheme

pin

ttheme pin [dir|ssh:<host>]

Pin a palette to a directory or an ssh host — the pin covers everything below it, or its whole repository; cd or ssh in shows it, leaving puts back what was there

guide: Use ttheme

unpin

ttheme unpin [dir|ssh:<host>]

Drop a pin — this directory's, every one below it, the one above that covers it, or an ssh host's

guide: Use ttheme

pins

ttheme pins

Map every pin as a file tree — the pinned directories in their palettes' colors, every ssh host, and the pin that covers this one

guide: Use ttheme

New tabs

default

ttheme default <palette>

Make a palette the one new tabs open with

guide: Use ttheme

on

ttheme on

Use the default palette in new tabs again

guide: Use ttheme

off

ttheme off

Take the palette and picture off every tab — the terminal's own colors until ttheme on

guide: Use ttheme

config

ttheme config

Edit settings in $EDITOR — a new mode reaches every open tab, the rest apply in new tabs

guide: Use ttheme

auto

ttheme auto

Show every palette in the mode the system is in — following it as it changes, where a wired Ghostty, iTerm2, kitty, WezTerm or Contour reports it

guide: Use ttheme

light

ttheme light

Show every palette in its light mode — every open tab changes, and new tabs open in it

guide: Use ttheme

dark

ttheme dark

Show every palette in its dark mode — every open tab changes, and new tabs open in it

guide: Use ttheme

Palettes

add

ttheme add [--in <marketplace>] <palette...>

Install palettes — from your marketplaces, from a share link (ttheme add https://ttheme.dev/builder/tt8:…), whose palettes of no marketplace — a tuned copy, a builder draft — join your local marketplace, or from a set, every palette of which joins it under its slug: ttheme add ~/Downloads/evangelion.toml

--in <marketplace>
The local marketplace a set's palettes, or a link's palettes of no marketplace, go into — when you have more than one

guide: Make a palette

update

ttheme update [marketplace...]

Update ttheme and refresh your marketplaces — the built-in palettes come with ttheme; an installed palette from another marketplace keeps its colors until ctrl+r on it in Browse takes its update

guide: Use ttheme

marketplace

ttheme marketplace [--owner <handle>] <action> [source]

Add or drop a marketplace — Browse also finds them on GitHub and switches their auto-update; init makes one of your own

add <source>
Add a marketplace — a repository (alice/ttheme-pastel, #v1 pins a tag or branch), a folder, or ttheme for the built-in one; asks whether it updates on its own
remove <marketplace>
Drop one by its name (alice@pastel) — the palettes you installed from it keep working
init [name]
Make a marketplace of your own — <you>@<name>, in ~/.config/ttheme/marketplace/<name> or a folder you give
check [dir]
Check a marketplace's folder before you push it — ttheme-marketplace.toml, every palette, the works it proposes against the commons and the contrast checks; nothing is written
--owner <handle>
init: your GitHub handle, when gh is not logged in and there is no terminal to ask in

guide: Use ttheme

Your own

new

ttheme new [--from <palette>] [--in <marketplace>] <name>

Make a palette of your own in the palette editor — <you>@<marketplace>/<name>, from blank, installed at once

--from <palette>
Start from this palette — its colors, and the work or character it is of — instead of blank
--in <marketplace>
The local marketplace to put it in — when you have more than one

guide: Make a palette

edit

ttheme edit [palette]

Change a palette in the palette editor — your own in its set, any other as your tuning over its marketplace's colors, which R and s in the editor put back; with none named, asks to edit the one this tab shows

guide: Make a palette

check

ttheme check [--fix] [palette]

Check a palette against the contrast checks — where one fails, suggest colors that pass; with none named, asks to check the one this tab shows

--fix
Write the suggested colors into your palette, or as your tuning of one that is not yours

guide: Make a palette

palette

ttheme palette [--json] [--preview] [--crop x,y,w,h] [--quant <n>] [--anchors <file>] [--work <work>] [--work-name <name>] [--work-native <title>] [--in <marketplace>] [--dry-run] <action> [arg]

Make a character's palette from colors measured on its art — the steps the ttheme-palette agent skill takes, each printing JSON with --json

measure <file|url>
Count a picture's flat colors, or a box's with --crop — --preview writes a copy at most 800 px on its long side and reads the box in its pixels
consensus <tag>
Read which colors danbooru's posts of a character tag name — the eyes, an item, or none — to pick the parts that carry the identity
make [palette]
Turn an anchors file into palettes — ranks base schemes, harmonizes, fixes the ANSI roles and runs the contrast checks, then writes them into your local marketplace, proposes in its works/ each work or character the commons lacks, and installs them
--json
Print the result as JSON on stdout
--preview
measure: write a preview at most 800 px on its long side; --crop is then in its pixels
--crop x,y,w,h
measure: the box to count
--quant <n>
measure: group near-duplicate colors — a JPEG's, an antialiased edge's — into n levels a channel
--anchors <file>
make: the anchors file
--work <work>
make: the work the characters are from, by its id — one the commons holds, or a new one your marketplace's works/ records
--work-name <name>
make: a new work's name, as lists show it
--work-native <title>
make: a new work's title in its own language
--in <marketplace>
make: your local marketplace to write into, or its folder
--dry-run
make: show the result and write nothing

Anchors file (--anchors), one entry per palette:

{

"gotoh-hitori": {

"slots": { "cursor": ["hair", "#ffb7c8"], "ansi4": ["eyes", "#7b96c8"], "ansi9": ["jacket", "#f39cbf"] },

"booru": "gotoh_hitori",

"native_names": ["後藤ひとり"],

"source": "https://…"

}

}

slots the colors you measured, cursor always among them — background, foreground,

cursor, selection or ansi0–ansi15 — each ["<part>", "#rrggbb"] as measured

booru the character's danbooru tag — a character the commons knows by it is the one the palette

is of; otherwise --work records it with the new character (optional)

native_names the new character's names in its own language (optional)

source where the colors were measured (optional)

With --json each action prints one object on stdout, its status done, unchanged or error;

an error lists each field it refuses in problems, as { path, problem }.

The ttheme-palette agent skill this ttheme works with is skill format 3;

a copy of a lower format asks you to update it before it starts.

0
Done
1
Failed
2
Nothing changed — you cancelled, or what it would write is already there
3
Invalid input — the message names the field and what it takes
4
A network request failed — try again

share

ttheme share [--tone <tuned|original>] [palette]

Share palettes as a link or a GitHub marketplace — asks which and which palettes, then prints the link and its QR code; ttheme add <link> installs a link's palettes, pictures included, and ttheme marketplace add <owner>/<repo> adds the marketplace, which gh creates and sharing it again updates; a palette named, or a link into a pipe, shares that palette, or the one this tab shows, as a link without asking

--tone <tuned|original>
Share the palettes you tuned as you tuned them, named <palette>-tuned, or as they were — asked when you omit this

guide: Make a palette

Setup

init

ttheme init [--yes]

Install the shell layer and wire your terminals

-y, --yes
Accept every default without prompting

guide: Quick start

uninstall

ttheme uninstall [--yes]

Remove ttheme — its block comes out of every terminal config and what it wrote is deleted

-y, --yes
Remove without asking

guide: Use ttheme

Support

info

ttheme info

Print what a bug report needs — version, OS, shell, terminal and the settings you changed

guide: Use ttheme