Hewn

CLI

CLI

Copy components into your project with the Hewn CLI.

stablefree

The Hewn CLI copies component source from the registry into your project. You own the code — edit it, fork it, keep it in sync with your design system.

The CLI is published on npm as hewnui — run it with npx hewnui@latest. You can also fetch free component JSON from the live registry without the CLI:

Snippet
curl -s https://hewnui.dev/r/button.json

Or browse the free registry index.

Commands

Snippet
npx hewnui@latest <command>

init

Snippet
npx hewnui@latest init

Detects your project and sets up the foundation:

  • TypeScript or JavaScript detection (presence of tsconfig.json)
  • Writes hewn.json with your component root and language
  • Copies foundation files (providers, shared styles, utilities) in the matching language variant
  • Prints the peer dependencies and CSS import to finish setup

Options: --root <dir> to change the component root (default components/hewn), --yes to skip prompts.

add

Snippet
npx hewnui@latest add button file-upload

Copies components from the free registry into your component root. Dependencies between components resolve automatically — adding file-upload also adds button and spinner. TypeScript projects receive .tsx source; JavaScript projects receive the generated .jsx variant.

Options: --overwrite to replace existing files without prompting, --yes to accept all prompts.

theme

Snippet
npx hewnui@latest theme
npx hewnui@latest theme export

theme lists installed packs and supported modes from @hewnui/themes. theme export prints local Figma kit paths (Tokens Studio JSON + sticker sheet) when generated, plus import notes.

lint

Snippet
npx hewnui@latest lint
npx hewnui@latest lint --json
npx hewnui@latest lint --fix

Checks tokens-only colour usage, theme AA contrast, reduced-motion patterns, labelled overlays, and destructive confirm heuristics. See CLI lint for the rule reference, hewn.json config, and JSON schema.

Registry URL

The CLI fetches registry JSON from the canonical site origin (https://hewnui.dev by default). Override for local development or mirrors:

Snippet
HEWN_REGISTRY_URL=https://your-mirror.example.com npx hewnui@latest add button

npx hewnui@latest init can also set a per-project registry field in hewn.json. Installed globally or as a devDependency, the package also provides a short hewn alias.

npm, Hewn CLI, or shadcn?

All paths ship the same canonical source: install @hewnui/ui from npm, copy components with the Hewn CLI, or fetch the live /r/*.json registry. When your project already uses components.json, see the shadcn CLI registry.

On this page