shopcn
v0.1.1
Published
CLI for managing shopcn components
Readme
shopcn CLI
A command-line interface for managing shadcn component registries on the shopcn marketplace. This CLI tool allows component creators to easily upload and manage their shadcn components for sale on the platform.
Overview
shopcn is an open-source marketplace where creators can monetize their shadcn UI components and templates. The CLI provides a streamlined workflow for component authors to publish their work to the registry.
Installation
npx shopcn@latestAuthentication
Before using the CLI, you need to authenticate with your shopcn server:
npx shopcn loginThis command will:
- Prompt you to enter your server URL (defaults to
http://localhost:8080) - Open your browser to the authentication page
- Ask you to paste the generated API key from the browser
Your credentials are securely stored locally using the conf library.
Commands
npx shopcn loginInteractive prompts:
- Server URL (with validation)
- API key (generated through browser authentication)
npx shopcn add <registry.json>Arguments:
<registry.json>- Path to your component registry file
What it does:
- Validates the JSON file format
- Creates a draft on your shopcn server
- Opens the draft URL in your browser for further editing
- Returns a draft ID for reference
Example:
npx shopcn add ./my-component/registry.jsonnpx shopcn helpConfiguration
Configuration is stored in your system's standard config directory using the conf library:
| Platform | Path |
|----------|------|
| macOS | ~/Library/Preferences/shopcn-cli/ |
| Linux | ~/.config/shopcn-cli/ |
| Windows | %APPDATA%\shopcn-cli\ |
Stored data includes:
- Server URL
- API key
Development
Tech Stack
| Technology | Purpose | |------------|---------| | TypeScript | Type safety | | Commander.js | Command parsing | | Inquirer.js | Interactive prompts | | tRPC | Type-safe API communication | | Chalk | Colored terminal output | | Ora | Loading spinners | | tsup | Bundling |
Build
bun run buildDevelopment Mode
bun run devSupport
For issues and feature requests, visit the shopcn repository.
Made with ❤️ for the shadcn community
