CLI
CLI
Copy components into your project with the Hewn CLI.
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:
Or browse the free registry index.
Commands
init
Detects your project and sets up the foundation:
- TypeScript or JavaScript detection (presence of
tsconfig.json) - Writes
hewn.jsonwith 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
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
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
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:
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.