/docs:headless-clifrom docs
无头模式 AI CLI 调用技能:支持 Gemini/Claude/Codex CLI 的无交互批量调用,包含 YOLO 模式和安全模式。用于批量翻译、代码审查、多模型编排等场景。
Ships in docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
无交互批量调用 AI CLI 工具,支持 stdin/stdout 管道,实现自动化工作流。
触发条件:
不适用于:
必需输入:
Codex CLI
# --yolo 是 --dangerously-bypass-approvals-and-sandbox 的别名
alias c='codex --enable web_search_request -m gpt-5.1-codex-max -c model_reasoning_effort="high" --yolo'
Claude Code
alias cc='claude --dangerously-skip-permissions'
Gemini CLI
# --yolo 或 --approval-mode yolo
alias g='gemini --yolo'
Codex CLI
# workspace-write 沙箱 + 失败时才审批
codex --full-auto "Your prompt"
Gemini CLI
# 自动批准编辑工具
gemini --approval-mode auto_edit "Your prompt"
Gemini CLI(禁用工具调用)
cat input.md | gemini -p "prompt" --output-format text --allowed-tools '' > output.md
Claude Code(Print 模式)
cat input.md | claude -p "prompt" --output-format text > output.md
Codex CLI(非交互执行)
codex exec "prompt" --json -o result.txt
批量翻译
# 设置代理(如需)
export http_proxy=http://127.0.0.1:9910
export https_proxy=http://127.0.0.1:9910
# Gemini 翻译
cat zh.md | gemini -p "Translate to English. Keep code/links unchanged." \
--output-format text --allowed-tools '' > en.md
代码审查
cat code.py | claude --dangerously-skip-permissions -p \
"Review this code for bugs and security issues. Output markdown." > review.md
多模型编排
# 模型 A 生成 → 模型 B 审查
cat spec.md | gemini -p "Generate code" --output-format text | \
claude -p "Review and improve this code" --output-format text > result.md
| 功能 | Gemini CLI | Claude Code | Codex CLI |
|---|---|---|---|
| YOLO 模式 | --yolo | --dangerously-skip-permissions | --yolo |
| 指定模型 | -m <model> | --model <model> | -m <model> |
| 非交互 | -p "prompt" | -p "prompt" | exec "prompt" |
| 输出格式 | --output-format text | --output-format text | --json |
| 禁用工具 | --allowed-tools '' | --disallowedTools | N/A |
| 继续对话 | N/A | -c / --continue | resume --last |
输入: 中文 Markdown 文件 步骤:
export http_proxy=http://127.0.0.1:9910
export https_proxy=http://127.0.0.1:9910
for f in docs/*.md; do
cat "$f" | timeout 120 gemini -p \
"Translate to English. Keep code fences unchanged." \
--output-format text --allowed-tools '' 2>/dev/null > "en_$(basename $f)"
done
预期输出: 翻译后的英文文件
输入: Python 代码文件 步骤:
cat src/*.py | claude --dangerously-skip-permissions -p \
"Review for: 1) Bugs 2) Security 3) Performance. Output markdown table." > review.md
预期输出: Markdown 格式的审查报告
输入: 技术问题 步骤:
question="How to implement rate limiting in Python?"
echo "$question" | gemini -p "$question" --output-format text > gemini_answer.md
echo "$question" | claude -p "$question" --output-format text > claude_answer.md
# 对比两个答案
diff gemini_answer.md claude_answer.md
预期输出: 两个模型答案的对比
references/gemini-cli.md - Gemini CLI 完整参数references/claude-cli.md - Claude Code CLI 参数references/codex-cli.md - Codex CLI 参数What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tianzecn/myclaudecode --plugin docs4 skills in this plugin
/claude-code-guideClaude Code 高级开发指南 - 全面的中文教程,涵盖工具使用、REPL 环境、开发工作流、MCP 集成、高级模式和最佳实践。适合学习 Claude Code 的高级功能和开发技巧。/claude-cookbooksClaude AI cookbooks - code examples, tutorials, and best practices for using Claude API. Use when learning Claude API integration, building Claude-powered applications, or exploring Claude capabilities./shipanyShipAny 中文文档 - AI SaaS 快速构建平台Other plugins' skills for the same job