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.
Install
Section titled “Install”macOS, Linux, or Windows (amd64 or arm64):
curl -fsSL https://github.com/lukedevops/stylist-releases/releases/latest/download/install.sh | shThis 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:
stylist versionManual install
Section titled “Manual install”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.
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.txtchmod +x "stylist-${VERSION}-darwin-arm64"mv "stylist-${VERSION}-darwin-arm64" /usr/local/bin/stylistPick arm64 or amd64 to match uname -m (aarch64 → arm64,
x86_64 → amd64).
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.txtchmod +x "stylist-${VERSION}-linux-amd64"sudo mv "stylist-${VERSION}-linux-amd64" /usr/local/bin/stylistWindows
Section titled “Windows”Pick arm64 or amd64 to match your CPU. In PowerShell:
$VERSION = (Invoke-RestMethod -Uri https://api.github.com/repos/lukedevops/stylist-releases/releases/latest).tag_nameInvoke-WebRequest -Uri "https://github.com/lukedevops/stylist-releases/releases/download/$VERSION/stylist-$VERSION-windows-amd64.exe" -OutFile stylist.exeGet-FileHash stylist.exe -Algorithm SHA256 # compare against that release's SHA256SUMS.txtMove stylist.exe into a folder of your choice and add that folder to
your PATH.
Container
Section titled “Container”docker pull ghcr.io/lukedevops/stylist:latestdocker run -p 8420:8420 -v /path/to/rulesets:/rulesets:ro ghcr.io/lukedevops/styliststylist is a single static binary with no runtime dependencies.
Your first check
Section titled “Your first check”Create a ruleset (see Rulesets for the full schema):
id: acme-brand-v1colors: allowed: ["#1A2B3C", "#FFFFFF"]fonts: allowed: [Inter, Georgia]terms: banned: - term: cheap reason: use "affordable" required: - term: ACMECheck a file:
stylist check -ruleset rules/brand.yaml page.htmlFAIL 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.
Run anywhere
Section titled “Run anywhere”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:
stylist check -ruleset rules/brand.yaml ~/Desktop/draft-landing-page.htmlSTYLIST_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.
Wire it into a repo
Section titled “Wire it into a repo”Add a project config so nobody needs flags:
# .stylist.yaml (repo root, checked in)ruleset: rules/brand.yamlInstall the pre-commit hook:
stylist hook installCommits 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:
stylist baselineNext steps
Section titled “Next steps”- 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.