@operatorgrade/cli
v0.1.1
Published
Operator-Grade design system CLI: agent cheat sheet, component/token/doc lookup, and the zero-hardcoded-values check.
Maintainers
Readme
@operatorgrade/cli
Scriptable lookup for the Operator-Grade design system, built for AI agents and CI. The published package reads baked JSON only — no component source, no build step, no runtime dependencies.
Install & reliable invocation
npm i -D @operatorgrade/cliAdd a script so agents and CI invoke it deterministically (no PATH guessing):
"scripts": {
"operator": "node node_modules/@operatorgrade/cli/bin/operator.mjs"
}Commands
| Command | Behavior |
| --- | --- |
| operator init [--all] | Write the AGENTS.md + CLAUDE.md agent cheat sheet (non-interactive, idempotent; --all adds theming + page-building pointers). |
| operator component [Name] | List components, or print one's props, intents/sizes, import, do/don't. |
| operator tokens [group] | List token groups, or print tokens with resolved Day / Night-NVG / Mono values — e.g. operator tokens semantic.color.threat. |
| operator docs [topic] | List doc topics or print one (getting-started, theme-as-mode, standards, …). |
| operator template [--list \| <name>] | List @operatorgrade/templates page templates, or print one's usage. |
| operator check | Run the zero-hardcoded-values token gate; exits non-zero on a raw value. |
For a live agent connection
operator init gives the buyer's agent a file; @operatorgrade/mcp exposes the
same catalog/tokens/docs over the Model Context Protocol for a live connection.
Development (this monorepo)
data/*.json is baked from the component source, token JSON, and docs by
npm run build:data -w @operatorgrade/cli (also runs on prepublishOnly).
npm test -w @operatorgrade/cli includes a drift check: if source changed
without a rebake, it fails.
