CLI tool for interacting with brand guidelines schema
Find a file
Brad Wenner b528e70b59
All checks were successful
Test / test (push) Successful in 28s
Release / release (push) Successful in 31s
fix: auto-pick first logo treatment instead of hardcoding full_color
The logo command defaulted to --variant full_color, but variant names
are brand-specific (e.g. dungeonchurch uses on_dark/on_light). Now
without --variant, the command picks the first treatment that contains
an svg key, skipping metadata keys like description and rules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:43:20 -08:00
.forgejo/workflows chore: set version to 0.2.0, auto-release on version bump 2026-02-28 08:37:48 -08:00
src/sigil fix: auto-pick first logo treatment instead of hardcoding full_color 2026-02-28 10:43:20 -08:00
tests fix: auto-pick first logo treatment instead of hardcoding full_color 2026-02-28 10:43:20 -08:00
.gitignore feat: scaffold sigil CLI tool for brand-guidelines 2026-02-27 20:38:42 +00:00
plan.md feat: scaffold sigil CLI tool for brand-guidelines 2026-02-27 20:38:42 +00:00
pyproject.toml fix: auto-pick first logo treatment instead of hardcoding full_color 2026-02-28 10:43:20 -08:00
README.md feat: redesign sigil v2 — schema-agnostic query tool 2026-02-28 00:03:44 -08:00

Sigil

CLI tool for querying brand.json data. Local-first, schema-agnostic — works against any brand.json without hardcoded models.

Installation

# Global install
uv tool install .

# Or run from project
uv run --project ~/BRANDS/sigil sigil ...

Quick Start

# From a brand directory (reads local brand.json)
cd ~/BRANDS/digitech
sigil                                    # brand overview
sigil get colors.primary.hex             # → #dfff11
sigil show colors                        # color table with swatches
sigil keys fonts                         # → logo, heading, body, ...

# From a remote brand
sigil get name -s digitech               # → Brad Wenner Digital
sigil show colors -s dungeonchurch       # remote color table

Commands

Command Description Default format
sigil Brand overview rich
sigil show [SECTION] Display a section or overview rich
sigil get <PATH> Extract a value by dot-path raw (scalars) / json (objects)
sigil keys [PATH] List available keys one per line
sigil schema Show the structure tree rich

Source Resolution

Use -s/--source to specify where to find brand.json:

sigil                              # cwd brand.json
sigil -s .                         # explicit cwd
sigil -s /path/to/brand.json       # absolute file path
sigil -s ../digitech               # directory containing brand.json
sigil -s digitech                  # short name → digitech/brand on Forgejo
sigil -s digitech/brand            # full owner/repo on Forgejo

Omit -s to use brand.json in the current directory. Falls back to SIGIL_SOURCE env var if set.

Dot-Path Syntax

sigil get colors.primary.hex                    # dict traversal
sigil get voice.personality.0                   # array index
sigil get accessibility.approved_pairs.0.ratio  # mixed

Output Formats

Override with --format / -f:

sigil show colors --format json     # JSON instead of rich table
sigil get name --format json        # JSON-wrapped scalar
sigil keys colors --format rich     # colored key list

Error UX

$ sigil get colors.primry.hex
Error: Key 'primry' not found in 'colors'
  Available keys: primary, secondary, text, background
  Did you mean 'primary'?

Options

Option Description
-s, --source Source: file, directory, remote name, or owner/repo
-f, --format Output format: rich, json, or raw
-r, --ref Git ref for remote sources (default: main)
--debug Show source resolution and fetch details
--no-color Disable color output
-v, --version Show version

Authentication

Set FORGEJO_TOKEN for private repositories:

export FORGEJO_TOKEN="your-token-here"

Development

uv sync --extra dev
uv run pytest tests/ -v
uv run ruff check src/

Architecture

  • typer — CLI framework
  • httpx — HTTP client for Forgejo API
  • rich — Terminal output formatting
  • No Pydantic — operates on raw dicts for schema flexibility