@block-smith/cli
v0.1.0
Published
BlockSmith CLI — log in, scan a repo, pull promoted design rules, and wire up Cursor MCP.
Maintainers
Readme
@block-smith/cli
Command-line tool for BlockSmith — promote design in the wiki, then pull governed rules and wire up Cursor MCP from your terminal.
Self-contained: one global install, no peer packages to manage.
Install
npm install -g @block-smith/cliRequires Node.js ≥ 18.
Quick start
# 1. Create an API key in the wiki: Sync → API keys
blocksmith login --key bs_live_… --url https://blocksmith-mocha.vercel.app
# 2. Pull the rules you promoted into your repo (writes DESIGN.md + .blocksmith/)
blocksmith pull --doc upload:scan-your-kit.md
# 3. Point Cursor at the remote MCP (pinned, promoted blocks only)
blocksmith mcp-urlCommands
| Command | What it does |
|---------|--------------|
| login --key <bs_live_…> [--url <host>] | Verify and save your API key (--url defaults to the hosted SaaS). |
| whoami | Show the account the key belongs to. |
| scan [path] | Scan a local repo and upload it to the server. |
| scan --fixture vendor | Scan the demo vendor on the server. |
| scan --github <org/repo> | Scan a public GitHub repo on the server. |
| pull --doc <ref> [--workspace <path>] | Pull promoted rules into DESIGN.md (auto-detects the git repo). |
| codegen [--doc <ref>] | Generate @blocksmith/<slug> from a scan (Pulse, early). |
| mcp-url | Print the remote MCP URL for Cursor. |
| --version, --help | Version / usage. |
Config is stored at ~/.blocksmith/config.json.
blocksmith scan <localPath>needs the BlockSmith scan engine on the machine (clone the repo and setBLOCKSMITH_ROOT). For a zero-setup scan use--githubor--fixture, which run on the server.
Develop / build
# from the monorepo root
npm run build -w @block-smith/cli # bundles src + SDK into dist/cli.js
node packages/cli/dist/cli.js --helpThe build (build.mjs) bundles the workspace @blocksmith/sdk straight from
source with esbuild, so the published artifact is a single dependency-free file.
Publish (maintainers)
npm login # one time
npm publish -w @block-smith/cli # prepublishOnly rebuilds the bundle@blocksmith/sdk does not need to be published — it is bundled in.
