mui-treasury
v0.4.0
Published
CLI for adding MUI Treasury components to your project
Readme
mui-treasury
CLI for adding MUI Treasury components to your project. Inspired by shadcn/ui.
Usage
npx mui-treasury add <component...>Components are written to src/mui-treasury/ in your project. No config file required.
Commands
add
mui-treasury add <component...> [options]Fetches components from the registry and writes them to your project.
| Option | Description | Default |
| ---------------------- | ------------------------- | ---------------------------- |
| -c, --cwd <path> | Target directory | . |
| -r, --registry <url> | Registry base URL | https://mui-treasury.com/r |
| -o, --overwrite | Overwrite existing files | false |
| -y, --yes | Skip confirmation prompts | false |
Examples:
# Add a single component
npx mui-treasury add ai-actions
# Add multiple components
npx mui-treasury add ai-message ai-loader ai-actions
# Target a subfolder in a monorepo
npx mui-treasury add ai-actions --cwd packages/app
# Overwrite existing files without prompting
npx mui-treasury add ai-actions --overwriteDependencies are not installed automatically. After adding components, the CLI prints the install command:
Install dependencies:
pnpm add @mui/material @emotion/react @emotion/styledHow it differs from shadcn CLI
This CLI is a simplified fork of shadcn/ui CLI with these design decisions:
- No config file — no
components.jsonneeded. Just runaddand it works. - No auto dependency install — prints the install command instead. You decide when and how to install.
- No AST transforms — files are written as-is from the registry. No import rewriting, no RSC transforms, no Tailwind config merging.
- TypeScript only — no TSX-to-JSX conversion.
- Registry URL as a flag — pass
--registryinstead of storing it in a config file. - Fixed output path — components always go to
src/mui-treasury/relative to--cwd.
Development
Prerequisites
- Node.js >= 18
- pnpm
Setup
# From the monorepo root
pnpm installBuild
cd packages/cli
pnpm buildTest locally
# Start the website dev server (serves the registry at localhost:4418)
pnpm dev --filter registry
# In another terminal — build and run the CLI from the root
pnpm dev:cli add ai-actions --cwd /tmp/test-project --registry http://localhost:4418/rWatch mode
cd packages/cli
pnpm dev # rebuilds on file changesRelease
Releases use changesets.
1. Create a changeset (after making changes)
pnpm changesetCommit the generated .changeset/*.md file with your code changes.
2. Publish
pnpm releaseThis runs: version bump → changelog update → build → commit → tag → npm publish → git push.
