Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计通过

opencode-cliopencode CLI 命令行

Agent Skill

opencode-cli 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 OpenClaw 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

10,282

周安装

420

GitHub Stars

1

下载量

3,293
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:opencode-cli(opencode CLI 命令行)
来源仓库:https://github.com/tchen6500/opencode-cli
安装命令:
openclaw skills install opencode-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install opencode-cli

简介

opencode-cli 是 OpenCode CLI 集成技能,专为 OpenClaw 等 AI 代理设计的编码任务执行模块。

  • 采用计划→构建工作流程,支持会话管理与上下文保持。
  • 适用于复杂多文件项目的自动化开发场景。
  • 使用前需验证 CLI 工具路径与环境变量配置。
  • 建议参考原始文档了解错误处理与日志输出规范。

SKILL.md

name
opencode-cli
description
OpenCode CLI integration skill. Designed for AI agents like OpenClaw to execute coding tasks via OpenCode CLI. Core features: (1) Plan→Build workflow (2) Session management (3) MCP integration (4) Background task monitoring. Use this skill when you need: multi-step coding, Plan→Build workflow, MCP integration, or background task monitoring. NOT for: simple one-line edits (use edit tool directly), quick file reads (use read tool directly).
dependencies
skills
tools
env
optional

OpenCode CLI Integration

This skill is designed for AI agents like OpenClaw to execute coding tasks via OpenCode CLI.

OpenCode is an AI-powered code editor CLI. When called via OpenClaw, only CLI mode is used.


Security Scope

What this skill does:

  • Integrates with OpenCode CLI for coding tasks
  • Manages sessions, plans, and builds
  • Optionally connects to configured MCP servers (Playwright, Supabase, Context7)

What this skill does NOT do:

  • Install or modify system-wide packages
  • Access credentials outside configured MCP servers
  • Persist beyond user-initiated sessions

Credential access:

  • MCP servers (if configured) may use environment variables like SUPABASE_URL, SUPABASE_ANON_KEY, CONTEXT7_API_KEY
  • Skills run in project context; avoid committing secrets to version control
  • Only use this skill in repositories/environments you trust

Core Command

opencode run -m <provider/model> -- "<prompt>"

Example:

opencode run -m <provider/model> -- "Add error handling to the login function"

Plan→Build Workflow (Core)

⚠️ Key Rule: Maintain Same Session

Correct approach:

# 1. Start Plan (creates session)
opencode run -m <model> -- 'Analyze task, output plan.'

# 2. Wait for user APPROVE

# 3. Switch to Build (continue same session)
opencode run --continue --agent build -- 'Implement approved plan.'

Wrong approach (context lost):

❌ opencode run --agent plan "..."   # session A
❌ opencode run --agent build "..."  # session B (separate!)

Agent Options

AgentPurpose
planPlanning, analysis, design
buildImplementation, coding, modification
exploreCodebase exploration

Session Management

opencode run --continue -- '<prompt>'
opencode run --session <id> -- '<prompt>'
opencode run --continue --fork -- '<prompt>'
opencode session list
opencode session delete <id>

OpenClaw Integration

Standard Task

opencode run -m <model> -- '<task>'

Background Task

opencode run -m <model> -- '<task>'
process action:poll sessionId:<id> timeout:30000
process action:log sessionId:<id>
process action:kill sessionId:<id>

Monitoring Discipline

⚠️ Mandatory: After starting, must actively monitor. Do not wait for system event.
Start → Get sessionId
  ↓
Every 30-60s: poll + log
  ↓
Progress → Report
Error → Report immediately
Complete → Report result (do not wait for event)

Violation criteria:

  • Start without monitoring → Abandoning responsibility
  • User asks "is it done?" before checking → Failure

MCP Integration

OpenCode supports MCP integration to extend capabilities. Must run in project root directory.

Common tools: Playwright (UI automation), Supabase (database)

Scenario guide:

ScenarioReference
Need UI automation testing (Playwright)references/mcp-config-guide.md
Need database operations (Supabase)references/mcp-config-guide.md
MCP not loading, troubleshoot configreferences/mcp-config-guide.md

Built-in Tools

OpenCode Agent built-in tools: read/write/edit, bash, grep/glob, todowrite, skill, webfetch

Scenario guide:

ScenarioReference
Unsure if Agent can perform an operationreferences/built-in-tools-guide.md
Plan Agent reports insufficient permissionsreferences/built-in-tools-guide.md (see tool permissions table)

Practical Tips

  • File reference: Use @filename to quickly reference files
  • Undo changes: /undo to undo, /redo to restore

Scenario guide:

ScenarioReference
Want to reference file instead of typing pathreferences/tips-guide.md (file reference)
Made mistake and want to rollbackreferences/tips-guide.md (undo/redo)
Want to learn TUI shortcutsreferences/tips-guide.md (shortcuts)

Skills Configuration

Scenario guide:

ScenarioReference
Want to add custom skillreferences/skills-config-guide.md
Unsure where to place skill filesreferences/skills-config-guide.md

Common Patterns

Note: Examples use openclaw system event for optional task notification. This is an OpenClaw platform command. Omit if running outside OpenClaw.

Planning Task

opencode run -m <model> -- 'Analyze task, output plan.'

For detailed plan format, see project workflow documentation.

Implementation Task

opencode run -m <model> -- 'Execute approved plan.'

Verify with: npm run build && npm test

Database Operations

cd /path/to/project
opencode run -m <model> -- 'Use Supabase MCP for database operations.'

See: references/mcp-config-guide.md for MCP setup.

UI Testing

opencode run -m <model> -- 'Use Playwright MCP for UI testing.'

See: references/mcp-config-guide.md for MCP setup.


Troubleshooting

sysctl not found

export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"

MCP not loading

Ensure running in project root:

cd /path/to/project && opencode run ...

See: references/mcp-config-guide.md

Session context lost

Use --continue instead of separate starts:

✅ opencode run --continue --agent build "..."
❌ opencode run --agent build "..."

Quick Reference

Common Commands

TaskCommand
Plan taskopencode run -m <model> -- 'Analyze...'
Build (continue session)opencode run --continue --agent build -- 'Implement...'
Continue last sessionopencode run --continue
Specific sessionopencode run --session <id>
Fork sessionopencode run --continue --fork
List sessionsopencode session list
Delete sessionopencode session delete <id>
View modelsopencode models

OpenClaw Integration

TaskCommand
Background taskpty:true background:true command:"opencode run..."
Monitor progressprocess action:poll sessionId:<id>
View logsprocess action:log sessionId:<id>
Terminate taskprocess action:kill sessionId:<id>

Configuration Guide Index

ScenarioReference
UI automation / Database operationsreferences/mcp-config-guide.md
Agent tool capabilities / Permissionsreferences/built-in-tools-guide.md
Shortcuts / File reference / Undoreferences/tips-guide.md
Add custom skillreferences/skills-config-guide.md

*CLI Integration v2.6 - 2026-04-05*

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

89.65%
按下载量换算2,952

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills