README
¶
ask-gemini
A small CLI that asks Google Gemini for a second opinion, with conversation history across calls and support for attaching photos, videos, and audio. Ships with a Claude Code skill that wraps it.
Setup
From a local clone (installs the binary and the Claude skill):
make install
Or just the binary, from anywhere:
go install github.com/akostibas/ask-gemini-skill/cmd/ask-gemini@latest
The binary lands in $(go env GOBIN), falling back to $(go env GOPATH)/bin.
make install also copies skill/ to ~/.claude/skills/ask-gemini/; override
either with GOBIN=... or SKILL_DIR=.... If you used go install and want
the Claude skill too, symlink it:
ln -s "$(pwd)/skill/SKILL.md" ~/.claude/skills/ask-gemini/SKILL.md
Then configure credentials. ask-gemini reads the API key in this order:
GEMINI_API_KEY— the key directly.ASK_GEMINI_KEY_COMMAND— a shell command whose stdout is the key.
export GEMINI_API_KEY=AIza...
# or, via a secrets manager:
export ASK_GEMINI_KEY_COMMAND='op item get "Gemini API" --fields password --reveal'
export ASK_GEMINI_KEY_COMMAND='security find-generic-password -s gemini-api -w'
Don't inline the key into ASK_GEMINI_KEY_COMMAND (e.g. 'echo AIza...') —
command arguments are visible to other processes via ps. Use
GEMINI_API_KEY for that.
Usage
ask-gemini [flags] <prompt>
echo 'prompt' | ask-gemini [flags]
echo 'payload' | ask-gemini [flags] <prompt>
When both a positional prompt and stdin are given, stdin is appended to the prompt, separated by a blank line.
Flags:
--session <name>— name the conversation; persisted at$TMPDIR/ask-gemini-<name>.json. Reuse the name for follow-up turns.--reset— delete the named session and exit.--photo <path>— attach an image (repeatable).--video <path>— attach a video (repeatable). Waits for File API processing.--audio <path>— attach an audio file (repeatable).--model <id>— override the model (defaultgemini-3.5-flash).--system <prompt>— system prompt; only applied on the first turn.--history— print the current conversation and exit.--version— print the binary version and exit.
File API uploads are retained by Google for ~48 hours, so a single --session
can keep referencing attachments across turns without re-uploading.
Staying up to date
On a real consult, ask-gemini checks GitHub for a newer release — at most once
a day, cached to the system temp dir — and prints a one-line notice to stderr if
you're behind. All failures (offline, rate-limited) are silent. To upgrade, run
the skill's update.sh, which clones the latest tag into the system temp dir and
reinstalls the binary and skill in place:
~/.claude/skills/ask-gemini/update.sh # preview current → latest
~/.claude/skills/ask-gemini/update.sh --yes # apply
It needs git, curl, and the Go toolchain. You can also just re-run
make install from a fresh clone, or go install ...@latest for the binary
alone.
Privacy: the update check is an unauthenticated GitHub API call, which
reveals your IP to GitHub. Set ASK_GEMINI_NO_UPDATE_CHECK=1 to disable it.
Bugs and feature requests
Open an issue at https://github.com/akostibas/ask-gemini-skill/issues. Include the command you ran, what happened (stdout/stderr/exit code), what you expected, and a minimal repro.
License
MIT — see LICENSE.