smithery.ai

gemini

Interact with Google's Gemini model via CLI. Use when needing a second opinion from another LLM, cross-validation, or leveraging Gemini's Google Search grounding. Supports multi-turn conversations with session management.

First seen Mar 19, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents gemini

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,205 B
  • docs SUMMARY.md 235 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 16 installs

SKILL.md

Gemini CLI

Commands

New conversation (ask)

gemini --model auto "your prompt here" --output-format json 2>/dev/null

Response includes session_id for follow-up:

{
  "session_id": "uuid-here",
  "response": "...",
  "stats": {...}
}

Continue conversation (reply)

gemini --model auto --resume <session_id> -p "follow-up prompt" --output-format json 2>/dev/null

Context from previous turns is preserved.

Examples

# Ask Gemini for code review
result=$(gemini --model auto "Review this function for potential bugs: $(cat src/utils.ts)" --output-format json 2>/dev/null)
session_id=$(echo "$result" | jq -r '.session_id')
echo "$result" | jq -r '.response'

# Follow up on the same session (using session_id from above)
result=$(gemini --model auto --resume "$session_id" -p "How would you refactor it?" --output-format json 2>/dev/null)
session_id=$(echo "$result" | jq -r '.session_id')
echo "$result" | jq -r '.response'

# Leverage Google Search grounding
result=$(gemini --model auto "What are the latest changes in TypeScript 5.8?" --output-format json 2>/dev/null)
echo "$result" | jq -r '.response'

⚠️ CRITICAL: Session ID Handling

If you don't parse session_id, you CANNOT continue the conversation!

For every response, you MUST:

  1. Extract session_id from the JSON response
  2. Use --resume <session_id> for follow-up questions

❌ WRONG:

gemini "prompt" --output-format json 2>/dev/null | jq -r '.response'
# session_id lost → cannot continue conversation

✅ CORRECT:

result=$(gemini --model auto "prompt" --output-format json 2>/dev/null)
session_id=$(echo "$result" | jq -r '.session_id')
response=$(echo "$result" | jq -r '.response')
# session_id preserved for follow-up

Notes

  • Gemini automatically uses googlewebsearch when needed
  • Image analysis: include file path in prompt, Gemini reads via read_file