{
  "schemaVersion": "1.0",
  "item": {
    "slug": "opencode",
    "name": "OpenCode AI",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/csuwl/opencode",
    "canonicalUrl": "https://clawhub.ai/csuwl/opencode",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/opencode",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opencode",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "CHEATSHEET.md",
      "INDEX.md",
      "INSTALL.md",
      "README.md",
      "SKILL.md",
      "SUMMARY.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/opencode"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/opencode",
    "agentPageUrl": "https://openagent3.xyz/skills/opencode/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opencode/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opencode/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OpenCode AI - AI Code Editor",
        "body": "OpenCode is an AI-native code editor that runs in your terminal. Think of it as Cursor or Windsurf, but as a CLI/TUI tool.\n\nVersion: 1.2.10 (Homebrew)\nPlatform: macOS Darwin x64"
      },
      {
        "title": "Prerequisites",
        "body": "CRITICAL: OpenCode requires sysctl to detect system architecture. Ensure /usr/sbin is in your PATH:\n\nexport PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:$PATH\"\n\nIf missing, OpenCode will fail with:\n\nExecutable not found in $PATH: \"sysctl\"\n\nAdd this to ~/.zshrc permanently:\n\necho 'export PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:$PATH\"' >> ~/.zshrc\nsource ~/.zshrc"
      },
      {
        "title": "When to Use OpenCode",
        "body": "✅ Use for:\n\nComplex refactoring across multiple files\nAI-assisted feature implementation\nGitHub PR review and automated fixes\nExploring and understanding unfamiliar codebases\nRunning multi-step coding tasks with context\nSession-based coding (continue previous work)\n\n❌ Don't use for:\n\nSimple one-line edits (use edit tool)\nReading file contents (use read tool)\nNon-coding tasks"
      },
      {
        "title": "Core Operations (TUI Slash Commands)",
        "body": "When running OpenCode in TUI mode (opencode), you can use these slash commands to control the AI workflow:"
      },
      {
        "title": "/sessions - Session Management",
        "body": "/sessions\n\nOpens session selector\nChoose to continue an existing session\nCreate a new session (with user approval)\nRecommended: Select existing session for current project"
      },
      {
        "title": "/agents - Agent (Mode) Control",
        "body": "/agents\n\nAvailable agents:\n\nplan - Planning mode (analyze and design)\nbuild - Build mode (implement and code)\nexplore - Exploration mode (understand codebase)\ngeneral - General assistance\n\nBest Practice: Always select plan first, then switch to build after approval."
      },
      {
        "title": "/models - Model Selection",
        "body": "/models\n\nOpens model selector\nFilter by provider (OpenAI, Anthropic, Google, Z.AI, etc.)\nSelect preferred model for the task\nIf authentication required, follow the login link provided"
      },
      {
        "title": "Agent Workflow",
        "body": "Plan Agent Behavior\n\nAsk OpenCode to analyze the task\nRequest a clear step-by-step plan\nAllow OpenCode to ask clarification questions\nReview the plan carefully\nIf plan is incomplete, ask for revision\nDo not allow code generation in Plan mode\n\nBuild Agent Behavior\n\nSwitch to Build using /agents\nAsk OpenCode to implement the approved plan\nIf OpenCode asks questions, switch back to Plan\nAnswer and confirm the plan, then switch back to Build\n\nPlan → Build Loop\n\nSelect plan agent with /agents\nDescribe the task\nReview and approve the plan\nSwitch to build agent with /agents\nImplement the plan\nRepeat until satisfied\n\nKey Rules:\n\nNever skip Plan\nNever answer questions in Build mode (switch to Plan first)\nAlways show slash commands explicitly in output"
      },
      {
        "title": "Other Useful Commands",
        "body": "/title - Change session title\n/summary - Generate session summary\n/compaction - Compact conversation history"
      },
      {
        "title": "1. Quick Tasks (One-Shot)",
        "body": "# Run a single AI command on a project\nopencode run \"Add input validation to the login form\"\n\n# With specific directory\nopencode run --dir ~/path/to/project \"Refactor this code to use async/await\"\n\n# With specific model\nopencode run -m openai/gpt-4o \"Optimize the database queries\"\n\n# Attach files for context\nopencode run -f src/auth.js -f src/database.js \"Fix the authentication bug\"\n\n# Continue last session\nopencode run --continue\n\n# Continue specific session\nopencode run --session abc123 --fork"
      },
      {
        "title": "2. Interactive TUI Mode",
        "body": "# Start TUI in current directory\nopencode\n\n# Start TUI in specific project\nopencode ~/path/to/project\n\n# Start with specific model\nopencode -m anthropic/claude-sonnet-4"
      },
      {
        "title": "3. Authentication",
        "body": "# List configured providers\nopencode auth list\n\n# Login to a provider (e.g., OpenCode, OpenAI, Anthropic)\nopencode auth login [url]\n\n# Logout\nopencode auth logout"
      },
      {
        "title": "4. Model Management",
        "body": "# List all available models\nopencode models\n\n# List models for specific provider\nopencode models openai\n\n# List with cost metadata\nopencode models --verbose\n\n# Refresh model cache\nopencode models --refresh"
      },
      {
        "title": "5. Session Management",
        "body": "# List all sessions\nopencode session list\n\n# Delete a session\nopencode session delete <sessionID>\n\n# Export session data\nopencode export [sessionID]\n\n# Import session from file\nopencode import <file>"
      },
      {
        "title": "6. GitHub Integration",
        "body": "# Fetch and checkout a PR, then run OpenCode\nopencode pr 123\n\n# Manage GitHub agent\nopencode github --help"
      },
      {
        "title": "7. MCP Servers (Model Context Protocol)",
        "body": "# List MCP servers\nopencode mcp list\n\n# Add an MCP server\nopencode mcp add\n\n# Authenticate with OAuth MCP server\nopencode mcp auth [name]\n\n# Debug OAuth connection\nopencode mcp debug <name>"
      },
      {
        "title": "8. Agent Management",
        "body": "# List all agents\nopencode agent list\n\n# Create a new agent\nopencode agent create"
      },
      {
        "title": "9. Server Mode",
        "body": "# Start headless server\nopencode serve\n\n# Start server and open web interface\nopencode web\n\n# Start ACP (Agent Client Protocol) server\nopencode acp"
      },
      {
        "title": "10. Statistics",
        "body": "# Show token usage and costs\nopencode stats"
      },
      {
        "title": "Key Options (Global)",
        "body": "OptionDescription-m, --modelModel to use (format: provider/model)-c, --continueContinue last session-s, --sessionContinue specific session--forkFork session when continuing--agentUse specific agent--dirDirectory to run in--formatOutput format: default or json--thinkingShow thinking blocks--variantModel reasoning effort (high, max, minimal)"
      },
      {
        "title": "Pattern 1: Refactor Code",
        "body": "opencode run \"Refactor this function to be more readable and add error handling\""
      },
      {
        "title": "Pattern 2: Add Features",
        "body": "opencode run \"Add a new API endpoint for user registration with email verification\""
      },
      {
        "title": "Pattern 3: Fix Bugs",
        "body": "opencode run -f error.log -f src/auth.js \"Fix the authentication bug described in the error log\""
      },
      {
        "title": "Pattern 4: Review Code",
        "body": "opencode run \"Review this code for security vulnerabilities and suggest improvements\""
      },
      {
        "title": "Pattern 5: GitHub PR Workflow",
        "body": "# Auto-fix a PR\nopencode pr 123"
      },
      {
        "title": "Pattern 6: Continue Previous Work",
        "body": "# Continue last session\nopencode run --continue\n\n# Fork and continue (keeps original intact)\nopencode run --continue --fork"
      },
      {
        "title": "Session-Based Work",
        "body": "OpenCode maintains sessions that preserve context across runs:\n\n# Start a new session\nopencode run \"Implement user authentication\"\n\n# Continue it later\nopencode run --continue\n\n# Or continue a specific session\nopencode run --session session-abc123"
      },
      {
        "title": "Session Lifecycle",
        "body": "Create: Run opencode run \"prompt\" or opencode\nContinue: Use --continue or --session <id>\nFork: Use --fork to branch from a session\nExport: Save session data as JSON\nDelete: Remove old sessions"
      },
      {
        "title": "Format",
        "body": "provider/model\n\nExamples:\n\nopenai/gpt-4o\nanthropic/claude-sonnet-4\nopencode/gpt-4o\ngoogle/gemini-2.5-pro"
      },
      {
        "title": "List Available Models",
        "body": "# All models\nopencode models\n\n# Provider-specific\nopencode models openai\nopencode models anthropic"
      },
      {
        "title": "Model Variants (Reasoning Effort)",
        "body": "Some models support reasoning effort levels:\n\nopencode run --variant high \"Solve this complex algorithm problem\"\nopencode run --variant max \"Architect a distributed system\"\nopencode run --variant minimal \"Quick code review\""
      },
      {
        "title": "JSON Mode (For Automation)",
        "body": "Use --format json for machine-readable output:\n\nopencode run --format json \"Refactor this code\" | jq .\n\nUseful for:\n\nCI/CD integration\nScripting\nParsing results programmatically"
      },
      {
        "title": "Web Interface",
        "body": "For a GUI experience:\n\n# Start server + open browser\nopencode web\n\n# Custom port\nopencode web --port 8080\n\n# Custom hostname\nopencode web --hostname 0.0.0.0"
      },
      {
        "title": "\"sysctl not found\" Error",
        "body": "Problem: OpenCode can't find sysctl command\nSolution:\n\nexport PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:$PATH\"\n\nAdd to ~/.zshrc to make permanent."
      },
      {
        "title": "\"Failed to change directory\" Error",
        "body": "Problem: OpenCode treats arguments as directory paths\nSolution: Use flags like --version, --help, or run explicitly:\n\n# Wrong\nopencode version\n\n# Right\nopencode --version"
      },
      {
        "title": "OpenCode hangs or freezes",
        "body": "Problem: Interactive TUI waiting for input\nSolution: Press Ctrl+C to exit, or use run mode for non-interactive tasks."
      },
      {
        "title": "Permission issues",
        "body": "Problem: Can't write to files\nSolution: Ensure file/directory permissions allow your user to write:\n\nchmod +w ./path/to/file"
      },
      {
        "title": "Use via exec tool",
        "body": "# For simple tasks\nbash command:\"opencode run 'Add error handling'\"\n\n# For longer tasks (background)\nbash background:true command:\"opencode run 'Refactor entire codebase'\""
      },
      {
        "title": "Check current sessions",
        "body": "bash command:\"opencode session list\""
      },
      {
        "title": "View stats",
        "body": "bash command:\"opencode stats\""
      },
      {
        "title": "Tips & Best Practices",
        "body": "Be specific: Clear prompts produce better results\nUse files: Attach relevant files with -f for context\nIterate: Use --continue to build on previous work\nFork experiments: Use --fork to try variations safely\nChoose models wisely: Different models excel at different tasks\nMonitor costs: Use opencode stats to track token usage\nLeverage sessions: Sessions maintain context across interactions"
      },
      {
        "title": "Comparison to Other Tools",
        "body": "FeatureOpenCodeCursorWindsurfClaude CodeInterfaceCLI/TUIGUIGUICLITerminal-native✅❌❌✅Session management✅✅✅✅GitHub PR integration✅✅✅✅Model supportMultiMultiMultiAnthropicMCP support✅❌❌❌\n\nChoose OpenCode when:\n\nYou prefer terminal workflows\nNeed CI/CD integration\nWant headless/server mode\nRequire MCP protocol support"
      },
      {
        "title": "Documentation & Resources",
        "body": "Version: opencode --version\nHelp: opencode --help or opencode <command> --help\nModels: opencode models --verbose\nSessions: opencode session list\n\nLast updated: 2026-02-25"
      }
    ],
    "body": "OpenCode AI - AI Code Editor\n\nOpenCode is an AI-native code editor that runs in your terminal. Think of it as Cursor or Windsurf, but as a CLI/TUI tool.\n\nVersion: 1.2.10 (Homebrew) Platform: macOS Darwin x64\n\nPrerequisites\n\nCRITICAL: OpenCode requires sysctl to detect system architecture. Ensure /usr/sbin is in your PATH:\n\nexport PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:$PATH\"\n\n\nIf missing, OpenCode will fail with:\n\nExecutable not found in $PATH: \"sysctl\"\n\n\nAdd this to ~/.zshrc permanently:\n\necho 'export PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:$PATH\"' >> ~/.zshrc\nsource ~/.zshrc\n\nWhen to Use OpenCode\n\n✅ Use for:\n\nComplex refactoring across multiple files\nAI-assisted feature implementation\nGitHub PR review and automated fixes\nExploring and understanding unfamiliar codebases\nRunning multi-step coding tasks with context\nSession-based coding (continue previous work)\n\n❌ Don't use for:\n\nSimple one-line edits (use edit tool)\nReading file contents (use read tool)\nNon-coding tasks\nCore Operations (TUI Slash Commands)\n\nWhen running OpenCode in TUI mode (opencode), you can use these slash commands to control the AI workflow:\n\n/sessions - Session Management\n/sessions\n\nOpens session selector\nChoose to continue an existing session\nCreate a new session (with user approval)\nRecommended: Select existing session for current project\n/agents - Agent (Mode) Control\n/agents\n\n\nAvailable agents:\n\nplan - Planning mode (analyze and design)\nbuild - Build mode (implement and code)\nexplore - Exploration mode (understand codebase)\ngeneral - General assistance\n\nBest Practice: Always select plan first, then switch to build after approval.\n\n/models - Model Selection\n/models\n\nOpens model selector\nFilter by provider (OpenAI, Anthropic, Google, Z.AI, etc.)\nSelect preferred model for the task\nIf authentication required, follow the login link provided\nAgent Workflow\nPlan Agent Behavior\nAsk OpenCode to analyze the task\nRequest a clear step-by-step plan\nAllow OpenCode to ask clarification questions\nReview the plan carefully\nIf plan is incomplete, ask for revision\nDo not allow code generation in Plan mode\nBuild Agent Behavior\nSwitch to Build using /agents\nAsk OpenCode to implement the approved plan\nIf OpenCode asks questions, switch back to Plan\nAnswer and confirm the plan, then switch back to Build\nPlan → Build Loop\nSelect plan agent with /agents\nDescribe the task\nReview and approve the plan\nSwitch to build agent with /agents\nImplement the plan\nRepeat until satisfied\n\nKey Rules:\n\nNever skip Plan\nNever answer questions in Build mode (switch to Plan first)\nAlways show slash commands explicitly in output\nOther Useful Commands\n/title - Change session title\n/summary - Generate session summary\n/compaction - Compact conversation history\nCore Commands\n1. Quick Tasks (One-Shot)\n# Run a single AI command on a project\nopencode run \"Add input validation to the login form\"\n\n# With specific directory\nopencode run --dir ~/path/to/project \"Refactor this code to use async/await\"\n\n# With specific model\nopencode run -m openai/gpt-4o \"Optimize the database queries\"\n\n# Attach files for context\nopencode run -f src/auth.js -f src/database.js \"Fix the authentication bug\"\n\n# Continue last session\nopencode run --continue\n\n# Continue specific session\nopencode run --session abc123 --fork\n\n2. Interactive TUI Mode\n# Start TUI in current directory\nopencode\n\n# Start TUI in specific project\nopencode ~/path/to/project\n\n# Start with specific model\nopencode -m anthropic/claude-sonnet-4\n\n3. Authentication\n# List configured providers\nopencode auth list\n\n# Login to a provider (e.g., OpenCode, OpenAI, Anthropic)\nopencode auth login [url]\n\n# Logout\nopencode auth logout\n\n4. Model Management\n# List all available models\nopencode models\n\n# List models for specific provider\nopencode models openai\n\n# List with cost metadata\nopencode models --verbose\n\n# Refresh model cache\nopencode models --refresh\n\n5. Session Management\n# List all sessions\nopencode session list\n\n# Delete a session\nopencode session delete <sessionID>\n\n# Export session data\nopencode export [sessionID]\n\n# Import session from file\nopencode import <file>\n\n6. GitHub Integration\n# Fetch and checkout a PR, then run OpenCode\nopencode pr 123\n\n# Manage GitHub agent\nopencode github --help\n\n7. MCP Servers (Model Context Protocol)\n# List MCP servers\nopencode mcp list\n\n# Add an MCP server\nopencode mcp add\n\n# Authenticate with OAuth MCP server\nopencode mcp auth [name]\n\n# Debug OAuth connection\nopencode mcp debug <name>\n\n8. Agent Management\n# List all agents\nopencode agent list\n\n# Create a new agent\nopencode agent create\n\n9. Server Mode\n# Start headless server\nopencode serve\n\n# Start server and open web interface\nopencode web\n\n# Start ACP (Agent Client Protocol) server\nopencode acp\n\n10. Statistics\n# Show token usage and costs\nopencode stats\n\nKey Options (Global)\nOption\tDescription\n-m, --model\tModel to use (format: provider/model)\n-c, --continue\tContinue last session\n-s, --session\tContinue specific session\n--fork\tFork session when continuing\n--agent\tUse specific agent\n--dir\tDirectory to run in\n--format\tOutput format: default or json\n--thinking\tShow thinking blocks\n--variant\tModel reasoning effort (high, max, minimal)\nCommon Patterns\nPattern 1: Refactor Code\nopencode run \"Refactor this function to be more readable and add error handling\"\n\nPattern 2: Add Features\nopencode run \"Add a new API endpoint for user registration with email verification\"\n\nPattern 3: Fix Bugs\nopencode run -f error.log -f src/auth.js \"Fix the authentication bug described in the error log\"\n\nPattern 4: Review Code\nopencode run \"Review this code for security vulnerabilities and suggest improvements\"\n\nPattern 5: GitHub PR Workflow\n# Auto-fix a PR\nopencode pr 123\n\nPattern 6: Continue Previous Work\n# Continue last session\nopencode run --continue\n\n# Fork and continue (keeps original intact)\nopencode run --continue --fork\n\nSession-Based Work\n\nOpenCode maintains sessions that preserve context across runs:\n\n# Start a new session\nopencode run \"Implement user authentication\"\n\n# Continue it later\nopencode run --continue\n\n# Or continue a specific session\nopencode run --session session-abc123\n\nSession Lifecycle\nCreate: Run opencode run \"prompt\" or opencode\nContinue: Use --continue or --session <id>\nFork: Use --fork to branch from a session\nExport: Save session data as JSON\nDelete: Remove old sessions\nModel Selection\nFormat\nprovider/model\n\n\nExamples:\n\nopenai/gpt-4o\nanthropic/claude-sonnet-4\nopencode/gpt-4o\ngoogle/gemini-2.5-pro\nList Available Models\n# All models\nopencode models\n\n# Provider-specific\nopencode models openai\nopencode models anthropic\n\nModel Variants (Reasoning Effort)\n\nSome models support reasoning effort levels:\n\nopencode run --variant high \"Solve this complex algorithm problem\"\nopencode run --variant max \"Architect a distributed system\"\nopencode run --variant minimal \"Quick code review\"\n\nJSON Mode (For Automation)\n\nUse --format json for machine-readable output:\n\nopencode run --format json \"Refactor this code\" | jq .\n\n\nUseful for:\n\nCI/CD integration\nScripting\nParsing results programmatically\nWeb Interface\n\nFor a GUI experience:\n\n# Start server + open browser\nopencode web\n\n# Custom port\nopencode web --port 8080\n\n# Custom hostname\nopencode web --hostname 0.0.0.0\n\nTroubleshooting\n\"sysctl not found\" Error\n\nProblem: OpenCode can't find sysctl command Solution:\n\nexport PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:$PATH\"\n\n\nAdd to ~/.zshrc to make permanent.\n\n\"Failed to change directory\" Error\n\nProblem: OpenCode treats arguments as directory paths Solution: Use flags like --version, --help, or run explicitly:\n\n# Wrong\nopencode version\n\n# Right\nopencode --version\n\nOpenCode hangs or freezes\n\nProblem: Interactive TUI waiting for input Solution: Press Ctrl+C to exit, or use run mode for non-interactive tasks.\n\nPermission issues\n\nProblem: Can't write to files Solution: Ensure file/directory permissions allow your user to write:\n\nchmod +w ./path/to/file\n\nIntegration with OpenClaw\nUse via exec tool\n# For simple tasks\nbash command:\"opencode run 'Add error handling'\"\n\n# For longer tasks (background)\nbash background:true command:\"opencode run 'Refactor entire codebase'\"\n\nCheck current sessions\nbash command:\"opencode session list\"\n\nView stats\nbash command:\"opencode stats\"\n\nTips & Best Practices\nBe specific: Clear prompts produce better results\nUse files: Attach relevant files with -f for context\nIterate: Use --continue to build on previous work\nFork experiments: Use --fork to try variations safely\nChoose models wisely: Different models excel at different tasks\nMonitor costs: Use opencode stats to track token usage\nLeverage sessions: Sessions maintain context across interactions\nComparison to Other Tools\nFeature\tOpenCode\tCursor\tWindsurf\tClaude Code\nInterface\tCLI/TUI\tGUI\tGUI\tCLI\nTerminal-native\t✅\t❌\t❌\t✅\nSession management\t✅\t✅\t✅\t✅\nGitHub PR integration\t✅\t✅\t✅\t✅\nModel support\tMulti\tMulti\tMulti\tAnthropic\nMCP support\t✅\t❌\t❌\t❌\n\nChoose OpenCode when:\n\nYou prefer terminal workflows\nNeed CI/CD integration\nWant headless/server mode\nRequire MCP protocol support\nDocumentation & Resources\nVersion: opencode --version\nHelp: opencode --help or opencode <command> --help\nModels: opencode models --verbose\nSessions: opencode session list\n\nLast updated: 2026-02-25"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/csuwl/opencode",
    "publisherUrl": "https://clawhub.ai/csuwl/opencode",
    "owner": "csuwl",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/opencode",
    "downloadUrl": "https://openagent3.xyz/downloads/opencode",
    "agentUrl": "https://openagent3.xyz/skills/opencode/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opencode/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opencode/agent.md"
  }
}