Token导航 LogoToken导航

Agent Skill · 研究检索

claude-cli-agent-protocol(Claude CLI Agent protocol 搜索)

claude-cli-agent-protocol 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

claude-cli-agent-protocol 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 67,870。

总安装 240周安装 10GitHub Stars 公开资料未说明下载 80核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-protocol

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

claude-cli-agent-protocol 定义如何通过 NDJSON 流可靠集成 Claude Code CLI。重点解决 stdout 解析、 stdin 控制、中断恢复和批准流程一致性等问题。

推荐使用 --output-format stream-json 和 --replay-user-messages 参数保障稳定性。适用于希望构建自定义 IDE 或 CI/CD 集成工具的开发者参考。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/claude-cli-agent-protocol

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

claude-cli-agent-protocol 怎么安装?

在终端执行 npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-protocol。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

claude-cli-agent-protocol 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

claude-cli-agent-protocol 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-protocol 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

claude-cli-agent-protocol 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

claude-cli-agent-protocol 用的人多吗?

公开数据是累计安装 240 次,近一周安装 10 次,下载 80 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

claude-cli-agent-protocol 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
claude-cli-agent-protocol

Claude CLI Agent protocol 搜索 · 本页

240—执行命令未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Claude CLI Agent Protocol

Overview

Integrate Claude Code CLI via NDJSON in a way that preserves true runtime state in the host UI:

  • parse all relevant stdout message types
  • send correctly shaped stdin control messages
  • handle replay and partial-stream behavior explicitly
  • keep interrupt and approval flows consistent

This skill is optimized for host builders who need reliable liveness, queueing, replay dedup, and approval UX.

Required CLI Flags

claude \
  -p \
  --output-format stream-json \
  --input-format stream-json \
  --verbose \
  --permission-prompt-tool stdio

Optional but important:

  • --replay-user-messages

- Re-emits user stdin messages on stdout for acknowledgment. - Echoed user messages include isReplay, uuid, and parent_tool_use_id.

  • --include-partial-messages

- Required if your host expects stream_event partial deltas (message_start, content_block_delta, etc.). - Without this flag, many runs emit only final assistant + result turn outputs.

Important flag constraints:

  • --input-format=stream-json requires --output-format=stream-json.
  • --replay-user-messages requires stream-json input and output.
  • --include-partial-messages works with --print and stream-json output.
  • Do not rely on prompt positional arg when building a long-lived host; send user envelopes via stdin.

Protocol Shape (NDJSON)

All messages are newline-delimited JSON objects with top-level type.

For streaming, the runtime envelope is:

{
  "type": "stream_event",
  "event": {
    "type": "content_block_delta",
    "index": 0,
    "delta": {"type": "text_delta", "text": "chunk"}
  }
}

Do not assume top-level content_block_delta envelopes in host parsing.


Emission Semantics (Critical)

Partial output behavior

  • With --include-partial-messages: host receives stream_event payloads.
  • Without it: host often receives only final assistant and result messages.

Host impact:

  • If UI "Thinking/Writing" depends only on partial deltas, it may appear idle/blank unless --include-partial-messages is enabled.

Replay behavior

With --replay-user-messages, echoed user messages include replay markers:

{
  "type": "user",
  "message": {"role": "user", "content": [{"type": "text", "text": "ping"}]},
  "session_id": "...",
  "parent_tool_use_id": null,
  "uuid": "...",
  "isReplay": true
}

Host rule:

  • Deduplicate using uuid (plus turn/session context if needed).

Result semantics

result.subtype == "success" does not mean no error by itself. Always evaluate is_error as authoritative:

{
  "type": "result",
  "subtype": "success",
  "is_error": true,
  "result": "Not logged in - Please run /login"
}

This can also accompany non-zero process exit status.


Request Lifecycles

Normal request (init -> response -> result)

  1. Host starts process.
  2. CLI emits system subtype:init.
  3. Host sends user stdin message.
  4. CLI may emit stream_event messages (if partial enabled).
  5. CLI emits assistant message(s).
  6. CLI may emit control_request (tool approval).
  7. Host sends control_response.
  8. CLI emits user tool_result echoes.
  9. CLI emits terminal result.

Interrupted request

Preferred:

  1. Host sends stdin control_request with request.subtype: "interrupt".
  2. CLI emits control_response success.
  3. CLI emits result for terminated turn.
  4. Host sends next queued user message.

Interrupt during pending tool approval

Two valid strategies:

  1. Cancel then interrupt:
  • Send control_cancel_request for pending request_id.
  • Send control_request interrupt.
  1. Deny + interrupt in one response:
  • Send control_response with behavior: "deny" and interrupt: true.

Pick one strategy and apply it consistently.


Stdout Message Types (CLI -> Host)

These are the host-relevant types to parse.

system

Common subtypes:

  • init
  • status
  • informational
  • api_error
  • hook_started
  • hook_progress
  • hook_response
  • stop_hook_summary
  • task_notification
  • turn_duration
  • compact_boundary
  • microcompact_boundary
  • local_command

Typical init fields include: cwd, session_id, tools, mcp_servers, model, permissionMode, slash_commands, claude_code_version, agents, skills, plugins, uuid.

assistant

Contains complete assistant message blocks:

  • text
  • tool_use
  • thinking (if enabled)

May include parent_tool_use_id for subagent/tool-threaded messages.

user

Used for:

  • tool result echo blocks (type: tool_result)
  • replayed user echo events when replay flag is enabled (isReplay: true)

stream_event

Contains nested event payload.

Event types:

  • message_start
  • content_block_start
  • content_block_delta
  • content_block_stop
  • message_delta
  • message_stop

Observed delta types:

  • text_delta
  • input_json_delta
  • thinking_delta
  • signature_delta
  • citations_delta

control_request

Approval or control prompt from CLI, including:

  • request.subtype: "can_use_tool"
  • request_id
  • tool details (tool_name, input, tool_use_id, optional decision_reason)

control_response

Control command acknowledgment emitted by CLI (for host-issued control requests like interrupt/set mode/model).

control_cancel_request

Cancellation signal path exists in protocol surface for pending control requests. Treat as control-plane event.

result

Terminal turn summary with:

  • subtype
  • is_error
  • token/cost/turn metadata

Result subtypes:

  • success
  • error_during_execution
  • error_max_turns
  • error_max_budget_usd
  • error_max_structured_output_retries

keep_alive

Heartbeat ping message.

tool_use_summary

Optional summarized tool-use event stream for condensed status rendering.

auth_status

Optional authentication status updates.

streamlined_text and streamlined_tool_use_summary

Optional condensed output channels. Useful for thin UIs; safe to ignore in fully structured hosts.

Observed Type and Subtype Surface (2.1.37)

Observed host-facing top-level type values (runtime + binary scan):

  • system
  • assistant
  • user
  • stream_event
  • result
  • control_request
  • control_response
  • control_cancel_request
  • keep_alive
  • tool_use_summary
  • auth_status
  • streamlined_text
  • streamlined_tool_use_summary

Observed protocol-relevant subtype values from local 2.1.37 binary:

  • api_error
  • can_use_tool
  • compact_boundary
  • error
  • error_during_execution
  • error_max_budget_usd
  • error_max_structured_output_retries
  • error_max_turns
  • hook_callback
  • hook_progress
  • hook_response
  • hook_started
  • informational
  • init
  • interrupt
  • local_command
  • mcp_message
  • microcompact_boundary
  • status
  • stop_hook_summary
  • success
  • task_notification
  • turn_duration

Stdin Message Types (Host -> CLI)

user

{
  "type": "user",
  "message": {
    "role": "user",
    "content": [{"type": "text", "text": "Your prompt"}]
  },
  "uuid": "optional-client-uuid"
}

control_request

{
  "type": "control_request",
  "request_id": "req_123",
  "request": {
    "subtype": "interrupt"
  }
}

Supported subtypes (host-facing):

  • interrupt
  • initialize
  • set_permission_mode
  • set_model
  • set_max_thinking_tokens
  • mcp_status
  • mcp_message
  • mcp_set_servers
  • mcp_reconnect
  • mcp_toggle
  • rewind_files

control_response

Use for answering can_use_tool approval requests.

Allow:

{
  "type": "control_response",
  "response": {
    "subtype": "success",
    "request_id": "req_abc123",
    "response": {
      "behavior": "allow",
      "updatedInput": {"command": "ls -la"}
    }
  }
}

Deny:

{
  "type": "control_response",
  "response": {
    "subtype": "success",
    "request_id": "req_abc123",
    "response": {
      "behavior": "deny",
      "message": "User denied"
    }
  }
}

Deny + interrupt:

{
  "type": "control_response",
  "response": {
    "subtype": "success",
    "request_id": "req_abc123",
    "response": {
      "behavior": "deny",
      "message": "User denied and wants to stop",
      "interrupt": true
    }
  }
}

control_cancel_request

Cancel pending control request by request_id.

{
  "type": "control_cancel_request",
  "request_id": "req_abc123"
}

Tool Names and Input Fields

Common tool names and key inputs:

ToolInput Fields
Bashcommand, description, timeout, run_in_background
Readfile_path, offset, limit
Writefile_path, content
Editfile_path, old_string, new_string, replace_all
Globpattern, path
Greppattern, path, glob, type, output_mode, -A, -B, -C, -i, -n
WebFetchurl, prompt
WebSearchquery, allowed_domains, blocked_domains
Tasksubagent_type, description, prompt, model, run_in_background, resume
TaskOutputtask_id, block, timeout
TaskStoptask_id
NotebookEditnotebook_path, new_source, cell_id, cell_type, edit_mode
AskUserQuestionquestions
EnterPlanModeno params
ExitPlanModeallowedPrompts, pushToRemote
Skillskill, args
TaskCreatesubject, description, activeForm, metadata
TaskGettaskId
TaskUpdatetaskId, status, subject, description, owner, addBlocks, addBlockedBy
TaskListno params

Liveness Mapping for Host UI

Recommended runtime state mapping:

  • process started -> starting
  • system:init -> ready
  • stream_event or in-flight assistant turn -> thinking/streaming
  • control_request can_use_tool -> awaiting_approval
  • result -> idle (or error if is_error=true)
  • process exit / fatal stderr / repeated auth failures -> disconnected/error

Always expose last event timestamp so users can trust the session is alive.


Process Interruption

Preferred: protocol interrupt (control_request subtype:interrupt).

Fallback: OS signal only if protocol interrupt path fails or times out.

kill(processId, SIGINT);
process.terminate();
process.waitForFinished(500);
if (process.state() != NotRunning) process.kill();

Replay and Partial Handling Rules for Hosts

  1. Treat replayed user messages as acknowledgments, not new user intent.
  2. Deduplicate by uuid before rendering persistent chat bubbles.
  3. Merge stream_event deltas into one in-progress assistant draft per turn.
  4. Replace/complete draft on final assistant or result.
  5. Do not infer completion from lack of partial events if partial streaming is disabled.

Debugging

DEBUG_CLAUDE_AGENT_SDK=1 claude --debug ...

Capture debug logs:

claude ... --debug --debug-file /tmp/claude-debug.log

Protocol Discovery (Installed Binary)

Inspect local type and subtype surfaces for the exact installed version:

strings /path/to/claude | grep -o 'type:"[a-z_][a-z_]*"' | sort -u
strings /path/to/claude | grep -o 'subtype:"[a-z_][a-z_]*"' | sort -u

Sanity-check stream-json runtime quickly:

tmpid=$(uuidgen | tr '[:upper:]' '[:lower:]')
printf '%s\n' '{"type":"user","message":{"role":"user","content":[{"type":"text","text":"ping"}]},"uuid":"'"$tmpid"'"}' \
| claude -p --output-format stream-json --input-format stream-json --verbose --replay-user-messages --permission-prompt-tool stdio --session-id "$tmpid"

References

平台分布

Codex

36.34%
按下载量换算29

Claude

31.06%
按下载量换算25

Cursor

19.99%
按下载量换算16

Gemini CLI

8.66%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/bohdan-shulha/skills --skill claude-cli-agent-protocol 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills