Skip to content

Scan your codebase for off-brand UI copy. Get a score. Share it.

License

Notifications You must be signed in to change notification settings

zeronelabs/brandlint-cli

Repository files navigation

Brandlint logo

Brandlint

Scan your codebase for off-brand UI copy. Get a score. Share it.

npm version License: AGPL-3.0 Node.js >= 18

Website · Docs · Feedback

 

Like ESLint, but for your product voice. Brandlint scans your codebase for off-brand copy — inconsistent tone, vague messages, wrong casing — and tells you exactly where to fix it, with file and line number.

npx brandlint

You bring your own API key (Anthropic or OpenAI). Nothing is sent to Brandlint servers except the final score summary if you choose to share it.

 

How It Works

  1. Pick a voice — Professional, Casual, or Technical
  2. Scan — Extracts user-facing strings from your codebase
  3. Analyze — AI checks each string against your brand voice guidelines
  4. Report — See your score, issues by file/line, and top problem categories
  5. Share — Generate a score card at brandlint.com/score/<id> with one keypress

Brandlint CLI

 

Requirements

Set your key as an environment variable to skip the prompt on every run:

export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...

 

Voice Templates

Template Style Example guideline
Professional Clear, confident, helpful "Enter your email to continue" not "Fill in the required field"
Casual Friendly, warm, conversational "Looks like something broke" not "Error 500: Internal failure"
Technical Precise, direct, informative "Request timed out after 30s" not "Something went wrong!"

 

What Gets Scanned

Brandlint extracts user-facing strings from:

Category File types
JS / TS .ts .tsx .js .jsx .mjs .cjs
Frameworks .vue .svelte
Markup .html .htm
Templates .ejs .hbs .pug .erb .slim .haml .twig
Backend .php .py .cshtml .razor
Content .json .yaml .yml .md .mdx

It finds strings in JSX text, UI attributes (label, placeholder, title, error, description), i18n functions (t(), $t(), gettext()), and template literals with user-facing content.

node_modules, dist, build, .next, .git, and similar directories are ignored automatically.

 

Score Card

After scanning, Brandlint offers to create a shareable score card at brandlint.com/score/<id>:

  • Color-coded score with issue breakdown
  • Top problem categories (tone, clarity, casing, etc.)
  • Open Graph image that unfurls on X, Slack, and Discord
  • One-click share to X with pre-filled tweet

The only data sent is the summary (score, counts, categories, voice template). Your source code never leaves your machine.

 

Continuous Monitoring

The CLI gives you a one-time scan. For automated brand voice checks on every pull request, set up Brandlint as a GitHub App — it reviews PRs and comments inline with suggestions.

 

Development

git clone https://github.com/zeronelabs/brandlint-cli.git
cd brandlint-cli
pnpm install
pnpm build       # Build to dist/cli.mjs
pnpm dev         # Build with watch mode

 

Testing Locally

Run from source:

pnpm build
node dist/cli.mjs

Test as if installed via npx:

pnpm pack                       # Creates brandlint-0.1.0.tgz
npx ./brandlint-0.1.0.tgz      # Runs exactly like npx brandlint would

Test score card upload against local web app:

BRANDLINT_API_URL=http://localhost:3000/api/score-card node dist/cli.mjs

 

Releasing

Releases are automated via GitHub Actions. When you push a version tag, the workflow builds and publishes to npm.

One-time setup:

  1. Generate an npm access token at npmjs.com → Access Tokens → Classic → Automation
  2. Add it as NPM_TOKEN in repo Settings → Secrets → Actions

To release:

npm version patch               # 0.1.0 → 0.1.1 (or minor / major)
git push && git push --tags     # Triggers publish workflow

After a few seconds, npx brandlint serves the new version globally.

First publish (before any tags exist):

npm login
pnpm build && npm publish

 

License

AGPL-3.0

About

Scan your codebase for off-brand UI copy. Get a score. Share it.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published