Installing Cedar-OS
With Cedar-CLI
1
Check Prerequisites
Cedar-OS requires:
- React 18.2.0 or higher
- React DOM 18.2.0 or higher
- Node.js 18+ (for development)
- ✅ Next.js (Recommended) - Full support with optimal performance
- ✅ Create React App - Supported with additional configuration
- ✅ Vite + React - Supported with additional configuration
- ✅ Other React frameworks - May require manual setup
2
Install using the cedar-os-cli
Our CLI is the fastest way to get started with Cedar-OS. For most users, run this command - it automatically detects your setup and does the right thing:What Using CLI flagsYou can skip prompts using the
plant-seed
does:-
New project: Offers template selection → Creates project → Adds Cedar components
Recommended: We highly recommend starting with the Mastra template. It requires the least configuration and is the most powerful way to use Cedar-OS.
- Existing Next.js project: Automatically adds Cedar components and required dependencies to your project
- Existing React project: Adds Cedar components with a note about Next.js being optimal
add-sapling
instead:Use this command to install cedar-os and download Cedar components in an existing project if plant-seed
fails.--yes
flag:3
Add your API key
Create a Choose based on your setup:
.env.local
file in your project root and add your OpenAI API key:- Use
NEXT_PUBLIC_OPENAI_API_KEY
if Cedar-OS will make API calls directly from the browser - Use
OPENAI_API_KEY
if you’re routing calls through your backend/API routes - You can include both if you need access from both client and server
4
Initialize CedarCopilot
Wrap your app with the See Agent Backend Connection for more details. Now you’re ready to add a chat!
CedarCopilot
component and configure your AI provider:Important: CedarCopilot must be used in a client component. Add
"use client"
at the top of any file that uses CedarCopilot.5
Using Cedar
Now that you have Cedar-OS installed and configured, here are your next steps to build your AI-native application:Choose your next feature:
- Configuring a Chat - Set up chat interfaces with
ChatInput
andChatBubbles
components for seamless AI conversations - Adding State Access - Enable AI agents to read and modify your application state using
useCedarState
- Using Spells - Create interactive radial menus and quick actions for enhanced user experience
Next Steps
Now that you have Cedar-OS set up with basic functionality:- Explore Advanced Features: Check out Voice Integration, Custom Message Types, and Advanced State Management.
- Try Different Providers: Experiment with Mastra for full-featured agents or Direct Provider Integration.
- Customize the UI: Learn about Styling and Theming to match your brand.
- Build Complex Workflows: Explore our Examples to see Cedar-OS in action with real applications.
If Things Are Going Wrong
Manual Installation (CLI Fallback)
Look at our CLI guide for more options of CLI commands you can try. If all CLI commands are failing, you can manually install Cedar-OS:1
Install the cedar-os package
2
Copy component source code
You will need to manually copy the component source code locally. The component files can be found here: Cedar-OS ComponentsCopy the components you need into your project’s component directory (typically
src/components/cedar-os/
).3
Install dependencies
First set up Tailwind CSS (required for Cedar styling) (look at these docs for framework specific instructions)Then install the runtime dependencies for Cedar-OS components:
Troubleshooting Common Issues
Components not rendering: Make sure you’ve wrapped your app withCedarCopilot
.
Components missing ALL styling: If Cedar-OS components are missing all styling (we promise they are beautiful!), make sure you have Tailwind CSS configured in your project.
Don’t see the chat?: Make sure you add the correct chat component inside the <CedarCopilot>
boundary. See Chat Overview for setup instructions.
AI calls failing: Check that your API keys are correctly set in environment variables and accessible in your client code.
Using with non-Next.js frameworks: While Cedar-OS works with Create React App, Vite, and other React frameworks, you may need to manually configure Tailwind CSS and ensure proper client-side rendering for optimal performance.
TypeScript errors: Cedar-OS is fully typed - check that you’re importing types correctly and using the right component props.
Need help? Check our Community Discord or GitHub Issues. We’re always here to help :-D