Copy-paste workflow

The damo-ui CLI

Prefer to own the source of your components instead of importing them from a package? The CLI copies each component straight into your codebase — shadcn-style — so you can read, tweak and version every line.

Both models are supported: keep using npm install damo-ui for the zero-config package, or use the CLI below for copy-paste. The CLI is components.json-compatible, so if you already use shadcn it will feel familiar.

1. Initialize

Creates a components.json (it detects a src/ layout and your global stylesheet automatically):

terminal
npx @axologic/cli init
components.json
1{
2  "$schema": "https://ui.shadcn.com/schema.json",
3  "tsx": true,
4  "tailwind": { "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true },
5  "aliases": {
6    "components": "@/components",
7    "ui": "@/components/ui",
8    "lib": "@/lib",
9    "hooks": "@/hooks"
10  }
11}

2. Add components

add resolves a component and everything it needs — other components, the cn helper, the icon set, i18n — then installs the union of npm dependencies with your package manager:

terminal
1# add components (pulls cn / icons / i18n + installs npm deps)
2npx @axologic/cli add button dialog
3
4# or straight from a URL
5npx @axologic/cli add https://damo-ui.com/r/ui/button.json

Adding button writes, for example:

result
1components/ui/button/button.tsx
2components/ui/button/button.variants.ts
3components/ui/button/index.ts
4lib/cn.ts            # pulled in automatically (transitive dependency)

3. Browse the registry

terminal
npx @axologic/cli list

Already on the npm package?

If you import from damo-ui today, one command converts the whole project to copy-paste — it rewrites every import (named, type-only, aliased, mixed), copies the used components, and drops damo-ui from package.json. It is idempotent and TypeScript-aware; preview with --dry-run first.

terminal
1# preview the changes first
2npx @axologic/cli codemod migrate-from-npm --dry-run
3
4# then apply
5npx @axologic/cli codemod migrate-from-npm

For AI agents (MCP)

There's also an MCP server, @axologic/mcp, so agents like Claude Code or Cursor can search, read, and add components for you. Point your client at it:

.mcp.json
1// .mcp.json (Claude Code) — or ~/.cursor/mcp.json (Cursor)
2{
3  "mcpServers": {
4    "damo-ui": { "command": "npx", "args": ["-y", "@axologic/mcp"] }
5  }
6}

Notes

  • Re-running add skips files that already exist — pass --overwrite to replace them.
  • Pass --no-deps to skip installing npm packages, or --registry <url> to point at a different registry.
  • The init / add / list commands need only Node ≥ 18; the codemod additionally uses ts-morph for the AST rewrite.