shadcn/studio

Command Palette

Search for a command to run...

How to use CLI

Learn how to use the shadcn/studio CLI to install components, blocks, and themes into your project seamlessly.

Overview

shadcn/studio enhances the original shadcn/ui CLI, offering an easy way to install custom components, blocks, and themes. The CLI is designed to help you quickly add ready-to-use assets without the need for NPM packages, following a simple "copy-and-paste" approach.

Setup

Before using the shadcn/studio CLI, make sure that you've installed shadcn in your project by following the official installation guide.

CLI Versions

There are two CLI versions available to accommodate different user preferences and workflows:

CLI v3

Recommended

CLI v3 allows namespaced registry for easier access:

Configuring CLI v3

To use CLI v3 with our custom content, you need to configure the components.json file in your project.

For Free Content Only

Access all free components, blocks, and themes without authentication using the free registry.

For Free + Premium Content

Access both free and premium content. Free content works without authentication, premium content requires your credentials:

Environment Variables Setup

You must create or update your .env file to store your shadcn/studio credentials.

Finding Your Credentials

  1. Email Address: Your email address used during registration (found in your account settings).
  2. License Key: Your license key will be found in your billing page.

CLI v2

Legacy

CLI v2 requires direct URLs for installation:

Installation

You can install components, blocks, and themes using the CLI commands below.

1. Installing Components

Components are enhanced versions of shadcn/ui components, with added functionality and styling.

2. Installing Blocks

Free Blocks Only

Free + Premium Blocks

3. Installing Themes

Free Themes Only

Free + Premium Themes

User-Generated Themes

Package Managers

The Shadcn CLI supports different package managers for your project:

pnpmRecommended

npm

yarn

bun

Advanced Usage

Installing Multiple Items

You can install multiple items at once by listing them:

Force Overwriting Existing Files

If you want to overwrite existing files during installation:

Troubleshooting

1. Block/Component/Theme Not Found

Solution:

  • Verify the spelling of the block/component/theme name.
  • Ensure that the block/component/theme exists in the registry.

2. Access Denied - Missing Credentials

Solution:

  • For CLI v3: Ensure your .env file contains EMAIL and LICENSE_KEY.
  • For CLI v2: Include ?email={YOUR_EMAIL}&license_key={YOUR_LICENSE_KEY} in the URL.

3. Invalid Credentials

Solution:

  • Double-check your email (it must match your registered account).
  • Verify your license key (check your purchase email).

Best Practices

Recommended Practices

  1. Use CLI v3 for simplicity and ease of use.
  2. Keep credentials secure by using environment variables or ensuring they aren't saved in command history.
  3. Regularly update your Shadcn CLI to stay up to date with new features.
  4. Customize components after installation to ensure they match your project's design requirements.