inai-react-components
v2.3.0
Published
CLI for InAI UI component library — install components from a private registry into your React project
Maintainers
Readme
inai-react-components
CLI for the InAI UI component library. Installs components, blocks, and templates from a private registry into your React project following the shadcn/ui copy-paste philosophy.
Install
npx inai-react-components initCommands
| Command | Description |
|---|---|
| inai-ui init [repo-url] | Initialize InAI UI in the current project (detects framework, writes components.json, copies tokens). |
| inai-ui add [component] | Install a component/block/template. Flags: -a/--all, -f/--force, --dry-run, --skip-existing. Transitive registryDependencies are installed automatically. |
| inai-ui sync | Pull the latest registry cache from the remote repository. |
| inai-ui list | List all available components. Flag: -c/--category. |
| inai-ui status | Report component health: HEALTHY / DRIFT / OUTDATED / MISSING. Flag: --json. |
| inai-ui diff <component> | Unified LCS-based diff between the local component and the registry version. |
| inai-ui update <component> | Update a component with a 3-way merge against the snapshot captured at install time. |
| inai-ui theme create | Create a custom theme based on an existing one. |
| inai-ui mcp | Start the MCP server so AI assistants can drive the CLI. |
| inai-ui mcp init | Print the JSON config fragment for Claude Desktop / Cursor. |
Framework detection
inai-ui init auto-detects the host framework and picks a sensible CSS entry point:
| Framework | CSS entry point |
|---|---|
| Next.js (App Router) | app/globals.css |
| Next.js (Pages Router) | styles/globals.css |
| Vite | src/index.css |
| Remix | app/styles/globals.css |
| Astro | src/styles/globals.css |
| TanStack Start | src/styles/app.css |
Snapshots & 3-way merge
Every inai-ui add captures an original-content snapshot at .inai-ui/snapshots/<name>.json. inai-ui update uses this snapshot as the common ancestor of a 3-way merge (local vs registry), so local edits survive upgrades. Overlapping edits produce standard git-style conflict markers (<<<<<<< / ======= / >>>>>>>) that you resolve in your editor.
inai-ui status uses the same snapshot hashes to report whether a component has drifted from its installed baseline.
MCP server
The CLI ships an MCP (Model Context Protocol) server so AI assistants (Claude Desktop, Cursor, any MCP-compatible host) can browse and install components on your behalf.
Register with Claude Desktop / Cursor
inai-ui mcp initThis prints a JSON fragment — drop it into your MCP host's mcpServers config:
{
"mcpServers": {
"inai-ui": {
"command": "inai-ui",
"args": ["mcp"]
}
}
}Exposed tools
| Tool | Purpose |
|---|---|
| list_components | List the full registry. Optional category filter. |
| view_component | Return the source of a single component (files wrapped in fenced blocks). |
| add_component | Install a component and its transitive deps into the current project. |
| diff_component | Unified diff between local and registry. |
| update_component | Non-interactive update via 3-way merge. |
| list_themes | Enumerate the 34 built-in themes with categories. |
| project_status | JSON status report (HEALTHY / DRIFT / OUTDATED / MISSING per component). |
The server talks stdio — your MCP host spawns inai-ui mcp and communicates with it over stdin/stdout.
