opencode-server-api skill
✓ 検証済みOpenCode 2.x サーバーに対して読み取り専用のクエリを実行し、セッション、メッセージ履歴、MCP ステータス、SKILL、およびエージェントを調査します。
- GitHubスター
- 13
- ファイル
- 1
- 最終コミット
- 2026年10月30日
- ライセンス
- MIT
- 許可されたツール
- —
opencode-server-api skillは何をしますか
OpenCode 2.x サーバーに対して読み取り専用のクエリを実行し、セッション、メッセージ履歴、MCP ステータス、SKILL、およびエージェントを調査します。
skillのSKILL.mdから生成された要約。
opencode-server-api skill について
この SKILL は、開発者や AI エージェントが OpenCode 2.x サーバーの状態や履歴を調査できるようにします。サーバー情報、アクティブなセッション、メッセージ履歴、および接続されている MCP server のステータスを照会するための読み取り専用インターフェースを提供します。ユーザーが現在のセッション、利用可能な SKILL、接続されているツール、または保留中の権限リクエストについて尋ねた場合、エージェントはこのツールをロードする必要があります。
ユーザーは、環境変数 OPENCODE_SERVER_PASSWORD に保存されたパスワードを使用した HTTP 基本認証による GET リクエストを通じてサーバーとやり取りします。この SKILL は、すべてのルートとパラメータの呼び出しが正確であることを保証するために、サーバーから最新の OpenAPI 仕様を取得することに依存しています。セッションの結果、メッセージタイプ、さらにはメッセージ履歴内の最新の todowrite ツール呼び出しの入力を解析することで、todo リストなどの詳細な情報を取得できます。この機能は読み取り専用操作に厳格に制限されており、サーバー状態の変更、フォームへの回答、または生の構成ファイルへのアクセスには使用できません。
エージェントができること
- 1アクティブな todo リストの取得最新の todowrite ツール呼び出しを調査することで、保留中のタスクの現在のリストを見つけます。
skill の SKILL.md から作成されています。すべてのユースケースは、その引用と照合されています。
opencode-server-api skillのインストール方法
各コマンドはskillフォルダをクライアントのskillsディレクトリにコピーします。読み込むには、クライアントを再起動するか新しいセッションを開始してください。Claude Codeにopencode-server-api skillをインストールする
~/.claude/skills/opencode-server-api/SKILL.md
$ npx degit kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api ~/.claude/skills/opencode-server-apiClaude Code (project)にopencode-server-api skillをインストールする
.claude/skills/opencode-server-api/SKILL.md
$ npx degit kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api .claude/skills/opencode-server-apiCodexにopencode-server-api skillをインストールする
~/.agents/skills/opencode-server-api/SKILL.md
$ npx degit kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api ~/.agents/skills/opencode-server-apiGemini CLIにopencode-server-api skillをインストールする
~/.gemini/skills/opencode-server-api/SKILL.md
$ npx degit kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api ~/.gemini/skills/opencode-server-apiClaude.aiにopencode-server-api skillをインストールする
npx degit kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api opencode-server-api && zip -r opencode-server-api.zip opencode-server-api # claude.ai → Customize → Skills → + → Create skill → Upload a skill → opencode-server-api.zip
自動チェック
実行日 2026年11月16日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。エージェントに実行させる前にスクリプトを読んでください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api is public and reachablegithub.com/kevinlin/cowork-z/tree/HEAD/src-tauri/resources/s ↗合格
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit 2026-10-30github.com/kevinlin/cowork-z/commits ↗合格
- スクリプトにダウンロード実行や認証情報の窃取がないNo scripts in the skill folder合格
- SKILL.md に隠れた指示がないNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/kevinlin/cowork-z/blob/HEAD/src-tauri/resources/s ↗合格
- 事前許可ツールが限定されているNo pre-approved tools; the agent asks before using onegithub.com/kevinlin/cowork-z/blob/HEAD/src-tauri/resources/s ↗合格
- SKILL.md が Agent Skills の形式に従っているValid name and description; says when to use it; 91 linesgithub.com/kevinlin/cowork-z/blob/HEAD/src-tauri/resources/s ↗合格
SKILL.md
GitHubで表示OpenCode Server API
This skill lets you inspect the OpenCode server you run on — server info, sessions, message history (including your todo lists), pending permission and question requests, MCP status, skills and agents. It is read-only: use GET requests only.
Authentication
The server port is in your system prompt, inside the <server-access> block. The basic-auth password is already in your shell environment as OPENCODE_SERVER_PASSWORD; your shell expands it locally. Every request needs HTTP basic auth:
curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:$PORT/<endpoint>
Replace $PORT with the port from your system prompt. Use $OPENCODE_SERVER_PASSWORD exactly as written (PowerShell: $env:OPENCODE_SERVER_PASSWORD).
NEVER print, echo, log, or write the password's value anywhere — not to the chat, not to files, not to command output. Only reference it as a shell variable inside commands.
IMPORTANT: Fetch the API Spec First
Before calling ANY endpoint, fetch the live OpenAPI spec. It is the source of truth for routes, parameters and response shapes, and it may be newer than this skill.
curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" http://localhost:$PORT/openapi.json
Do not guess from the examples below; verify against the spec first.
Conventions
- All API routes live under
/api/. Answers are wrapped:{"data": ...}, plus"location"on location-scoped routes. - Location-scoped routes (
/api/mcp,/api/skill,/api/agent) take the workspace folder as alocation[directory]query parameter. The brackets break plain curl URLs, so pass it with-G --data-urlencode:
curl -s -G -u "opencode:$OPENCODE_SERVER_PASSWORD" \
--data-urlencode "location[directory]=<workspace path>" \
http://localhost:$PORT/api/mcp
The workspace path is given in your system prompt (<workspace-conventions>). Session routes need no location.
Endpoints (all GET)
| Route | Returns |
|---|---|
/api/info |
Server version, pid, urls. Use it as the health check. |
/api/session |
{data: [session]} — your sessions. Optional directory, limit, search. |
/api/session/{id} |
{data: session} — id, model, outcome, time, location, permissions. |
/api/session/{id}/message |
{data: [message], cursor} — history. Pass order=desc for newest first, order=asc for oldest first. |
/api/session/{id}/permission |
{data: [request]} — permission requests waiting for an answer. |
/api/session/{id}/form |
{data: [form]} — questions waiting for an answer. |
/api/mcp |
{data: [{name, status: {status, error?}}]} — MCP servers. |
/api/skill |
{data: [{id, name, path, content}]} — available skills. |
/api/agent |
{data: [agent]} — available agents and their models. |
Find your own session in /api/session (filter with directory=<workspace path>).
/api/session/{id}/message
Messages have a type (user, assistant, idle, …). An assistant message has a content array of text, reasoning and tool items. A tool item is {type: "tool", name, state: {status, input, content}}.
Your todo list is the input.todos of your newest todowrite call: read the history newest first (order=desc), find the first tool item named todowrite and take state.input.todos ([{content, status}], status pending, in_progress or completed). There is no todo route.
curl -s -u "opencode:$OPENCODE_SERVER_PASSWORD" "http://localhost:$PORT/api/session/ses_abc123/message?order=desc"
/api/mcp
status.status is one of connected, pending (still connecting), disabled, failed or needs_auth; error is set on the last two. The list also includes servers from the user's global OpenCode config.
/api/session/{id}/permission and /form
Pending permission request: {id, action, resources, metadata, message?}. Pending form: {id, title, fields: [{key, type, options?}]}. Both are empty when nothing is waiting.
Out of scope
Do not call routes that change state (creating or deleting sessions, prompting, interrupting, answering permissions or forms, editing config or MCP servers). The user decides those in the app. Do not call any route that handles credentials or provider sign-in either; they are not part of this skill. Do not call /api/config: it returns the user's raw config files, which can hold API keys.
Usage Guidance
- Check health (
/api/info) before other calls when the server seems unresponsive. - Review your own work (
/api/session/{id}/message) to see what you have said and done. - Check todos by reading your newest
todowritecall from the message history. - List skills (
/api/skill) when asked about your capabilities. - Check MCP status (
/api/mcp) when asked about connected tools or servers. - List agents (
/api/agent) to understand your current setup.
このスキルのファイル
1opencode-server-api skillに関する質問
Claude Codeにopencode-server-api skillをインストールするには
npx degit kevinlin/cowork-z/src-tauri/resources/skills/opencode-server-api ~/.claude/skills/opencode-server-apiを実行してください。Claude Codeは~/.claude/skills(すべてのプロジェクト)または.claude/skills(単一プロジェクト)からskillsを読み込み、説明がタスクに一致する場合にskillを使用します。
opencode-server-api skillはどのクライアントで使用できますか
Agent Skills形式を読み込むすべてのクライアントで使用できます: Claude Code、Codex、Gemini CLI、claude.ai(ZIPとしてアップロード)。skill内のスクリプトは、クライアントがコード実行を許可した場合にのみ実行されます。
OpenCode サーバーのヘルスチェックを行うにはどうすればよいですか?
/api/info エンドポイントを使用して、サーバーのバージョン、PID、および URL を取得できます。これがヘルスチェックとして機能します。
API を介して todo リストにアクセスするにはどうすればよいですか?
専用の todo ルートはありません。代わりに、メッセージ履歴を降順で読み取り、最初の todowrite ツール項目を見つけて、state.input.todos フィールドを抽出する必要があります。
API エンドポイントを呼び出す前に何をすべきですか?
正しいルート、パラメータ、およびレスポンス形式を確認するために、まず最新の OpenAPI 仕様を取得する必要があります。