Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

gemini-referenceGemini reference 搜索

Agent Skill

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

总安装

441

周安装

18

GitHub Stars

8

下载量

143
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/sirn/dotfiles --skill gemini-reference

简介

用于查找、检索和筛选相关信息。gemini-reference 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合根据关键词快速定位候选结果或来源线索。
  • 通过 GitHub 安装,建议确认搜索范围和结果过滤方式。
  • 可能触发联网请求,需评估数据源可靠性和更新频率。
  • 适用于 Codex、Claude、Cursor 和 Gemini CLI 研究场景。

SKILL.md

Gemini CLI Reference

Invoke the Gemini agent for sub-tasks using structured JSON output and explicit session management.

When to Use Gemini

Use Gemini when you need:

  • Large context window - Can process extensive codebases in one pass
  • General purpose tasks - Good balance of capability across domains
  • Fast responses - Flash models for quick analysis
  • Cost efficiency - Lower cost per token for large inputs

Capabilities

  • Core Tools: ReadFileTool, WriteFile, Edit, GlobTool, GrepTool, ShellTool.
  • MCP Servers:

- context7: Documentation queries. - brave-search: Web search (Brave).

  • Specialty: General purpose, large context window.

Calling from Another Agent

Use gemini "prompt" to spawn Gemini as a sub-agent:

# Delegate a documentation task
result=$(gemini "Generate API documentation for @src/api/" --output-format json)

# Extract the response and session_id for follow-up
response=$(echo "$result" | jq -r '.response')
session_id=$(echo "$result" | jq -r '.session_id')

Output Formats

FormatDescription
text (default)Plain text output
jsonSingle JSON object with response, stats, session_id
stream-jsonStreaming newline-delimited JSON (JSONL) events

JSON Response Fields:

  • response: (string) The model's final answer
  • stats: (object) Token usage and API latency metrics
  • session_id: (string) Session identifier for resuming
  • error: (object, optional) Error details if request failed

Streaming JSON Event Types:

  • init: Session metadata (session ID, model)
  • message: User and assistant message chunks
  • tool_use: Tool call requests with arguments
  • tool_result: Output from executed tools
  • error: Non-fatal warnings and system errors
  • result: Final outcome with aggregated statistics

Handling Blocked Actions

When Gemini needs approval for an action it wasn't configured to auto-approve, the command may pause or complete with an error. For agent delegation:

# Step 1: Initial attempt with conservative permissions
result=$(gemini "Fix the build errors" --output-format json --approval-mode default)

# Step 2: Check for errors
if echo "$result" | jq -e '.error' > /dev/null 2>&1; then
  error_msg=$(echo "$result" | jq -r '.error.message')
  echo "Action blocked: $error_msg"
  session_id=$(echo "$result" | jq -r '.session_id')

  # Step 3: Continue with auto_edit mode for file operations
  echo "Continue fixing build errors" > /tmp/continue.md
  result=$(gemini "Read /tmp/continue.md" \
    --resume "$session_id" \
    --output-format json \
    --approval-mode auto_edit)
fi

# Extract final response
final_response=$(echo "$result" | jq -r '.response')

Session Management for Agent Delegation

Starting a Task

mkdir -p .gemini/sessions
echo "*" > .gemini/.gitignore

# Write the task with full context
cat > .gemini/sessions/task.md << 'EOF'
Review @src/auth/ and identify:
1. Authentication vulnerabilities
2. Missing input validation
3. Improper error handling
EOF

# Spawn Gemini with scoped permissions
result=$(gemini "Read .gemini/sessions/task.md" \
  --output-format json \
  --approval-mode default)

# Capture session info
session_id=$(echo "$result" | jq -r '.session_id')
rm .gemini/sessions/task.md

Resuming a Session

Continue a specific session when you have the session_id:

echo "Implement fixes for the top 3 issues you found" > .gemini/sessions/continue.md

result=$(gemini "Read .gemini/sessions/continue.md" \
  --resume "$session_id" \
  --output-format json \
  --approval-mode auto_edit)

rm .gemini/sessions/continue.md

Resume Options:

FlagDescription
--resume <id>Resume specific session by ID or UUID
--resume "latest"Resume most recent session
--resume 5Resume by index number
--list-sessionsList available sessions

Important: Always use explicit --resume with session ID when calling from another agent.

Permission Handling

By default, Gemini requests confirmation for actions that modify your system. When calling from another agent, use --approval-mode:

--approval-mode

Set the approval mode for tool execution:

ModeDescription
defaultPrompt for permission on sensitive actions
auto_editAutomatically approve file edits only
# Safe for file editing tasks
gemini "Fix lint errors" --approval-mode auto_edit

# For analysis tasks (no modifications)
gemini "Analyze codebase" --approval-mode default

--sandbox

Run in a sandboxed environment for safer execution:

# Sandbox for untrusted code
gemini "Run untrusted code" --sandbox
gemini "Analyze suspicious file" --sandbox --output-format json

--full-auto

Shortcut for automation: sets --approval-mode auto_edit and --sandbox workspace-write.

gemini "Fix lint errors and run tests" --full-auto

Agent Delegation Patterns

Pattern 1: Analysis → Implementation

# Phase 1: Analysis (default approvals)
analyze_result=$(gemini "Explore @src/ to understand the codebase structure" \
  --output-format json --approval-mode default)

session_id=$(echo "$analyze_result" | jq -r '.session_id')

# Phase 2: Implementation (auto_edit for file changes)
impl_result=$(gemini "Implement a logging middleware" \
  --resume "$session_id" --output-format json \
  --approval-mode auto_edit)

Pattern 2: Escalating Permissions

# Start conservative
result=$(gemini "Fix the bug" --output-format json --approval-mode default)

# Check for errors
if echo "$result" | jq -e '.error' > /dev/null 2>&1; then
  session_id=$(echo "$result" | jq -r '.session_id')
  # Re-run with broader permissions
  result=$(gemini "Continue fixing with edit permissions" \
    --resume "$session_id" --output-format json \
    --approval-mode auto_edit)
fi

Pattern 3: Model Selection by Task

# Quick analysis - use flash
gemini "Summarize this file" --model flash --output-format json

# Complex reasoning - use pro
gemini "Design a distributed system architecture" --model pro --output-format json

# Balanced - use auto (default)
gemini "Implement feature X" --model auto --output-format json

Code Review Delegation

To delegate code review to Gemini:

mkdir -p .gemini/sessions
echo "Run 'jj diff -s -r @-' and 'jj diff -r @-' and review the output." > .gemini/sessions/review.md

result=$(gemini "Read .gemini/sessions/review.md" \
  --output-format json \
  --approval-mode default)

rm .gemini/sessions/review.md

Important: Do not use --approval-mode auto_edit during reviews - keep it read-only.

Additional Useful Flags

FlagDescription
--model, -mModel to use (auto/pro/flash/flash-lite)
--output-format, -oOutput format (text/json/stream-json)
--sandbox, -sRun in sandbox
--include-directoriesAdd directories to workspace
--extensions, -eEnable specific extensions
--allowed-mcp-server-namesAllow specific MCP servers
--debug, -dDebug mode with verbose logging

Model Selection

AliasDescription
autoDefault. Resolves to preview model if enabled, else pro
proComplex reasoning tasks
flashFast, balanced for most tasks
flash-liteFastest for simple tasks

Piping Input

Feed data into Gemini using Unix pipes:

# Pipe a file
cat error.log | gemini "Explain why this failed"

# Pipe command output
git diff | gemini "Write a commit message for these changes"

# Combined with file references
gemini "Review @package.json and explain the dependencies"

Best Practices for Agent Delegation

Prompting

  • Be Specific: Provide clear goals, file paths, and constraints.
  • Include Context: Use @path/to/file to reference files explicitly.
  • Headless Context: Gemini can't see your context - include everything in the prompt.

Permission Safety

  • Start Conservative: Use --approval-mode default initially.
  • Escalate as Needed: Check .error field and re-run with auto_edit.
  • Sandbox Untrusted Code: Always use --sandbox when running untrusted code.

Session Management

  • Always Extract session_id: Capture it from JSON output.
  • Check for Errors: Always inspect the .error field in JSON response.
  • Session per Task: Use separate sessions for unrelated tasks.

Model Selection

  • flash: Quick summaries, simple tasks
  • pro: Complex architecture, security reviews
  • auto: Let Gemini decide based on prompt

Example: Complete Agent Delegation Workflow

#!/bin/bash

# 1. Create temp directory
mkdir -p tmp/.gemini && echo "*" > tmp/.gitignore

# 2. Write task with full context
cat > tmp/task.md << 'EOF'
Analyze the codebase and provide:
1. Architecture overview
2. Potential security issues
3. Performance bottlenecks

Focus on @src/ and @config/ directories.
EOF

# 3. Spawn Gemini with initial permissions (read-only)
result=$(gemini "Read tmp/task.md" \
  --output-format json \
  --approval-mode default)

# 4. Check for errors
if echo "$result" | jq -e '.error' > /dev/null 2>&1; then
  echo "Error: $(echo "$result" | jq -r '.error.message')"
  exit 1
fi

# 5. Extract results
response=$(echo "$result" | jq -r '.response')
session_id=$(echo "$result" | jq -r '.session_id')
stats=$(echo "$result" | jq -r '.stats')

# 6. Report findings to parent agent
echo "=== Analysis Complete ==="
echo "Session ID: $session_id"
echo "Token usage: $(echo "$stats" | jq -r '.total_tokens // "N/A"')"
echo ""
echo "$response"

# 7. Optional: Continue for implementation
# echo "Now implement the security fixes" > tmp/implement.md
# gemini "Read tmp/implement.md" --resume "$session_id" --approval-mode auto_edit ...

# 8. Clean up
rm -rf tmp

Exit Codes

CodeMeaning
0Success
1General error or API failure
42Input error (invalid prompt or arguments)
53Turn limit exceeded

Structured Output with Schema

Request JSON output matching a JSON Schema:

# Create schema file
cat > /tmp/schema.json << 'EOF'
{
  "type": "object",
  "properties": {
    "project_name": { "type": "string" },
    "programming_languages": { "type": "array", "items": { "type": "string" } }
  },
  "required": ["project_name", "programming_languages"]
}
EOF

# Run with schema
gemini "Extract project metadata from @package.json" \
  --output-schema /tmp/schema.json \
  -o /tmp/result.json \
  --output-format json

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.45%
按下载量换算49

Claude

32.98%
按下载量换算47

Cursor

17.92%
按下载量换算26

Gemini CLI

9.28%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

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

安装前确认

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

来源信息

继续浏览同类 Skills