askill
opencode-reference

opencode-referenceSafety 90Repository

OpenCode.ai comprehensive reference documentation covering installation, configuration, TUI usage, CLI commands, IDE integration, and custom tool development. Use when working with OpenCode TUI, CLI, agent configuration, MCP servers, plugin development, or SDK integration.

0 stars
1.2k downloads
Updated 2/2/2026

Package Files

Loading files...
SKILL.md

What I do

  • Provide comprehensive OpenCode.ai reference
  • Guide installation and configuration
  • Explain TUI and CLI usage patterns
  • Assist with custom agent and tool development
  • Support MCP server integration
  • Enable JasaWeb-specific OpenCode workflows

When to use me

Use when working with OpenCode TUI, CLI commands, IDE integration, configuring agents, creating tools, setting up MCP servers, plugin development, or troubleshooting OpenCode issues in JasaWeb environment.

Quick Reference

Installation

# Quick install
curl -fsSL https://opencode.ai/install | bash

# Package managers
npm install -g opencode
brew install opencode
pnpm install -g opencode

Basic Usage

# Launch TUI
opencode

# Non-interactive
opencode run "prompt here"

# Headless server
opencode serve

# Web interface
opencode web

Essential Commands

  • /connect - Configure API keys
  • /init - Generate AGENTS.md
  • /models - List available models
  • /share - Share session
  • /undo - Undo changes
  • Tab - Switch agents
  • Ctrl+P - Command palette

Configuration

Configuration Files (priority order)

  1. Command-line flags
  2. Environment variables
  3. Project: ./opencode.json
  4. Global: ~/.config/opencode/opencode.json
  5. Built-in defaults

JasaWeb Project Configuration

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["oh-my-opencode@latest", "opencode-antigravity-auth@latest"],
  "model": "google/antigravity-claude-sonnet-4-5-thinking",
  "provider": {
    "google": {
      "npm": "@ai-sdk/google",
      "models": {
        "antigravity-claude-sonnet-4-5": {
          "name": "Claude Sonnet 4.5 (Antigravity)",
          "limit": {"context": 200000, "output": 64000}
        }
      }
    }
  },
  "agent": {
    "jasaweb-architect": {
      "description": "JasaWeb architectural specialist ensuring 99.8/100 score compliance",
      "mode": "subagent",
      "model": "google/antigravity-claude-sonnet-4-5-thinking"
    }
  },
  "instructions": ["AGENTS.md", ".opencode/*.md"]
}

Agent Configuration

{
  "agent": {
    "jasaweb-developer": {
      "description": "JasaWeb development specialist following AGENTS.md rules",
      "mode": "subagent",
      "model": "google/antigravity-gemini-3-pro",
      "temperature": 0.2,
      "tools": {
        "write": true,
        "edit": true,
        "bash": true,
        "read": true
      }
    }
  }
}

TUI Usage

File References

# Reference files with @ syntax
@src/main.ts What does this file do?
@src/pages/api/auth.ts Handle authentication here

Bash Commands

# Execute shell commands with !
!npm test
!pnpm lint
!git status

Slash Commands

CommandDescriptionKeybind
/connectConfigure API keys-
/initGenerate AGENTS.mdctrl+x i
/modelsList available modelsctrl+x m
/shareShare current sessionctrl+x s
/undoUndo last changectrl+x u
/helpShow help dialogctrl+x h
/newStart new sessionctrl+x n
/exitExit OpenCodectrl+x q

Providers Setup

Antigravity (Google)

# Authenticate
opencode
/connect
# Select "opencode"
# Visit opencode.ai/auth
# Enter API key

Custom Provider

{
  "provider": {
    "my-provider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "My Custom Provider",
      "options": {
        "baseURL": "https://api.myprovider.com/v1",
        "apiKey": "{env:MY_API_KEY}"
      }
    }
  }
}

Skills and Commands

Using Skills

# Use skill in conversation
opencode run "Create a new skill using skill-builder"

# Skill via command
/skill skill-builder

Custom Commands

Create .opencode/commands/my-command.md:

---
description: Review current PR changes
agent: jasaweb-architect
---

Review the following changes:
!`git diff --staged`

Check for:
- Architectural compliance (99.8/100 score)
- Security standards (100/100 score)
- Performance impact
- Test coverage

Agent Development

Custom Agent Structure

.opencode/agents/my-agent.md:

---
description: My specialized agent
mode: subagent
model: google/antigravity-claude-sonnet-4-5
temperature: 0.2
tools:
  write: true
  edit: true
  bash: true
  read: true
---

You are my specialized agent with specific capabilities...

## Core Responsibilities
- [List responsibilities]
- [Integration patterns]
- [Quality standards]

JasaWeb Agent Integration

Agents work together:

  • jasaweb-architect: Ensures 99.8/100 architectural score
  • jasaweb-developer: Implements following AGENTS.md rules
  • jasaweb-security: Maintains 100/100 security score
  • jasaweb-tester: Ensures 464-test baseline
  • jasaweb-autonomous: Self-heal, self-learn, self-evolve

MCP Servers

Setting up GitHub MCP

{
  "mcp": {
    "github": {
      "type": "local",
      "command": ["npx", "-y", "@modelcontextprotocol/server-github"],
      "environment": {
        "GITHUB_TOKEN": "{env:GITHUB_TOKEN}"
      }
    }
  }
}

Using MCP Servers

# List available servers
opencode mcp list

# Add new server
opencode mcp add server-name

# Authenticate server
opencode mcp auth server-name

Custom Tools

Tool Structure

import { tool } from "@opencode-ai/plugin"

export default tool({
  description: "Query JasaWeb database",
  args: {
    query: tool.schema.string().describe("SQL query")
  },
  async execute(args) {
    // Implementation
    return `Executed: ${args.query}`
  }
})

Tool Registration

Add to opencode.json:

{
  "tools": {
    "jasaweb-db": {
      "type": "local",
      "command": ["node", "tools/db-tool.js"]
    }
  }
}

JasaWeb Workflow Examples

1. Architectural Review

opencode
/jasaweb-architect Review this new feature for architectural compliance

2. Implementation with Standards

/jasaweb-developer Implement user authentication following AGENTS.md rules

3. Security Validation

/jasaweb-security Validate this payment integration for security issues

4. Test Creation

/jasaweb-tester Create comprehensive tests for this new service

5. Autonomous Maintenance

/jasaweb-autonomous Heal the failing tests and evolve the system

IDE Integration

VS Code/Cursor Integration

  • Automatic installation when running opencode in integrated terminal
  • Keyboard shortcuts:
    • Cmd+Esc (macOS) / Ctrl+Esc (Windows/Linux) - Quick launch
    • Cmd+Option+K (macOS) / Alt+Ctrl+K (Windows/Linux) - Insert file reference

Session Management

Sessions

# List sessions
opencode session list

# Share current session
/share

# Export session
opencode session export <session-id>

# Import session
opencode session import <file>

Collaboration

  • Share sessions with team members
  • Maintain context across development sessions
  • Preserve architectural decisions and reasoning

Development Integration

API Operations

# Start headless server
opencode serve --port 3000

# Use API in external tools
curl -X POST http://localhost:3000/api/chat \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Review this code"}'

GitHub Actions Integration

# Install GitHub workflow
opencode github install

# Run in CI/CD
opencode github run --agent jasaweb-architect

Troubleshooting

Common Issues

Authentication Problems

# Check auth status
opencode auth list

# Re-authenticate
opencode auth login

Model Access Issues

# Check available models
opencode models

# Refresh model cache
opencode models --refresh

Configuration Issues

# Validate configuration
opencode config validate

# Check file locations
ls ~/.config/opencode/
ls ./opencode.json

Logs and Debugging

# Enable debug logging
opencode --log-level DEBUG

# Print logs to stdout
opencode --print-logs

# Log locations
# macOS/Linux: ~/.local/share/opencode/log/
# Windows: %USERPROFILE%\.local\share\opencode\log\

Performance Optimization

Memory Management

{
  "compaction": "auto",
  "watcher": {
    "ignore": ["node_modules", ".git", "dist"]
  }
}

Bundle Optimization

{
  "tools": {
    "write": true,
    "bash": "allow"
  },
  "permission": {
    "edit": "ask",
    "bash": "allow"
  }
}

Resources

Documentation

Storage Locations

  • Config: ~/.config/opencode/
  • Data: ~/.local/share/opencode/
  • Cache: ~/.cache/opencode/
  • Logs: ~/.local/share/opencode/log/

This skill provides comprehensive OpenCode.ai support while maintaining integration with JasaWeb's high architectural standards and development workflows.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

92/100Analyzed 2/9/2026

An exceptionally detailed and well-structured reference guide for OpenCode.ai. It provides actionable commands, configuration examples, and troubleshooting steps. While it includes project-specific context, the core content is a high-quality technical reference.

90
100
75
98
95

Metadata

Licenseunknown
Version-
Updated2/2/2026
Publishersulhicmz

Tags

apici-cddatabasegithubgithub-actionslintingllmobservabilitypromptingsecuritytesting