gemini-api-cli

Guide for using the Gemini API CLI tool. Use when you need to interact with the Gemini API via the command line, manage agents, or generate media (images,…

npx skills add https://github.com/google-gemini/gemini-api-cli --skill gemini-api-cli

Gemini API CLI Skill

This skill provides guidance on using the gemini-api command-line interface.

Overview

The gemini-api CLI allows you to:

  • Run prompts against various Gemini models.
  • Manage the full lifecycle of Gemini Agents.
  • Generate and edit media (images, audio, TTS).

References

For detailed usage and examples, see the following references:

Basic Usage

The primary command is gemini-api run.

gemini-api run "Hello, who are you?"

Always ensure your GEMINI_API_KEY environment variable is set.

Global Flags & Features

The CLI supports several flags that are useful for debugging and automation:

Dry Run (--dry-run)

Prints the equivalent curl command and exits without making an API call. Useful for verifying what request would be sent.

gemini-api run "Hello" --dry-run

Help (--help)

Displays usage information and available flags for any command.

gemini-api --help
gemini-api run --help

JSON Output (--json)

Outputs raw SSE events as JSONL (one event per line), useful for machine parsing.

gemini-api run "Hello" --json

Verbose (--verbose / -v)

Outputs complete JSON step objects line-by-line as they finish. Recommended for programmatic parsing by calling agents.

gemini-api run "Hello" --verbose

More skills from google-gemini

greeter
google-gemini
A friendly greeter skill
official
code-reviewer
google-gemini
Automated code review for local changes and remote pull requests with structured analysis across correctness, maintainability, and security. Supports both local file system changes (staged and unstaged) and remote PRs (by number or URL) with automatic GitHub CLI checkout Analyzes code across seven dimensions: correctness, maintainability, readability, efficiency, security, edge case handling, and test coverage Runs optional preflight verification suites (e.g., npm run preflight ) to catch...
official
review-duplication
google-gemini
Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing…
official
reconciliation
google-gemini
Reconcile loaded expenses against the pre-parsed invoice database, flagging discrepancies like amount mismatches, missing invoices, and merchant mismatches…
official
agent-tui
google-gemini
Main Agents: Do NOT use this skill directly. If you need to test the TUI, invoke the `tui_tester` subagent. Drive terminal UI (TUI) applications…
official
async-pr-review
google-gemini
Trigger this skill when the user wants to start an asynchronous PR review, run background checks on a PR, or check the status of a previously started async PR…
official
behavioral-evals
google-gemini
Guidance for creating, running, fixing, and promoting behavioral evaluations. Use when verifying agent decision logic, debugging failures, debugging prompt…
official
ci
google-gemini
A specialized skill for Gemini CLI that provides high-performance, fail-fast
official