meine
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
generate custom shadcn-cli registry items and JSON files
git clone https://github.com/Alwurts/simple-shadcn-cli.gitAlwurts/simple-shadcn-cliA CLI tool for creating shadcn-cli custom registry items
The tool currently supports the following shadcn CLI registry types:
registry:ui - UI componentsregistry:lib - Library utilitiesregistry:hook - React hooksThe CLI provides two main commands:
# For interactive creation of single registry items npx simple-shadcn-cli create # For building registry items from your project npx simple-shadcn-cli build
The create command guides you through an interactive process to create individual registry items:
Specify output directory (defaults to public/registry)
Enter registry item details:
Add one or more files:
The build command is designed for projects that want to maintain their registry components within their codebase. It automatically processes your registry components and generates the required JSON files.
Checkout the example project for a complete Vite and React.js example of how to use the build command.
To use the build command:
simple-shadcn.json configuration file in your project root:{
"outputDir": "public/registry",
"registryDirectory": "src/registry"
}
Configuration options:
outputDir: Directory where the generated JSON files will be savedregistryDirectory: Directory containing your registry configuration and componentsindex.ts or index.js file that exports your registry configuration:export const registry = [
{
name: "button-big",
type: "registry:ui",
description: "A big button component",
files: [
{
path: "ui/button-big.tsx",
type: "registry:ui"
}
]
}
// ... more registry items
];
npx simple-shadcn-cli build
The command will:
The CLI exports TypeScript types for the registry schema, making it easier to type your registry configuration:
import type { Registry, RegistryItem, RegistryItemFile } from "simple-shadcn-cli";
// Your registry configuration with proper typing
export const registry: Registry = [
{
name: "button-big",
type: "registry:ui",
description: "A big button component",
files: [
{
path: "ui/button-big.tsx",
type: "registry:ui"
}
]
}
];
Available types:
Registry: Array of registry itemsRegistryItem: Single registry item configurationRegistryItemFile: File configuration within a registry itemThe tool generates JSON files with the following structure:
{
"name": "component-name",
"type": "registry:ui",
"description": "Optional description",
"dependencies": ["optional-dependencies"],
"devDependencies": ["optional-dev-dependencies"],
"registryDependencies": ["optional-registry-dependencies"],
"files": [
{
"path": "ui/component.tsx",
"type": "registry:ui",
"content": "file content here"
}
]
}
To use your registry items with the shadcn-cli, expose the created JSON files. For example, you can add them to your website public folder or expose them as Github Gists.
Create a gist with the JSON file
Get the gist raw url
Use the gist raw url with the shadcn-cli add command
npx shadcn@latest add https://gist.githubusercontent.com/your-username/your-gist-id/raw/your-file.json
To set up the development environment:
# Clone the repository git clone <repository-url> cd simple-shadcn-cli # Install dependencies npm install # Build the project npm run build # Run in development mode npm run dev
MIT
more like this
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
search projects, people, and tags