Installation
Get started with shadcnai in just a few simple steps.
Requirements
- Node.js ≥ 18.0.0
- npm ≥ 9.0.0 (or equivalent with yarn, pnpm, bun)
- A shadcn/ui project (optional for theme generation, required for auto-import)
Global Installation
Install shadcnai globally to use it from anywhere:
npm install -g shadcnai
Or with other package managers:
# Yarn
yarn global add shadcnai
# pnpm
pnpm add -g shadcnai
# Bun
bun add -g shadcnai
Local Installation
You can also run shadcnai without installing it globally:
# Using npx (recommended)
npx shadcnai theme "your theme description"
# Or install locally
npm install shadcnai
npx shadcnai theme "your theme description"
Verification
Verify your installation by checking the version:
shadcnai --version
Or view the help:
shadcnai --help
You should see output similar to:
shadcnai <command> [options]
Commands:
shadcnai theme <description> Generate a shadcn/ui theme based on description
Options:
--help, -h Show help [boolean]
--version, -v Show version number [boolean]
Setting Up API Keys
shadcnai requires API keys from AI providers. The default model uses Google AI, but you can configure multiple providers.
Quick Setup (Default Model)
For the default Gemini 2.5 Flash model:
export GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-key
Complete Setup (All Models)
To use all available models, set up the respective API keys:
# Google AI (default)
export GOOGLE_GENERATIVE_AI_API_KEY=your-google-ai-key
# OpenAI
export OPENAI_API_KEY=your-openai-key
# Anthropic
export ANTHROPIC_API_KEY=your-anthropic-key
# xAI
export XAI_API_KEY=your-xai-key
# DeepSeek
export DEEPSEEK_API_KEY=your-deepseek-key
# Mistral
export MISTRAL_API_KEY=your-mistral-key
# Cerebras
export CEREBRAS_API_KEY=your-cerebras-key
Persistent Environment Variables
To make environment variables persistent, add them to your shell profile:
Bash/Zsh (~/.bashrc or ~/.zshrc):
echo 'export GOOGLE_GENERATIVE_AI_API_KEY=your-key-here' >> ~/.zshrc
source ~/.zshrc
Fish (~/.config/fish/config.fish):
set -Ux GOOGLE_GENERATIVE_AI_API_KEY your-key-here
Getting API Keys
Here's how to obtain API keys for each provider:
Google AI
- Visit Google AI Studio
- Click "Create API Key"
- Copy your key
OpenAI
- Go to OpenAI API Keys
- Click "Create new secret key"
- Copy your key
Anthropic
- Visit Anthropic Console
- Go to "API Keys" section
- Generate a new key
xAI
- Go to xAI Console
- Navigate to API Keys
- Create a new key
DeepSeek
- Visit DeepSeek Platform
- Access API Keys section
- Generate new key
Mistral
- Go to Mistral Console
- Find API Keys section
- Create new key
Cerebras
- Visit Cerebras Inference
- Access your dashboard
- Generate API key
Next Steps
With shadcnai installed and configured, you're ready to start generating themes! Continue to Configuration to learn about customization options, or jump straight to Usage to start creating themes.