OpenCode Setup
This guide explains how to set up @f0rbit/ui with OpenCode, an AI coding assistant.
Quick Setup
Section titled “Quick Setup”Run this command in your terminal to automatically install and configure @f0rbit/ui with OpenCode:
curl -fsSL https://f0rbit.github.io/ui/opencode/setup.sh | bashThis script will:
- Detect your package manager (bun, pnpm, or npm)
- Install
@f0rbit/ui - Download the OpenCode skill for AI assistance
Manual Setup
Section titled “Manual Setup”Step 1: Install the Package
Section titled “Step 1: Install the Package”# bunbun add @f0rbit/ui
# npmnpm install @f0rbit/ui
# pnpmpnpm add @f0rbit/uiStep 2: Add the OpenCode Skill
Section titled “Step 2: Add the OpenCode Skill”Create the skill directory and download the skill file:
mkdir -p .opencode/skill/f0rbit-uicurl -sL https://f0rbit.github.io/ui/opencode/skill.md \ -o .opencode/skill/f0rbit-ui/SKILL.mdStep 3: (Optional) Add the Setup Command
Section titled “Step 3: (Optional) Add the Setup Command”If you want a reusable command for setting up @f0rbit/ui in other projects:
mkdir -p ~/.config/opencode/commandcurl -sL https://f0rbit.github.io/ui/opencode/setup-ui.md \ -o ~/.config/opencode/command/setup-ui.mdNow you can run /setup-ui in any OpenCode session.
Using with OpenCode
Section titled “Using with OpenCode”Once set up, OpenCode will automatically discover the f0rbit-ui skill. When you’re working on a task that involves @f0rbit/ui, the agent can load the skill to get full context about:
- Available components and their props
- CSS design tokens for theming
- Utility classes
- Code examples
Example Prompts
Section titled “Example Prompts”Help me create a login form using @f0rbit/ui componentsExplain the theming system in @f0rbit/ui and how to customize colorsCreate a dashboard layout with Card, Stat, and Status componentsMonorepo Support
Section titled “Monorepo Support”The setup script automatically detects monorepo structures. If you’re in a monorepo, it will prompt you to choose which package to install @f0rbit/ui in.
For manual monorepo setup:
# Install in a specific workspacecd packages/webbun add @f0rbit/ui
# The skill should be at the repo rootcd ../..mkdir -p .opencode/skill/f0rbit-uicurl -sL https://f0rbit.github.io/ui/opencode/skill.md \ -o .opencode/skill/f0rbit-ui/SKILL.mdUpdating the Skill
Section titled “Updating the Skill”To update the skill with the latest documentation:
curl -sL https://f0rbit.github.io/ui/opencode/skill.md \ -o .opencode/skill/f0rbit-ui/SKILL.mdFiles Reference
Section titled “Files Reference”| File | URL | Purpose |
|---|---|---|
| SKILL.md | /ui/opencode/skill.md | OpenCode skill with full library context |
| Setup Command | /ui/opencode/setup-ui.md | OpenCode command for project setup |
| Setup Script | /ui/opencode/setup.sh | Shell script for quick setup |