CLI Overview
Companion tooling for better-seo.js — asset generation, crawl helpers, doctor checks, and migration support. Runs in TTY with an interactive TUI, or non-interactively in CI.
npx @better-seo/cli --help
Interactive TUI
When run with no subcommand in a TTY, the CLI opens an interactive menu (built with
@clack/prompts):
- Quick start — detect framework, print install snippet
- Generate OG — collect answers, call
generateOG - Generate icons — collect input path, write favicon set
- Doctor — validate config + adapter registration
- Crawl stubs — robots + sitemap hints
Non-Interactive / CI
In CI or piped output, the TUI is disabled. Pass --no-interactive or
-y to force:
CI=1 npx @better-seo/cli og "Hello" -o ./public/og.png
npx @better-seo/cli --no-interactive icons --input ./logo.png --out ./public
Env vars that disable TUI: CI=true, BETTER_SEO_CI=1,
BETTER_SEO_NO_TUI=1.
Command Categories
| Category | Commands | Library |
|---|---|---|
| Assets | og, icons |
@better-seo/assets |
| Crawl | crawl robots, crawl sitemap |
@better-seo/crawl |
| Content | content from-mdx |
@better-seo/compiler |
| Trust | snapshot, preview, analyze |
@better-seo/cli |
| Setup | init, doctor, migrate |
@better-seo/cli |
| Automation | scan, fix, add |
@better-seo/cli |
| Templates |
template, template switch, template preview
|
@better-seo/cli |
Next
- Full command reference — all flags, exit codes
- Recipes — OG, icons, MDX, sitemap/robots