sapient-ai
v0.2.0
Published
CLI for Sapient design-system presets and registry components
Maintainers
Readme
sapient-ai CLI
Thin wrapper around shadcn for Sapient registry usage.
Commands
sapient-ai initsapient-ai init --preset <handle-or-id> --template nextsapient-ai add <component>sapient-ai add-icons <design-system|lucide|remix>sapient-ai shadcn <args...>
Behavior
initruns Sapient's setup flow, can offer a Design System picker when no preset is specified, then initializes the repo and adds@sapientregistry tocomponents.json.init --preset <handle-or-id>fetches a saved design-system preset and writes Sapient artifact files into.sapient/, includingdesign-system.md,sapient-design-system-config.json,tokens.json, andsapient-components.json.- The CLI also generates a
sapient-theme.cssfile next to the app'sglobals.cssfile and imports it automatically so the runtime theme matches the exported Sapient preset. - The CLI installs a small Sapient foundation pack by default, then adds any additional registry components inferred from the preset.
- When the preset references supported Sapient registry items, the CLI also runs
shadcn addfor those components automatically. - When the preset uses
lucideorremix, the CLI also installs the matching icon package automatically. add-icons <library>updates local Sapient config and installs the matching icon package for an existing project.add buttonis rewritten toadd @sapient/button.- Pass fully-qualified names (
@scope/name) unchanged. - Internally,
initstill usesshadcnfor project wiring, but it now supplies Sapient-owned defaults so the user does not have to answer the underlyingshadcnprompts.
Local test
npm pack ./packages/cli
npx --yes ./sapient-ai-0.2.0.tgz --helpRegistry URL
Default: https://sapient-playground-design-system.vercel.app/r/{name}.json
Override:
SAPIENT_REGISTRY_URL="https://your-domain/r/{name}.json" npx sapient-ai@latest initPreset API URL
Default: https://sapient-playground-design-system.vercel.app/api/presets
Override for local development:
SAPIENT_PRESET_BASE_URL="http://localhost:3002/api/presets" npx sapient-ai@latest init --preset ferrari --template next