360 Secure SkillHub
360 安全技能中心

occ

该 Skill 提供 OpenCode 控制器脚本,前置条件是已安装 OpenCode CLI。脚本会扫描 4096-4200 端口查找已有 OpenCode Server,未找到则自动启动,并通过会话 API 创建、查询和续接开发会话以执行编码任务;脚本在当前工作目录运行,会话即创建于该目录。

gongxh13
gongxh13
热度 54.47
最近更新 2026-05-11 17:31:38
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / 自动化脚本 / 工作流 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add occ
Metadata
name
occ
description
Control OpenCode to execute development tasks. Provides session management and task execution capabilities.

OCC (OpenCode Controller)

Control OpenCode to execute development tasks via CLI.

When to Use

Use this skill when:

  • You want to delegate coding tasks to OpenCode
  • You need to control OpenCode from external systems (like OpenCLAW)
  • You want to automate development workflows

Quick Start

Prerequisites

OpenCode CLI must be installed and available in PATH.

Workflow

Step 1: Choose Working Directory

⚠️ Important: Run the script in the directory where you want OpenCode to work. The session will be created in the current directory.

Step 2: Decide Session Mode

  • New session: Use create command (creates session only, then use continue to execute task)
  • Continue existing session: Use continue command (session ID provided by caller)

Step 3: Run Command

# Query existing sessions
node skills/occ/scripts/bin/opencode-server.js query

# Create a new session
node skills/occ/scripts/bin/opencode-server.js create "Create a React login page"

# Continue a session
node skills/occ/scripts/bin/opencode-server.js continue <session-id> "Add password reset"

How It Works

The script automatically handles OpenCode Server:

  1. Port Detection: Scans ports 4096-4200 to find an existing OpenCode Server
  2. Auto-Start: If no server is found, automatically starts a new one
  3. Session Management: Creates and manages development sessions through OpenCode's session API