Install
openclaw skills install openclaw-gemini-cliUse the local Gemini CLI for one-shot prompts, structured JSON output, shell-assisted research, and delegated AI-to-AI workflows on this Linux host. Use when you want to call the installed `gemini` command directly via `exec`, verify Gemini CLI availability/auth, run fast secondary model opinions, generate or refine code/content through Gemini, or orchestrate iterative local work where OpenClaw handles files/shell while Gemini provides another model's output.
openclaw skills install openclaw-gemini-cliUse the locally installed gemini command through exec.
Use this skill when you want Gemini CLI as a second brain on the same Linux machine. Typical uses:
This skill is for local CLI usage, not browser automation. If the user wants deep coding delegation over many steps, prefer ACP sessions or coding-agent.
Gemini CLI can influence what gets executed, but it does not get direct tool access by itself. Keep the control loop like this:
Do not blindly pipe Gemini-generated shell into execution. Review before running anything destructive or external.
If this is the first time using Gemini CLI on a machine, do not assume install alone is enough. The user should complete Gemini CLI authentication first, then run a smoke test.
Basic checks:
which gemini
gemini --help
gemini -p "hello"
Interpretation:
gemini --help works but gemini -p "hello" fails, auth is usually missing or expired.gemini -p "hello" returns a normal answer, the CLI is ready.Practical rule:
gemini -p "hello"Known note on this machine:
keytar is missing and fall back to FileKeychain.gemini -p "Summarize the tradeoffs between Astro and Next.js for a landing page site."
Use for quick answers, rewrites, summaries, naming, content ideas, or code snippets.
gemini -p "Generate 5 hero headline options for a SaaS analytics site." > /tmp/gemini-headlines.txt
Then read or parse that file with OpenClaw tools.
Ask Gemini to return only JSON.
gemini -p 'Return only valid JSON: {"pages":[{"path":"/","title":"...","sections":["..."]}]}'
Best practice:
Prefer bounded context, not giant dumps.
cat ./src/app/page.tsx | gemini -p "Review this file and suggest a cleaner component structure. Return concise bullet points only."
Better yet, use OpenClaw read first and then craft a focused prompt.
Recommended pattern:
This is the right way to get “AI同士が会話して自律的に作る” behavior without surrendering execution control.
gemini -p 'You are helping design a small website. Return only JSON with keys: stack, pages, components, copy_style, seo_keywords, risks. Product: local Instagram analytics service for Japanese small businesses. Goal: conversion-focused landing page.'
gemini -p 'Write Japanese landing page copy for a service that improves Instagram operations for stores. Tone: energetic, trustworthy, masculine, conversion-focused. Return sections for hero, pain points, benefits, CTA, FAQ.'
gemini -p 'Generate a single-file HTML landing page with embedded CSS for a Japanese marketing service. Make it mobile-first, bold, readable, and production-lean. Output code only.'
gemini -p 'Review this React component for readability and conversion-focused UX. Return only: issues, fixes, rewritten component.'
exec vs ACP/session delegationUse Gemini CLI via exec when:
Do not force Gemini CLI through exec when:
For those, prefer ACP sessions.
gemini -p "<prompt>"
If the installed Gemini CLI supports model selection flags in its current version, prefer explicit model selection when you need predictable behavior. Check supported options first:
gemini --help
Common practice:
Safe guidance for this skill:
gemini --help on the current machinegemini -p 'Return only valid JSON with keys ...' > /tmp/gemini.json
Use a temp file when the prompt gets long or must be reproducible.
cat /tmp/prompt.txt | gemini -p "$(cat)"
If shell quoting gets ugly, write a temp prompt file first with write and use shell substitution carefully.
If you need repeatable flows, use the bundled scripts in scripts/:
scripts/gemini_json.sh — ask Gemini for JSON-only outputscripts/gemini_review.sh — send a file to Gemini for review with a fixed prompt wrapperRead those scripts before modifying them.
gemini -p "hello"gemini --helpReturn only valid JSONOutput code onlyThat is possible only in a controlled loop. Use Gemini CLI to generate plans/code, but keep execution and editing in OpenClaw. For larger builds, combine this skill with ACP or coding-agent.