{
  "schemaVersion": "1.0",
  "item": {
    "slug": "opencode-acp-control-2",
    "name": "Opencode Acp Control",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/studio-hakke/opencode-acp-control-2",
    "canonicalUrl": "https://clawhub.ai/studio-hakke/opencode-acp-control-2",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/opencode-acp-control-2",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opencode-acp-control-2",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "_meta.json"
    ],
    "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. 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. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "opencode-acp-control-2",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-06T16:38:54.354Z",
      "expiresAt": "2026-05-13T16:38:54.354Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opencode-acp-control-2",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opencode-acp-control-2",
        "contentDisposition": "attachment; filename=\"opencode-acp-control-2-0.1.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "opencode-acp-control-2"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/opencode-acp-control-2"
    },
    "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-acp-control-2",
    "agentPageUrl": "https://openagent3.xyz/skills/opencode-acp-control-2/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opencode-acp-control-2/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opencode-acp-control-2/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. 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. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OpenCode ACP Skill",
        "body": "Control OpenCode directly via the Agent Client Protocol (ACP)."
      },
      {
        "title": "Metadata",
        "body": "For ACP Protocol Docs (for Agents/LLMs): https://agentclientprotocol.com/llms.txt\nGitHub Repo: https://github.com/bjesuiter/opencode-acp-skill\nIf you have issues with this skill, please open an issue ticket here: https://github.com/bjesuiter/opencode-acp-skill/issues"
      },
      {
        "title": "Quick Reference",
        "body": "ActionHowStart OpenCodebash(command: \"opencode acp --cwd /path/to/project\", background: true)Send messageprocess.write(sessionId, data: \"<json-rpc>\\n\")Read responseprocess.poll(sessionId) - repeat every 2 secondsStop OpenCodeprocess.kill(sessionId)List sessionsbash(command: \"opencode session list\", workdir: \"...\")Resume sessionList sessions → ask user → session/loadCheck versionbash(command: \"opencode --version\")"
      },
      {
        "title": "Starting OpenCode",
        "body": "bash(\n  command: \"opencode acp --cwd /path/to/your/project\",\n  background: true,\n  workdir: \"/path/to/your/project\"\n)\n\nSave the returned sessionId - you'll need it for all subsequent commands."
      },
      {
        "title": "Protocol Basics",
        "body": "All messages are JSON-RPC 2.0 format\nMessages are newline-delimited (end each with \\n)\nMaintain a message ID counter starting at 0"
      },
      {
        "title": "Step 1: Initialize Connection",
        "body": "Send immediately after starting OpenCode:\n\n{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",\"params\":{\"protocolVersion\":1,\"clientCapabilities\":{\"fs\":{\"readTextFile\":true,\"writeTextFile\":true},\"terminal\":true},\"clientInfo\":{\"name\":\"clawdbot\",\"title\":\"Clawdbot\",\"version\":\"1.0.0\"}}}\n\nPoll for response. Expect result.protocolVersion: 1."
      },
      {
        "title": "Step 2: Create Session",
        "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"session/new\",\"params\":{\"cwd\":\"/path/to/project\",\"mcpServers\":[]}}\n\nPoll for response. Save result.sessionId (e.g., \"sess_abc123\")."
      },
      {
        "title": "Step 3: Send Prompts",
        "body": "{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"session/prompt\",\"params\":{\"sessionId\":\"sess_abc123\",\"prompt\":[{\"type\":\"text\",\"text\":\"Your question here\"}]}}\n\nPoll every 2 seconds. You'll receive:\n\nsession/update notifications (streaming content)\nFinal response with result.stopReason"
      },
      {
        "title": "Step 4: Read Responses",
        "body": "Each poll may return multiple lines. Parse each line as JSON:\n\nNotifications: method: \"session/update\" - collect these for the response\nResponse: Has id matching your request - stop polling when stopReason appears"
      },
      {
        "title": "Step 5: Cancel (if needed)",
        "body": "{\"jsonrpc\":\"2.0\",\"method\":\"session/cancel\",\"params\":{\"sessionId\":\"sess_abc123\"}}\n\nNo response expected - this is a notification."
      },
      {
        "title": "State to Track",
        "body": "Per OpenCode instance, track:\n\nprocessSessionId - from bash tool (clawdbot's process ID)\nopencodeSessionId - from session/new response (OpenCode's session ID)\nmessageId - increment for each request you send"
      },
      {
        "title": "Polling Strategy",
        "body": "Poll every 2 seconds\nContinue until you receive a response with stopReason\nMax wait: 5 minutes (150 polls)\nIf no response, consider the operation timed out"
      },
      {
        "title": "Common Stop Reasons",
        "body": "stopReasonMeaningend_turnAgent finished respondingcancelledYou cancelled the promptmax_tokensToken limit reached"
      },
      {
        "title": "Error Handling",
        "body": "IssueSolutionEmpty poll responseKeep polling - agent is thinkingParse errorSkip malformed line, continueProcess exitedRestart OpenCodeNo response after 5minKill process, start fresh"
      },
      {
        "title": "Example: Complete Interaction",
        "body": "1. bash(command: \"opencode acp --cwd /home/user/myproject\", background: true, workdir: \"/home/user/myproject\")\n   -> processSessionId: \"bg_42\"\n\n2. process.write(sessionId: \"bg_42\", data: '{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",...}\\n')\n   process.poll(sessionId: \"bg_42\") -> initialize response\n\n3. process.write(sessionId: \"bg_42\", data: '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"session/new\",\"params\":{\"cwd\":\"/home/user/myproject\",\"mcpServers\":[]}}\\n')\n   process.poll(sessionId: \"bg_42\") -> opencodeSessionId: \"sess_xyz789\"\n\n4. process.write(sessionId: \"bg_42\", data: '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"session/prompt\",\"params\":{\"sessionId\":\"sess_xyz789\",\"prompt\":[{\"type\":\"text\",\"text\":\"List all TypeScript files\"}]}}\\n')\n   \n5. process.poll(sessionId: \"bg_42\") every 2 sec until stopReason\n   -> Collect all session/update content\n   -> Final response: stopReason: \"end_turn\"\n\n6. When done: process.kill(sessionId: \"bg_42\")"
      },
      {
        "title": "Resume Session",
        "body": "Resume a previous OpenCode session by letting the user choose from available sessions."
      },
      {
        "title": "Step 1: List Available Sessions",
        "body": "bash(command: \"opencode session list\", workdir: \"/path/to/project\")\n\nExample output:\n\nID                                  Updated              Messages\nses_451cd8ae0ffegNQsh59nuM3VVy      2026-01-11 15:30     12\nses_451a89e63ffea2TQIpnDGtJBkS      2026-01-10 09:15     5\nses_4518e90d0ffeJIpOFI3t3Jd23Q      2026-01-09 14:22     8"
      },
      {
        "title": "Step 2: Ask User to Choose",
        "body": "Present the list to the user and ask which session to resume:\n\n\"Which session would you like to resume?\n \n1. ses_451cd8ae... (12 messages, updated 2026-01-11)\n2. ses_451a89e6... (5 messages, updated 2026-01-10)\n3. ses_4518e90d... (8 messages, updated 2026-01-09)\n\nEnter session number or ID:\""
      },
      {
        "title": "Step 3: Load Selected Session",
        "body": "Once user responds (e.g., \"1\", \"the first one\", or \"ses_451cd8ae...\"):\n\nStart OpenCode ACP:\nbash(command: \"opencode acp --cwd /path/to/project\", background: true, workdir: \"/path/to/project\")\n\n\n\nInitialize:\n{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",\"params\":{...}}\n\n\n\nLoad the session:\n{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"session/load\",\"params\":{\"sessionId\":\"ses_451cd8ae0ffegNQsh59nuM3VVy\",\"cwd\":\"/path/to/project\",\"mcpServers\":[]}}\n\nNote: session/load requires cwd and mcpServers parameters.\n\nOn load, OpenCode streams the full conversation history back to you."
      },
      {
        "title": "Resume Workflow Summary",
        "body": "function resumeSession(workdir):\n    # List available sessions\n    output = bash(\"opencode session list\", workdir: workdir)\n    sessions = parseSessionList(output)\n    \n    if sessions.empty:\n        notify(\"No previous sessions found. Starting fresh.\")\n        return createNewSession(workdir)\n    \n    # Ask user to choose\n    choice = askUser(\"Which session to resume?\", sessions)\n    selectedId = matchUserChoice(choice, sessions)\n    \n    # Start OpenCode and load session\n    process = bash(\"opencode acp --cwd \" + workdir, background: true, workdir: workdir)\n    initialize(process)\n    \n    session_load(process, selectedId, workdir, mcpServers: [])\n    \n    notify(\"Session resumed. Conversation history loaded.\")\n    return process"
      },
      {
        "title": "Important Notes",
        "body": "History replay: On load, all previous messages stream back\nMemory preserved: Agent remembers the full conversation\nProcess independent: Sessions survive OpenCode restarts"
      },
      {
        "title": "Updating OpenCode",
        "body": "OpenCode auto-updates when restarted. Use this workflow to check and trigger updates."
      },
      {
        "title": "Step 1: Check Current Version",
        "body": "bash(command: \"opencode --version\")\n\nReturns something like: opencode version 1.1.13\n\nExtract the version number (e.g., 1.1.13)."
      },
      {
        "title": "Step 2: Check Latest Version",
        "body": "webfetch(url: \"https://github.com/anomalyco/opencode/releases/latest\", format: \"text\")\n\nThe redirect URL contains the latest version tag:\n\nRedirects to: https://github.com/anomalyco/opencode/releases/tag/v1.2.0\nExtract version from the URL path (e.g., 1.2.0)"
      },
      {
        "title": "Step 3: Compare and Update",
        "body": "If latest version > current version:\n\nStop all running OpenCode processes:\nprocess.list()  # Find all \"opencode acp\" processes\nprocess.kill(sessionId) # For each running instance\n\n\n\nRestart instances (OpenCode auto-downloads new binary on start):\nbash(command: \"opencode acp --cwd /path/to/project\", background: true, workdir: \"/path/to/project\")\n\n\n\nRe-initialize each instance (initialize + session/load for existing sessions)"
      },
      {
        "title": "Step 4: Verify Update",
        "body": "bash(command: \"opencode --version\")\n\nIf version still doesn't match latest:\n\nInform user: \"OpenCode auto-update may have failed. Current: X.X.X, Latest: Y.Y.Y\"\nSuggest manual update: curl -fsSL https://opencode.dev/install | bash"
      },
      {
        "title": "Update Workflow Summary",
        "body": "function updateOpenCode():\n    current = bash(\"opencode --version\")  # e.g., \"1.1.13\"\n    \n    latestPage = webfetch(\"https://github.com/anomalyco/opencode/releases/latest\")\n    latest = extractVersionFromRedirectUrl(latestPage)  # e.g., \"1.2.0\"\n    \n    if semverCompare(latest, current) > 0:\n        # Stop all instances\n        for process in process.list():\n            if process.command.includes(\"opencode\"):\n                process.kill(process.sessionId)\n        \n        # Wait briefly for processes to terminate\n        sleep(2 seconds)\n        \n        # Restart triggers auto-update\n        bash(\"opencode acp\", background: true)\n        \n        # Verify\n        newVersion = bash(\"opencode --version\")\n        if newVersion != latest:\n            notify(\"Auto-update may have failed. Manual update recommended.\")\n    else:\n        notify(\"OpenCode is up to date: \" + current)"
      },
      {
        "title": "Important Notes",
        "body": "Sessions persist: opencodeSessionId survives restarts — use session/load to recover\nAuto-update: OpenCode downloads new binary automatically on restart\nNo data loss: Conversation history is preserved server-side"
      }
    ],
    "body": "OpenCode ACP Skill\n\nControl OpenCode directly via the Agent Client Protocol (ACP).\n\nMetadata\nFor ACP Protocol Docs (for Agents/LLMs): https://agentclientprotocol.com/llms.txt\nGitHub Repo: https://github.com/bjesuiter/opencode-acp-skill\nIf you have issues with this skill, please open an issue ticket here: https://github.com/bjesuiter/opencode-acp-skill/issues\nQuick Reference\nAction\tHow\nStart OpenCode\tbash(command: \"opencode acp --cwd /path/to/project\", background: true)\nSend message\tprocess.write(sessionId, data: \"<json-rpc>\\n\")\nRead response\tprocess.poll(sessionId) - repeat every 2 seconds\nStop OpenCode\tprocess.kill(sessionId)\nList sessions\tbash(command: \"opencode session list\", workdir: \"...\")\nResume session\tList sessions → ask user → session/load\nCheck version\tbash(command: \"opencode --version\")\nStarting OpenCode\nbash(\n  command: \"opencode acp --cwd /path/to/your/project\",\n  background: true,\n  workdir: \"/path/to/your/project\"\n)\n\n\nSave the returned sessionId - you'll need it for all subsequent commands.\n\nProtocol Basics\nAll messages are JSON-RPC 2.0 format\nMessages are newline-delimited (end each with \\n)\nMaintain a message ID counter starting at 0\nStep-by-Step Workflow\nStep 1: Initialize Connection\n\nSend immediately after starting OpenCode:\n\n{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",\"params\":{\"protocolVersion\":1,\"clientCapabilities\":{\"fs\":{\"readTextFile\":true,\"writeTextFile\":true},\"terminal\":true},\"clientInfo\":{\"name\":\"clawdbot\",\"title\":\"Clawdbot\",\"version\":\"1.0.0\"}}}\n\n\nPoll for response. Expect result.protocolVersion: 1.\n\nStep 2: Create Session\n{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"session/new\",\"params\":{\"cwd\":\"/path/to/project\",\"mcpServers\":[]}}\n\n\nPoll for response. Save result.sessionId (e.g., \"sess_abc123\").\n\nStep 3: Send Prompts\n{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"session/prompt\",\"params\":{\"sessionId\":\"sess_abc123\",\"prompt\":[{\"type\":\"text\",\"text\":\"Your question here\"}]}}\n\n\nPoll every 2 seconds. You'll receive:\n\nsession/update notifications (streaming content)\nFinal response with result.stopReason\nStep 4: Read Responses\n\nEach poll may return multiple lines. Parse each line as JSON:\n\nNotifications: method: \"session/update\" - collect these for the response\nResponse: Has id matching your request - stop polling when stopReason appears\nStep 5: Cancel (if needed)\n{\"jsonrpc\":\"2.0\",\"method\":\"session/cancel\",\"params\":{\"sessionId\":\"sess_abc123\"}}\n\n\nNo response expected - this is a notification.\n\nState to Track\n\nPer OpenCode instance, track:\n\nprocessSessionId - from bash tool (clawdbot's process ID)\nopencodeSessionId - from session/new response (OpenCode's session ID)\nmessageId - increment for each request you send\nPolling Strategy\nPoll every 2 seconds\nContinue until you receive a response with stopReason\nMax wait: 5 minutes (150 polls)\nIf no response, consider the operation timed out\nCommon Stop Reasons\nstopReason\tMeaning\nend_turn\tAgent finished responding\ncancelled\tYou cancelled the prompt\nmax_tokens\tToken limit reached\nError Handling\nIssue\tSolution\nEmpty poll response\tKeep polling - agent is thinking\nParse error\tSkip malformed line, continue\nProcess exited\tRestart OpenCode\nNo response after 5min\tKill process, start fresh\nExample: Complete Interaction\n1. bash(command: \"opencode acp --cwd /home/user/myproject\", background: true, workdir: \"/home/user/myproject\")\n   -> processSessionId: \"bg_42\"\n\n2. process.write(sessionId: \"bg_42\", data: '{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",...}\\n')\n   process.poll(sessionId: \"bg_42\") -> initialize response\n\n3. process.write(sessionId: \"bg_42\", data: '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"session/new\",\"params\":{\"cwd\":\"/home/user/myproject\",\"mcpServers\":[]}}\\n')\n   process.poll(sessionId: \"bg_42\") -> opencodeSessionId: \"sess_xyz789\"\n\n4. process.write(sessionId: \"bg_42\", data: '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"session/prompt\",\"params\":{\"sessionId\":\"sess_xyz789\",\"prompt\":[{\"type\":\"text\",\"text\":\"List all TypeScript files\"}]}}\\n')\n   \n5. process.poll(sessionId: \"bg_42\") every 2 sec until stopReason\n   -> Collect all session/update content\n   -> Final response: stopReason: \"end_turn\"\n\n6. When done: process.kill(sessionId: \"bg_42\")\n\nResume Session\n\nResume a previous OpenCode session by letting the user choose from available sessions.\n\nStep 1: List Available Sessions\nbash(command: \"opencode session list\", workdir: \"/path/to/project\")\n\n\nExample output:\n\nID                                  Updated              Messages\nses_451cd8ae0ffegNQsh59nuM3VVy      2026-01-11 15:30     12\nses_451a89e63ffea2TQIpnDGtJBkS      2026-01-10 09:15     5\nses_4518e90d0ffeJIpOFI3t3Jd23Q      2026-01-09 14:22     8\n\nStep 2: Ask User to Choose\n\nPresent the list to the user and ask which session to resume:\n\n\"Which session would you like to resume?\n \n1. ses_451cd8ae... (12 messages, updated 2026-01-11)\n2. ses_451a89e6... (5 messages, updated 2026-01-10)\n3. ses_4518e90d... (8 messages, updated 2026-01-09)\n\nEnter session number or ID:\"\n\nStep 3: Load Selected Session\n\nOnce user responds (e.g., \"1\", \"the first one\", or \"ses_451cd8ae...\"):\n\nStart OpenCode ACP:\n\nbash(command: \"opencode acp --cwd /path/to/project\", background: true, workdir: \"/path/to/project\")\n\n\nInitialize:\n\n{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"initialize\",\"params\":{...}}\n\n\nLoad the session:\n\n{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"session/load\",\"params\":{\"sessionId\":\"ses_451cd8ae0ffegNQsh59nuM3VVy\",\"cwd\":\"/path/to/project\",\"mcpServers\":[]}}\n\n\nNote: session/load requires cwd and mcpServers parameters.\n\nOn load, OpenCode streams the full conversation history back to you.\n\nResume Workflow Summary\nfunction resumeSession(workdir):\n    # List available sessions\n    output = bash(\"opencode session list\", workdir: workdir)\n    sessions = parseSessionList(output)\n    \n    if sessions.empty:\n        notify(\"No previous sessions found. Starting fresh.\")\n        return createNewSession(workdir)\n    \n    # Ask user to choose\n    choice = askUser(\"Which session to resume?\", sessions)\n    selectedId = matchUserChoice(choice, sessions)\n    \n    # Start OpenCode and load session\n    process = bash(\"opencode acp --cwd \" + workdir, background: true, workdir: workdir)\n    initialize(process)\n    \n    session_load(process, selectedId, workdir, mcpServers: [])\n    \n    notify(\"Session resumed. Conversation history loaded.\")\n    return process\n\nImportant Notes\nHistory replay: On load, all previous messages stream back\nMemory preserved: Agent remembers the full conversation\nProcess independent: Sessions survive OpenCode restarts\nUpdating OpenCode\n\nOpenCode auto-updates when restarted. Use this workflow to check and trigger updates.\n\nStep 1: Check Current Version\nbash(command: \"opencode --version\")\n\n\nReturns something like: opencode version 1.1.13\n\nExtract the version number (e.g., 1.1.13).\n\nStep 2: Check Latest Version\nwebfetch(url: \"https://github.com/anomalyco/opencode/releases/latest\", format: \"text\")\n\n\nThe redirect URL contains the latest version tag:\n\nRedirects to: https://github.com/anomalyco/opencode/releases/tag/v1.2.0\nExtract version from the URL path (e.g., 1.2.0)\nStep 3: Compare and Update\n\nIf latest version > current version:\n\nStop all running OpenCode processes:\n\nprocess.list()  # Find all \"opencode acp\" processes\nprocess.kill(sessionId) # For each running instance\n\n\nRestart instances (OpenCode auto-downloads new binary on start):\n\nbash(command: \"opencode acp --cwd /path/to/project\", background: true, workdir: \"/path/to/project\")\n\n\nRe-initialize each instance (initialize + session/load for existing sessions)\n\nStep 4: Verify Update\nbash(command: \"opencode --version\")\n\n\nIf version still doesn't match latest:\n\nInform user: \"OpenCode auto-update may have failed. Current: X.X.X, Latest: Y.Y.Y\"\nSuggest manual update: curl -fsSL https://opencode.dev/install | bash\nUpdate Workflow Summary\nfunction updateOpenCode():\n    current = bash(\"opencode --version\")  # e.g., \"1.1.13\"\n    \n    latestPage = webfetch(\"https://github.com/anomalyco/opencode/releases/latest\")\n    latest = extractVersionFromRedirectUrl(latestPage)  # e.g., \"1.2.0\"\n    \n    if semverCompare(latest, current) > 0:\n        # Stop all instances\n        for process in process.list():\n            if process.command.includes(\"opencode\"):\n                process.kill(process.sessionId)\n        \n        # Wait briefly for processes to terminate\n        sleep(2 seconds)\n        \n        # Restart triggers auto-update\n        bash(\"opencode acp\", background: true)\n        \n        # Verify\n        newVersion = bash(\"opencode --version\")\n        if newVersion != latest:\n            notify(\"Auto-update may have failed. Manual update recommended.\")\n    else:\n        notify(\"OpenCode is up to date: \" + current)\n\nImportant Notes\nSessions persist: opencodeSessionId survives restarts — use session/load to recover\nAuto-update: OpenCode downloads new binary automatically on restart\nNo data loss: Conversation history is preserved server-side"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/studio-hakke/opencode-acp-control-2",
    "publisherUrl": "https://clawhub.ai/studio-hakke/opencode-acp-control-2",
    "owner": "studio-hakke",
    "version": "0.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/opencode-acp-control-2",
    "downloadUrl": "https://openagent3.xyz/downloads/opencode-acp-control-2",
    "agentUrl": "https://openagent3.xyz/skills/opencode-acp-control-2/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opencode-acp-control-2/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opencode-acp-control-2/agent.md"
  }
}