using-opencode-cli

Dispatch and monitor local OpenCode CLI agent tasks with session reuse.

35|5|Updated Sep 20, 2025
One-click install
npx skills add https://github.com/zhanglongxiao111/indesign-cli --skill using-opencode-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-opencode-cli
Source: https://github.com/zhanglongxiao111/indesign-cli/tree/main/.codex/skills/using-opencode-cli
Command: npx skills add https://github.com/zhanglongxiao111/indesign-cli --skill using-opencode-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill solves the problem of running reliable local OpenCode agent tasks from Codex without losing control over prompts, model settings, session continuity, and output monitoring.

Core Features & Use Cases

  • Deterministic OpenCode invocation rules: Enforces PowerShell 7 usage, default model selection, fixed reasoning depth (variant max), and prompt handling where Codex fully composes the prompt and the script passes it through without auto-adding extra guidance.
  • Three execution modes with the right monitoring strategy: Supports observe mode for interactive one-off tasks, managed mode for long-running multi-turn tasks with RunDir state tracking, and front-of-screen style foreground short tests that emit only session ID and assistant text.
  • Session reuse and status summarization: Reuses sessionID for the same code path/plan, supports fork vs continue behavior, and provides status summaries via metadata.json/status.json plus optional lightweight event hooks.

Real-world use case: use this Skill to perform a multi-round repository security/code review by running OpenCode locally in managed mode, polling status by RunDir, and continuing the same session across multiple checkpoints without reopening fresh threads that dilute context.

Quick Start

Ask Codex to run a local OpenCode task in observe mode using the task markdown file docs/AI协作/本地Agent/进行中/[目录]/任务_[主题]_OpenCode.md, so you can see the session progress in a visible Windows Terminal window and capture the final conclusion.

Frequently Asked Questions about using-opencode-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run local agent code reviews with long-context continuation?

To run local agent code reviews with long-context continuation, dispatch OpenCode CLI tasks in managed mode. This mode tracks RunDir state and supports multi-round planning by polling status and reusing session IDs across checkpoints without diluting context.

How does session reuse work for multi-round code auditing?

Session reuse for multi-round code auditing works by persisting the same session ID for a given code path. It supports both fork and continue behaviors, allowing you to resume a managed OpenCode thread across multiple checkpoints while retaining full context.

Can I control prompt passthrough and model settings when running local OpenCode tasks?

You can control prompt passthrough and model settings by using deterministic invocation rules. The script passes your fully composed prompt through without adding extra guidance, defaulting to deepseek-v4-pro with --variant max for fixed reasoning depth.

What execution modes are available for local agent orchestration?

Local agent orchestration offers three execution modes: observe for interactive one-off tasks, managed for long-running multi-turn tasks with RunDir state tracking, and foreground for short tests that emit only session ID and assistant text.

Do I need PowerShell 7 to run OpenCode CLI agent tasks?

You need PowerShell 7 to run OpenCode CLI agent tasks safely. The execution environment enforces PowerShell 7 usage to ensure deterministic OpenCode invocation, fixed model configuration, and reliable session reuse semantics during local code auditing.

How do I monitor long-running OpenCode agent status locally?

To monitor long-running OpenCode agent status locally, use lightweight status polling via metadata.json and status.json files in the RunDir. You can also configure optional event hooks to receive safe incremental retrieval updates during managed mode execution.