
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
A production-ready template for building your own component registry with shadcn/ui compatibility and custom CLI tooling.
This starter kit provides everything you need to create, maintain, and distribute a component registry similar to shadcn/ui. Built with modern tooling and best practices, it enables developers to build their own design systems with seamless CLI integration.
npx your-registry add component CLIThis monorepo is built with Turborepo and follows a modular architecture:
design-registry-starter/
├── apps/
│ └── docs/ # Next.js documentation site
│ ├── app/ # App router pages
│ ├── content/ # MDX documentation
│ └── public/registry/ # Generated component registry
├── packages/
│ ├── ai/ # AI-specific components
│ ├── code-block/ # Code display components
│ ├── editor/ # Editor components
│ ├── shadcn-ui/ # Base shadcn/ui components
│ ├── snippet/ # Code snippet components
│ └── ui/ # Custom UI components
├── scripts/
│ ├── index.ts # CLI entry point
│ ├── generate-registry.js # Registry generation
│ ├── discover-components.js # Component discovery
│ └── register-all-components.js # Batch registration
└── dist/
└── index.js # Built CLI executable
npx your-registry add component)# Clone the repository
git clone https://github.com/your-username/design-registry-starter.git
cd design-registry-starter
# Install dependencies
pnpm install
# Start development server
pnpm dev
The documentation site will be available at http://localhost:3422
Edit package.json to reflect your registry:
{
"name": "your-registry-name",
"description": "Your custom component registry",
"homepage": "https://your-registry.com",
"repository": {
"type": "git",
"url": "https://github.com/your-username/your-registry.git"
},
"bin": {
"your-cli": "dist/index.js"
}
}
Modify scripts/index.ts to customize your CLI:
// Update the registry URL
const url = new URL(
`registry/${packageName}.json`,
'https://your-registry.com/' // Your registry URL
);
Create a new package in packages/:
mkdir packages/your-component
cd packages/your-component
Create the component structure:
packages/your-component/
├── package.json
├── src/
│ └── index.tsx
└── README.md
package.json:
{
"name": "@repo/your-component",
"version": "0.0.1",
"private": true,
"main": "src/index.tsx",
"types": "src/index.tsx"
}
src/index.tsx:
import React from 'react';
import { cn } from '@/lib/utils';
export interface YourComponentProps {
className?: string;
children?: React.ReactNode;
}
export const YourComponent = ({ className, children, ...props }: YourComponentProps) => {
return (
<div className={cn('your-component-styles', className)} {...props}>
{children}
</div>
);
};
export default YourComponent;
This starter kit includes an automated registry generation system that scans your components and builds the complete registry with a single command.
Quick Start - Build Complete Registry:
# Generate and build the complete registry in one command
pnpm run registry
This command will:
registry.json file with proper shadcn/ui schemapublic/r/For more granular control, you can run each step separately:
# 1. Generate the registry.json file by scanning packages
pnpm run gen:registry
# 2. Build the registry (creates individual JSON files)
pnpm run build:registry
The automated system:
packages/ directory: Automatically discovers all TypeScript/TSX component fileseslint-config, typescript-config, and shadcn-ui packagesai package to create individual registry entriesWhen you add new components:
packages/ directorypnpm run registry to regenerate the complete registryThe automated process creates:
registry.json - Main registry file with all component metadatapublic/r/[component].json - Individual component files for CLI consumptionEach component generates a registry file like this:
{
"name": "your-component",
"description": "A custom component for your design system",
"dependencies": ["@radix-ui/react-slot"],
"devDependencies": ["@types/react"],
"registryDependencies": ["utils"],
"files": [
{
"name": "your-component.tsx",
"content": "...component source code..."
}
],
"type": "components:ui"
}
The scripts/generateRegistry.ts file is the heart of the automated registry system. Here's how it works:
packages/ directory for all subdirectories.ts and .tsx files while excluding test filesai packageTo customize the registry generation for your needs:
COMPONENT_DESCRIPTIONS object in scripts/generateRegistry.ts:const COMPONENT_DESCRIPTIONS: Record<string, string> = {
'your-component': 'Description of your component',
'another-component': 'Another component description',
// Add your components here
};
excludedPackages array:const excludedPackages = ['eslint-config', 'typescript-config', 'your-excluded-package'];
const registry: Registry = {
$schema: 'https://ui.shadcn.com/schema/registry.json',
name: 'your-registry-name',
homepage: 'https://your-registry-homepage.com',
items: allItems
};
When you run pnpm run gen:registry, you'll see output like:
🔍 Scanning packages directory...
📦 Processing package: ai
📦 Processing package: code-block
📦 Processing package: editor
✅ Registry generated successfully!
📄 Generated 14 component(s):
- ai-branch: AI conversation branch component
- code-block: Enhanced code block component
- editor: Code editor component
💾 Registry saved to: registry.json
# Build the CLI
pnpm build:cli
# Test the CLI locally
pnpm test:cli
Ensure your registry is complete:
# Generate and build the complete registry
pnpm run registry
# Build the CLI
pnpm run build:cli
# Build the documentation site
pnpm run build
# Patch version (bug fixes)
pnpm publish:patch
# Minor version (new features)
pnpm publish:minor
# Major version (breaking changes)
pnpm publish:major
Deploy your docs site to Vercel, Netlify, or your preferred platform:
# For Vercel
vercel --prod
# For Netlify
netlify deploy --prod --dir=apps/docs/out
Once published, users can install components from your registry:
# Install your CLI globally or use with npx
npx your-registry-name add button card dialog
# Or install globally
npm install -g your-registry-name
your-registry-name add button
# Start development server
pnpm dev
# Add new components to packages/
# Regenerate the complete registry
pnpm run registry
# Test CLI locally
pnpm run test:cli
# Lint code
pnpm lint
# Format code
pnpm format
# Type checking
pnpm build
# Validate registry
pnpm validate:registry
pnpm discover:components
pnpm register:all
pnpm generate:registry
pnpm build:cli
pnpm test:cli
pnpm publish:minor # or patch/major
| Script | Description |
|---|---|
pnpm dev | Start development server |
pnpm build | Build all packages and apps |
pnpm build:cli | Build CLI executable |
pnpm test:cli | Test CLI locally |
pnpm run gen:registry | Generate registry.json by scanning packages |
pnpm run build:registry | Build individual component JSON files |
pnpm run registry | Complete registry generation and build |
pnpm publish:patch/minor/major | Version bump and publish |
pnpm lint | Lint codebase |
pnpm format | Format code |
pnpm clean | Clean node_modules and build artifacts |
pnpm bump-deps | Update all dependencies |
pnpm bump-ui | Update shadcn/ui components |
pnpm run registry after adding new components to regenerate the complete registryscripts/generateRegistry.ts for new componentspnpm run test:cli before publishingContributions are welcome! Please read our contributing guidelines and submit pull requests for any improvements.
git clone https://github.com/your-username/design-registry-starter.gitpnpm installgit checkout -b feature/amazing-featureThis project is licensed under the MIT License. See the LICENSE file for details.
Ready to build your own component registry? 🚀
Start by cloning this repository and following the setup instructions above. Within minutes, you'll have a fully functional component registry with CLI distribution capabilities!
FAQs
CLI tool for adding components from the Devcn UI Design Registry
The npm package devcn-ui receives a total of 0 weekly downloads. As such, devcn-ui popularity was classified as not popular.
We found that devcn-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.