kosal
v1.0.8
Published
A custom CLI for installing components from the Kosal component registry - simplifies shadcn/ui component installation with short commands
Downloads
11
Maintainers
Readme
Kosal CLI
A custom CLI tool for installing components from the Kosal registry.
Installation
Global Installation (Recommended)
npm install -g kosalLocal Installation
npm install kosalUsing npx (No Installation)
npx kosal@latest init
npx kosal@latest add <component-name>Usage
Initialize a project
kosal initThis command will:
- Add kosal configuration to your
package.json - Install the
shadcndependency - Set up the necessary aliases and configuration
Add a component
kosal add <component-name>Examples:
kosal add hello-world
kosal add workos
kosal add sidebar
kosal add complex-componentUse a custom registry
kosal add <component-name> --registry https://your-registry.comAvailable Components
Based on your registry, you can install:
hello-world- A simple hello world componentexample-form- A contact form with Zod validationcomplex-component- A complex component with hooks, libs and componentsexample-with-css- A login form with a CSS filespinner- A spinner component with different size variantsuse-mobile- A hook that detects if the user is on a mobile devicesidebar- A responsive sidebar componentsimple-sidebar- A simple sidebar examplesidebar-example- A complete sidebar examplesplit-display- A 3D video display componentworkos- Complete authentication block with WorkOS AuthKit
Configuration
The CLI looks for configuration in the following order:
- Command line options (e.g.,
--registry) kosal.registryfield inpackage.json- Default registry:
https://components-kosal.vercel.app
Development
Building the CLI
cd kosal-cli
npm install
npm run buildTesting locally
npm link
kosal init
kosal add hello-worldPublishing to npm
npm publishHow it Works
The Kosal CLI is a wrapper around the shadcn CLI that:
- Simplifies commands: Instead of typing long URLs, you just use component names
- Manages dependencies: Automatically installs npm dependencies and registry dependencies
- Handles configuration: Sets up your project with the right configuration
- Provides feedback: Shows progress and results with nice formatting
The CLI fetches component data from your registry JSON files and uses the shadcn CLI internally to install components, ensuring compatibility with the existing ecosystem.
