gemini
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGemini Second Opinion
Gemini第二意见
Use Gemini to get an independent review from a model with a 1M+ token context window.
使用Gemini获取来自具备1M+ token上下文窗口的模型的独立评审意见。
Invocation
调用方式
Use for non-interactive (headless) mode. Always use for plain text output.
-p-o textPrefer telling Gemini to read files directly over piping via stdin. Gemini can read files within the project workspace on its own, and stdin truncates at 8MB.
bash
undefined使用参数启用非交互式(无界面)模式。始终使用参数以获取纯文本输出。
-p-o text优先让Gemini直接读取文件,而非通过标准输入(stdin)管道传输内容。Gemini可自行读取项目工作区内的文件,而stdin会在8MB处截断内容。
bash
undefinedPREFERRED: Tell Gemini to read files itself (non-interactive)
推荐方式:让Gemini自行读取文件(非交互式)
gemini -p "Read the files in /path/within/project/ and review them for bugs" -o text
```bashgemini -p "Read the files in /path/within/project/ and review them for bugs" -o text
```bashOK for small content: pipe via stdin
适用于小体积内容:通过stdin管道传输
git diff main..HEAD | gemini -p "Review this diff for issues" -o text
undefinedgit diff main..HEAD | gemini -p "Review this diff for issues" -o text
undefinedWorkspace Sandbox
工作区沙箱
Gemini is sandboxed to the project directory. It cannot read files outside the workspace, even via symlinks.
If files live outside the project (e.g., ), copy them into the project first, then clean up after:
~/.claude/bash
cp -r ~/.claude/some-data /path/to/project/.tmp-data
gemini -o text "Read the files in /path/to/project/.tmp-data/ and analyze them"
rm -rf /path/to/project/.tmp-dataGemini被限制在项目目录的沙箱中。它无法读取工作区外的文件,即使通过符号链接也不行。
如果文件位于项目外部(例如),请先将其复制到项目内,之后再清理:
~/.claude/bash
cp -r ~/.claude/some-data /path/to/project/.tmp-data
gemini -o text "Read the files in /path/to/project/.tmp-data/ and analyze them"
rm -rf /path/to/project/.tmp-dataWorkflow
工作流程
- Gather context: Identify the files, plans, or diffs Gemini needs
- Ensure accessibility: If files are outside the workspace, copy them in
- Compose a focused prompt: Be specific about what to review and what feedback you want
- Invoke Gemini: Tell it to read files directly, or pipe small content via stdin. Always use and
-p-o text - Clean up: Remove any temporary copies
- Report findings: Present Gemini's feedback to the user with your own assessment of which points are valid
- 收集上下文:确定Gemini需要处理的文件、方案或差异内容
- 确保可访问性:若文件在工作区外,先将其复制进来
- 编写明确的提示词:具体说明评审内容和所需反馈类型
- 调用Gemini:让它直接读取文件,或通过stdin传输小体积内容。始终使用和
-p参数-o text - 清理工作:删除所有临时复制的文件
- 汇报结果:向用户呈现Gemini的反馈,并附上你对哪些反馈有效的评估
Prompt Guidelines
提示词指南
- State the review goal explicitly (e.g., "find logical errors", "evaluate scalability", "check for missing edge cases")
- Include constraints or requirements Gemini should check against
- Ask for structured output (numbered issues, severity levels) for actionable feedback
- For large volumes of files, tell Gemini to read the directory rather than listing each file
- 明确说明评审目标(例如:“查找逻辑错误”、“评估可扩展性”、“检查是否遗漏边缘情况”)
- 列出Gemini需要对照检查的约束条件或要求
- 要求结构化输出(如编号问题、严重程度等级)以获取可执行的反馈
- 针对大量文件,让Gemini读取整个目录而非逐个列出文件