gemini-cli-runner
Skill20 starsChanged 22 days agoMITView on GitHub
Run the local `gemini` CLI in one-shot mode for arbitrary prompts; supports model selection, file-based prompt input, and writing output to a target file with safe fallback if the model alias differs.
- Reads credentials
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- citation-triangulationSkill
- claim-groundingSkill
- claude-cli-runnerSkill
- codex-cli-runnerSkill
- deep-literature-reviewSkill
- derivation-verifySkill
- dsh-cli-runnerSkill
- figure-hygieneSkill
- hep-calcSkill
- hep-mcp-usageSkill
- idea-allocationSkill
- idea-generationSkill
- idea-pairwise-matchSkill
- idea-posteriorSkill
- julia-packageSkill
- julia-perfSkill
- kimi-cli-runnerSkill
- literature-graph-builderSkill
- literature-to-packageSkill
- markdown-hygieneSkill
- numerical-reliability-gateSkill
- opencode-cli-runnerSkill
- paper-reviserSkill
- pdg-lookupSkill
- physics-diagramsSkill
- referee-reviewSkill
- research-harnessSkill
- research-integritySkill
- research-teamSkill
- research-writerSkill
- review-swarmSkill
- zotero-importSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when you need to call Gemini from the command line (any task), independent of the downstream workflow (review, drafting, …
- Very specific: line 51
If the given --model is not recognized by your local CLI, the script retries with the default model (by omitting -m).
- Very specific: line 54
If --system-prompt-file is provided, its contents are prepended to stdin before the prompt file (separated by a blank line).
- Very specific: line 55
If no proxy env is already exported, the runner will try to bootstrap http_proxy / https_proxy / all_proxy from an interactive zsh session …
- Very specific: line 59
If --gemini-cli-home is set, the runner treats it as an isolated Gemini home root.
- Very specific: line 60
Use --dry-run to print the planned command + prompt file size/hash without calling gemini.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Gemini CLI Runner
Use this skill when you need to call Gemini from the command line (any task), independent of the downstream workflow (review, drafting, etc.).
If you are already running as Gemini, don't use this runner to re-invoke yourself. Run the call in-host — inline in your own loop (the Gemini CLI may expose no native sub-agent primitive). The
geminiCLI hop adds latency, a separate session, and context loss for zero gain. This runner is for reaching Gemini from a DIFFERENT host (Claude / Codex / OpenCode / …) for cross-model work. Pick the model / reasoning depth by task difficulty (quality first, not token thrift).
Session continuation is deliberately NOT wired into this runner (unlike the codex / claude / kimi runners, which expose explicit-session resume). The upstream
geminiCLI only offers-r latest/-r <index>— resolution by recency or list position, which is RACY across parallel runs (no explicit session-id form) — and this runner's direct-API fallback path cannot resume a CLI session at all. For multi-turn cross-model workflows, use a runner with explicit-session support.
Preconditions
geminiis installed:command -v gemini- You are authenticated/configured for Gemini CLI.
Recommended: runner script (file input + model fallback)
SKILL_DIR="${SKILL_DIR:-$(for r in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}" "$HOME/.config/opencode" "$HOME/.kimi-code"; do [ -d "$r/skills/gemini-cli-runner" ] && echo "$r/skills/gemini-cli-runner" && break; done || true)}"
bash "${SKILL_DIR}/scripts/run_gemini.sh" \
--model gemini-3.1-pro-preview \
--system-prompt-file /path/to/system.txt \
--prompt-file /path/to/prompt.txt \
--out /path/to/output.txtDry-run (no gemini call):
SKILL_DIR="${SKILL_DIR:-$(for r in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}" "$HOME/.config/opencode" "$HOME/.kimi-code"; do [ -d "$r/skills/gemini-cli-runner" ] && echo "$r/skills/gemini-cli-runner" && break; done || true)}"
bash "${SKILL_DIR}/scripts/run_gemini.sh" \
--model gemini-3.1-pro-preview \
--system-prompt-file /path/to/system.txt \
--prompt-file /path/to/prompt.txt \
--out /path/to/output.txt \
--dry-runNotes:
- If the given
--modelis not recognized by your local CLI, the script retries with the default model (by omitting-m). - Deterministic failures (usage/auth/region-ineligibility errors and similar, detected from the exit code and stderr) exit immediately with the diagnostic instead of trying the model-alias / proxy fallbacks, which would fail identically.
- Prompts are fed via stdin to avoid
Argument list too longwith large prompt files. - If
--system-prompt-fileis provided, its contents are prepended to stdin before the prompt file (separated by a blank line). - If no proxy env is already exported, the runner will try to bootstrap
http_proxy/https_proxy/all_proxyfrom an interactivezshsession by invoking a user-definedproxy_onhelper when available. - Tool access is explicit:
- Default is
--tool-mode none --tool-mode reviewmaps to Gemini CLI--approval-mode planplus--sandbox,--no-proxy-first, and--extensions none
- Default is
- If
--gemini-cli-homeis set, the runner treats it as an isolated Gemini home root. When auth env vars are not already exported, it bootstraps the minimum Gemini auth env from$HOME/.gemini/.envso isolated review runs do not silently lose API connectivity. - Use
--dry-runto print the planned command + prompt file size/hash without callinggemini. --no-proxy-firststill exists as an escape hatch, but read-only review/file access should normally use--tool-mode review.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

