| name | oh-my-opencode-installation |
| description | Smart installation and configuration for OpenCode with oh-my-opencode harness - detects existing installation and only installs if needed. Use when working with oh my opencode installation. |
| domain | integrations |
| author | oyi77 |
| license | Apache-2.0 |
| subdomain | integrations |
| tags | ["api","installation","integrations","opencode","third-party"] |
| version | 1.0.0 |
Oh My OpenCode Installation
Overview
This skill provides intelligent installation and configuration guidance for OpenCode and the oh-my-opencode harness. It first detects what's already installed and only proceeds with installation if needed.
When to Use
Trigger phrases:
-
"oh my opencode installation"
-
"Smart installation and configuration for OpenCode with oh-my-opencode harness - "
-
First-time setup – When OpenCode and oh-my-opencode need to be installed from scratch
-
Reinstall/upgrade – When reinstalling or updating oh-my-opencode to latest version
-
Migration – When moving OpenCode configuration to new machine or environment
-
Troubleshooting – When installation issues need to be diagnosed and resolved
-
Automated setup – When scripting OpenCode and oh-my-opencode installation for CI/CD
-
Mixed environments – When OpenCode is installed but oh-my-opencode is not, or vice versa
Detection First
This section covers detection first for the oh-my-opencode-installation skill.
Key operations include input validation, core processing, and output verification.
Refer to the skill overview for detailed usage instructions.
Step 1: Detect Existing Installation
Check if OpenCode is installed:
if command -v opencode &> /dev/null; then
OPENCODE_VERSION=$(opencode --version 2>/dev/null || echo "unknown")
echo "✓ OpenCode is already installed: $OPENCODE_VERSION"
OPENCODE_INSTALLED=true
else
echo "✗ OpenCode is not installed"
OPENCODE_INSTALLED=false
fi
Check if oh-my-opencode is installed:
if command -v oh-my-opencode &> /dev/null; then
OMO_VERSION=$(oh-my-opencode --version 2>/dev/null || echo "unknown")
echo "✓ oh-my-opencode is already installed: $OMO_VERSION"
OMO_INSTALLED=true
elif npm list -g oh-my-opencode &> /dev/null; then
OMO_VERSION=$(npm list -g oh-my-opencode --depth=0 2>/dev/null | grep oh-my-opencode || echo "installed")
echo "✓ oh-my-opencode npm package is installed"
OMO_INSTALLED=true
else
echo "✗ oh-my-opencode is not installed"
OMO_INSTALLED=false
fi
Check Node.js version:
if command -v node &> /dev/null; then
NODE_VERSION=$(node --version)
NODE_MAJOR=$(echo $NODE_VERSION | cut -d'.' -f1 | sed 's/v//')
if [ "$NODE_MAJOR" -ge 18 ]; then
echo "✓ Node.js version: $NODE_VERSION (meets requirement)"
else
echo "✗ Node.js version: $NODE_VERSION (need 18+)"
fi
else
echo "✗ Node.js is not installed"
fi
Step 2: Conditional Installation
Only install if detected as missing:
if [ "$OPENCODE_INSTALLED" = true ] && [ "$OMO_INSTALLED" = true ]; then
echo "✓ Both OpenCode and oh-my-opencode are installed. Skipping installation."
echo "Run 'opencode' to start or 'oh-my-opencode --help' for options."
elif [ "$OPENCODE_INSTALLED" = true ]; then
echo "→ OpenCode is installed. Installing oh-my-opencode only..."
install_oh_my_opencode
elif [ "$OMO_INSTALLED" = true ]; then
echo "→ oh-my-opencode is installed. Installing OpenCode only..."
install_opencode
else
echo "→ Neither is installed. Installing both..."
install_opencode
install_oh_my_opencode
fi
Prerequisites
This section covers prerequisites for the oh-my-opencode-installation skill.
Key operations include input validation, core processing, and output verification.
Refer to the skill overview for detailed usage instructions.
System Requirements
- Platform: macOS, Linux, Windows (WSL recommended)
- Terminal: WezTerm, Alacritty, Ghostty, or Kitty
- Node.js: Version 18+ (required for oh-my-opencode)
- API Keys: For LLM providers you want to use
Recommended Setup
- Terminal: WezTerm (cross-platform, excellent performance)
- Shell: zsh or bash with oh-my-zsh
- Git: Latest version with proper configuration
Installation Functions
This section covers installation functions for the oh-my-opencode-installation skill.
Key operations include input validation, core processing, and output verification.
Refer to the skill overview for detailed usage instructions.
install_opencode()
install_opencode() {
echo "Installing OpenCode..."
if [[ "$OSTYPE" == "darwin"* ]]; then
if command -v brew &> /dev/null; then
brew install anomalyco/tap/opencode
else
curl -fsSL https://opencode.ai/install | bash
fi
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
if command -v pacman &> /dev/null; then
sudo pacman -S opencode
elif command -v apt &> /dev/null; then
curl -fsSL https://opencode.ai/install | bash
else
curl -fsSL https://opencode.ai/install | bash
fi
else
curl -fsSL https://opencode.ai/install | bash
fi
if command -v opencode &> /dev/null; then
echo "✓ OpenCode installed successfully: $(opencode --version)"
else
echo "✗ OpenCode installation failed"
return 1
fi
}
install_oh_my_opencode()
install_oh_my_opencode() {
echo "Installing oh-my-opencode..."
if ! command -v node &> /dev/null; then
echo "✗ Node.js is required but not installed. Please install Node.js 18+ first."
return 1
fi
NODE_MAJOR=$(node --version | cut -d'.' -f1 | sed 's/v//')
if [ "$NODE_MAJOR" -lt 18 ]; then
echo "✗ Node.js 18+ is required. Current version: $(node --version)"
return 1
fi
if ! command -v npm &> /dev/null; then
echo "✗ npm is required but not installed."
return 1
fi
echo "Installing oh-my-opencode via npm..."
npm install -g oh-my-opencode
if command -v oh-my-opencode &> /dev/null; then
echo "✓ oh-my-opencode installed successfully: $(oh-my-opencode --version)"
else
echo "✗ oh-my-opencode installation failed"
1
}
full_installation()
full_installation() {
echo "========================================="
echo "Oh My OpenCode Smart Installation"
echo "========================================="
echo ""
echo "Phase 1: Detection"
echo "------------------"
detect_installation
echo ""
echo "Phase 2: Installation"
echo "---------------------"
install_if_needed
echo ""
echo "Phase 3: Configuration"
echo "----------------------"
configure_installation
echo ""
echo "Phase 4: Verification"
echo "---------------------"
verify_installation
echo ""
echo "========================================="
echo "Installation Complete!"
echo "========================================="
}
Installation Methods
This section covers installation methods for the oh-my-opencode-installation skill.
Key operations include input validation, core processing, and output verification.
Refer to the skill overview for detailed usage instructions.
Method 1: Quick Install (Recommended)
For humans:
curl -fsSL https://opencode.ai/install | bash
npm install -g oh-my-opencode
Method 2: Node.js Installation
npm install -g opencode-ai oh-my-opencode
bun install -g opencode-ai oh-my-opencode
pnpm install -g opencode-ai oh-my-opencode
Method 3: Homebrew (macOS)
brew install anomalyco/tap/opencode
npm install -g oh-my-opencode
Method 4: For LLM Agents
bash -c "$(curl -fsSL https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/refs/heads/master/docs/guide/installation.sh)"
Configuration
{
"enabled": true,
"autoRun": false,
"timeout": 30000,
"retries": 3
}
Set environment variables as needed for authentication and endpoints.
Initial Setup After Installation
-
Verify installation worked:
opencode --version
oh-my-opencode --version
-
Initialize a project:
cd /path/to/project
opencode
/init
-
Configure LLM provider:
/connect
-
Configure oh-my-opencode:
oh-my-opencode install
Config File Locations
| Level | Location |
|---|
| Project | .opencode/opencode.jsonc |
| User | ~/.config/opencode/opencode.jsonc |
| oh-my-opencode Project | .opencode/oh-my-opencode.jsonc |
| oh-my-opencode User | ~/.config/opencode/oh-my-opencode.jsonc |
Basic Configuration
{
"plugin": ["oh-my-opencode"],
"model": {
"main": "openai/gpt-4o",
"fallback": ["anthropic/claude-3-5-sonnet-20241022"]
}
}
Verification
This section covers verification for the oh-my-opencode-installation skill.
Key operations include input validation, core processing, and output verification.
Refer to the skill overview for detailed usage instructions.
Quick Verification Checklist
opencode --version && echo "✓ OpenCode OK"
oh-my-opencode --version && echo "✓ oh-my-opencode OK"
opencode --help > /dev/null 2>&1 && echo "✓ OpenCode CLI OK"
[ -f ~/.config/opencode/opencode.json ] && echo "✓ Config OK"
node --version && echo "✓ Node.js OK"
npm --version && echo "✓ npm OK"
Test Basic Functionality
opencode --eval "/help"
opencode --eval "/status"
Integration with OpenClaw
- Connects with existing toolchain via standard interfaces
- Supports webhook-based event notifications
- Compatible with CI/CD pipelines for automated workflows
- Provides structured output for downstream consumption
For OpenClaw Integration
which opencode && echo "✓ OpenCode in PATH"
mkdir -p ~/.config/opencode
cat > ~/.config/opencode/oh-my-opencode.jsonc << 'EOF'
{
"agents": {
"sisyphus": { "model": "openai/gpt-4o" },
"hephaestus": { "model": "openai/gpt-4o" },
"oracle": { "model": "anthropic/claude-3-5-sonnet-20241022" }
}
}
EOF
echo "✓ OpenClaw integration configured"
Troubleshooting
| Symptom | Cause | Fix |
|---|
| Operation times out | Network or service issue | Check connectivity and retry |
| Permission denied | Missing credentials | Verify API keys and access tokens |
| Invalid output | Input format mismatch | Validate input against expected schema |
Detection Issues
"Command not found" after installation:
exec $SHELL
export PATH="/usr/local/bin:$PATH"
ls -la /usr/local/bin/opencode
ls -la /usr/local/bin/oh-my-opencode
Wrong version detected:
which -a opencode
which -a oh-my-opencode
npm list -g --depth=0
Installation Issues
npm install fails:
npm cache clean --force
npm config get prefix
sudo chown -R $(whoami) ~/.npm
Permission denied:
sudo npm install -g oh-my-opencode
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18
npm install -g oh-my-opencode
Configuration Issues
Config not loading:
cat ~/.config/opencode/opencode.jsonc | python3 -m json.tool > /dev/null && echo "✓ Config valid"
ls -la ~/.config/opencode/
opencode --debug config
Security Considerations
This section covers security considerations for the oh-my-opencode-installation skill.
Key operations include input validation, core processing, and output verification.
Refer to the skill overview for detailed usage instructions.
Safe Installation
- ✓ Download from official sources only
- ✓ Verify checksums when available
- ✓ Review installation scripts
- ✓ Use environment variables for API keys
- ✓ Set restrictive file permissions (600 for configs)
Security Checks
echo "Checking installation sources..."
[ "$(curl -sI https://opencode.ai/install | head -1)" =~ "200" ] && echo "✓ OpenCode source OK"
npm view oh-my-opencode version && echo "✓ npm package verified"
Post-Installation Checklist
Quick Reference
| Task | Command |
|---|
| Check installation | opencode --version && oh-my-opencode --version |
| Full install | `curl -fsSL https://opencode.ai/install |
| Reinstall | npm uninstall -g oh-my-opencode && npm install -g oh-my-opencode |
| Get help | oh-my-opencode --help |
| Update | npm update -g oh-my-opencode |
The Process
- Detect existing installation – Check if OpenCode and oh-my-opencode are already installed (skip steps if found)
- Verify prerequisites – Ensure Node.js 18+ is installed, check npm availability
- Choose installation method – Select one: Humans (curl script), LLM Agents (bash script), or Manual (curl + npm)
- Execute installation – Run chosen method and verify output shows success
- Configure – Set up configuration file at project-level or user-level
- Verify – Run
opencode --version and oh-my-opencode --version to confirm both install
- Test agents – Run
/agent sisyphus or /agent hephaestus to verify agents load
- Initialize project – Run
/init inside OpenCode to create AGENTS.md
When NOT to Use
- Task is outside your authorization scope
- You need to implement controls (use implementing-* skills)
- Task is about analysis, not action (use analyzing-* skills)
- You don't have access to target systems
- Task requires compliance expertise (consult professionals)
- Task is about defense, not offense (use defensive skills)
Red Flags
- Installing without checking – Not running detection first causing duplicate installs or conflicts
- Wrong Node.js version – Installing on Node.js < 18 causing runtime errors
- Permission denied – Installing globally without proper permissions, or trying to install system-wide without sudo
- Mixing installation methods – Using curl for OpenCode but npm for oh-my-opencode causing version mismatch
- Skipping verification – proceeding to use OpenCode without confirming version output
- Network failures – Assuming installation succeeded without checking network connectivity
- Config not created – Trying to use oh-my-opencode without creating configuration file first
Verification
- Version commands work:
opencode --version shows version, oh-my-opencode --version shows version
- Agents load:
/agent command switches to sisyphus, hephaestus, oracle, librarian, explore without errors
- Config loads: Configuration file is found at project/user level, values returned via config get
- Hooks working: Hook commands execute at expected times without errors
- MCPs respond: MCP servers installed and responding to tool calls
- Project init works:
/init creates AGENTS.md in project root
- No errors in logs:
opencode logs shows no installation errors or warnings
References
Anti-Rationalization Table
| Rationalization | Reality |
|---|
| "I will handle auth later" | Retrofitting auth is 10x harder. Build it from day one. |
| "APIs do not change" | APIs change. Version your integrations and handle deprecations. |
| "Webhooks are optional" | Without webhooks, you miss real-time events. They are essential. |
Related Skills
- oh-my-opencode: Overall integration
- oh-my-opencode-agents: Agent usage guide
- oh-my-opencode-usage: Daily usage patterns
- oh-my-opencode-configuration: Advanced configuration
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality