CLI Reference
Installation
Section titled “Installation”# Global installnpm install -g @gesslar/sassy
# Or use via npxnpx @gesslar/sassy build my-theme.yamlCommands
Section titled “Commands”Compile one or more theme files into VS Code .color-theme.json output.
sassy build [options] <file...>| Option | Short | Description |
|---|---|---|
--watch | -w | Watch all source and imported files; rebuild on changes |
--output-dir <dir> | -o | Output directory (default: same directory as input file) |
--dry-run | -n | Print compiled JSON to stdout instead of writing files |
--silent | -s | Suppress all output except errors (and dry-run output) |
--nerd | Show full error stack traces |
Examples:
# Build a single themesassy build my-theme.yaml
# Build multiple themessassy build theme-dark.yaml theme-light.yaml
# Build with watch mode and custom output directorysassy build --watch --output-dir ./dist my-theme.yaml
# Preview output without writingsassy build --dry-run my-theme.yamlOutput naming: An input file named midnight-ocean.yaml produces midnight-ocean.color-theme.json.
Hash-based skip: On subsequent builds, Sassy computes a SHA-256 hash of the output. If the hash matches the existing file on disk, the write is skipped. This avoids unnecessary file-system events.
Watch mode controls:
| Key | Action |
|---|---|
F5 or r | Force rebuild all themes |
q or Ctrl-C | Quit |
resolve
Section titled “resolve”Inspect the resolution trail of a specific colour, tokenColor scope, or semanticTokenColor.
sassy resolve [options] <file>| Option | Short | Description |
|---|---|---|
--color <key> | -c | Resolve a colour property (e.g., editor.background) |
--tokenColor <scope> | -t | Resolve a tokenColors scope (e.g., keyword.control) |
--semanticTokenColor <token> | -s | Resolve a semantic token colour |
--bg <hex> | Background colour for alpha swatch preview (e.g. 1a1a1a or '#1a1a1a') | |
--nerd | Show full error stack traces |
The resolver options (--color, --tokenColor, --semanticTokenColor) are mutually exclusive — specify exactly one per invocation.
Colour swatches
Section titled “Colour swatches”In colour-capable terminals, resolved hex values are displayed with a colour swatch (■) instead of an arrow. When a colour includes an alpha channel, two swatches are shown: the colour composited against black and against white, giving a quick visual sense of how transparency affects the result.
Use --bg to composite against a specific background colour instead:
# First, find out what the background issassy resolve --color editor.background my-theme.yaml
# Then use that value to preview an alpha colour in contextsassy resolve --color listFilterWidget.noMatchesOutline my-theme.yaml --bg 1a1a1aExamples:
# Resolve a coloursassy resolve --color editor.background my-theme.yaml
# Resolve a token colour scopesassy resolve --tokenColor keyword.control my-theme.yaml
# Resolve a semantic token coloursassy resolve --semanticTokenColor variable.declaration my-theme.yaml
# When multiple tokenColors entries match the same scope,# Sassy prompts for disambiguation:sassy resolve --tokenColor entity.name.class:2 my-theme.yaml
# Resolve a scope that isn't explicitly defined — Sassy finds# the best matching broader scope via TextMate precedence:sassy resolve --tokenColor comment.block.documentation my-theme.yamlWhen no exact scope match exists, Sassy uses TextMate precedence rules to find the most specific broader scope that covers the requested scope. The output shows what was requested, what it resolved through, and the full trail.
Display the fully composed theme document after all imports, overrides, and séance operators are applied — but before any variable substitution or colour function evaluation.
sassy proof [options] <file>| Option | Description |
|---|---|
--nerd | Show full error stack traces |
The output is YAML — the same language you author in. It shows:
- All imports resolved and merged into a single document
- Séance
^operators replaced with the actual prior values (e.g.shade(#4b8ebd, 25)) - All variable references (
$(std.bg),$$blue) left untouched - All colour functions left unevaluated
- The
config.importkey removed (imports are already applied)
Examples:
# See what the compiler will evaluatesassy proof my-theme.yaml
# Pipe to a file for diffingsassy proof my-theme.yaml > composed.yaml
# Compare two variantsdiff <(sassy proof blackboard.yaml) <(sassy proof blackboard-hushed.yaml)Validate a theme file for common issues.
sassy lint [options] <file>| Option | Description |
|---|---|
--strict | Treat warnings (duplicate scopes, precedence issues) as errors — exits 1 if any are found |
--nerd | Show full error stack traces |
Example:
sassy lint my-theme.yaml
# Fail on warnings too (useful in CI)sassy lint --strict my-theme.yamlEach issue includes a source location (file:line:col) pointing to the exact position in the source file — including across imports. Unnamed tokenColors entries are labelled (unnamed rule #N) for easier identification.
See Lint Rules for details on each check.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Success, or lint found only warnings/info. |
1 | Fatal error during compilation or file I/O; or lint found errors; or lint --strict found warnings. |

