Skip to content

Getting started

This is for self-hosting: you build or download stylist and run it yourself. If someone else already runs it for you and gave you an API URL and a token, see Getting started (hosted) instead.

macOS, Linux, or Windows (amd64 or arm64):

Terminal window
curl -fsSL https://github.com/lukedevops/stylist-releases/releases/latest/download/install.sh | sh

This downloads the right binary for your platform, verifies it against that release’s SHA256SUMS.txt, and installs it as stylist on your PATH (falls back to ~/.local/bin and adds it to your shell config if no PATH directory is writable). Check the install script here — install.sh.

Confirm it worked:

Terminal window
stylist version

For air-gapped environments, or if you’d rather vet the binary yourself before running it, download it from the latest release and check it against that release’s SHA256SUMS.txt.

Pick arm64 for Apple Silicon (M1 and later), amd64 for Intel Macs.

Terminal window
VERSION=$(curl -fsSL https://api.github.com/repos/lukedevops/stylist-releases/releases/latest | grep -m1 '"tag_name"' | sed -E 's/.*"tag_name": *"([^"]+)".*/\1/')
curl -LO "https://github.com/lukedevops/stylist-releases/releases/download/${VERSION}/stylist-${VERSION}-darwin-arm64"
shasum -a 256 "stylist-${VERSION}-darwin-arm64" # compare against that release's SHA256SUMS.txt
chmod +x "stylist-${VERSION}-darwin-arm64"
mv "stylist-${VERSION}-darwin-arm64" /usr/local/bin/stylist

Pick arm64 or amd64 to match uname -m (aarch64 → arm64, x86_64 → amd64).

Terminal window
VERSION=$(curl -fsSL https://api.github.com/repos/lukedevops/stylist-releases/releases/latest | grep -m1 '"tag_name"' | sed -E 's/.*"tag_name": *"([^"]+)".*/\1/')
curl -LO "https://github.com/lukedevops/stylist-releases/releases/download/${VERSION}/stylist-${VERSION}-linux-amd64"
sha256sum "stylist-${VERSION}-linux-amd64" # compare against that release's SHA256SUMS.txt
chmod +x "stylist-${VERSION}-linux-amd64"
sudo mv "stylist-${VERSION}-linux-amd64" /usr/local/bin/stylist

Pick arm64 or amd64 to match your CPU. In PowerShell:

Terminal window
$VERSION = (Invoke-RestMethod -Uri https://api.github.com/repos/lukedevops/stylist-releases/releases/latest).tag_name
Invoke-WebRequest -Uri "https://github.com/lukedevops/stylist-releases/releases/download/$VERSION/stylist-$VERSION-windows-amd64.exe" -OutFile stylist.exe
Get-FileHash stylist.exe -Algorithm SHA256 # compare against that release's SHA256SUMS.txt

Move stylist.exe into a folder of your choice and add that folder to your PATH.

Terminal window
docker pull ghcr.io/lukedevops/stylist:latest
docker run -p 8420:8420 -v /path/to/rulesets:/rulesets:ro ghcr.io/lukedevops/stylist

stylist is a single static binary with no runtime dependencies.

Create a ruleset (see Rulesets for the full schema):

rules/brand.yaml
id: acme-brand-v1
colors:
allowed: ["#1A2B3C", "#FFFFFF"]
fonts:
allowed: [Inter, Georgia]
terms:
banned:
- term: cheap
reason: use "affordable"
required:
- term: ACME

Check a file:

Terminal window
stylist check -ruleset rules/brand.yaml page.html
FAIL page.html (ruleset: acme-brand-v1)
page.html:5 [colors] color #ff4136 is not in the allowed brand palette
page.html:10 [terms] banned term "cheap" found: use "affordable"

Exit codes are CI-friendly: 0 pass, 1 violations, 2 error.

The check above didn’t need a project or .stylist.yaml — -ruleset works standalone against any file or directory, anywhere on disk. Handy for testing a ruleset you’re iterating on, or spot-checking a one-off asset:

Terminal window
stylist check -ruleset rules/brand.yaml ~/Desktop/draft-landing-page.html

STYLIST_RULESET works the same way if you’d rather not repeat the flag. These are called loose assets once they’re logged centrally (no repo attached) — see Loose assets and Configuration for the full flag/env reference, including the opt-in personal fallback ruleset at ~/.stylist/ruleset.yaml for skipping the flag/env entirely on your own machine.

Add a project config so nobody needs flags:

# .stylist.yaml (repo root, checked in)
ruleset: rules/brand.yaml

Install the pre-commit hook:

Terminal window
stylist hook install

Commits that stage HTML violating the ruleset are now blocked, with the violation list printed. If the repo already has violations, accept them as tracked debt first. See Baselines:

Terminal window
stylist baseline
  • Point the repo at a central server instead of a local ruleset file: Server.
  • Catch assets as agents generate them: Hooks & CI.
  • See conformance over time: Dashboard.