gemini-cli
Reference for Gemini CLI usage patterns. Consult before calling gemini via Bash.
Security Assessment
About gemini-cli
The Gemini CLI is a command-line interface designed to facilitate the interaction with the Gemini AI model from a terminal environment. This tool enables users to send prompts and retrieve results directly within Bash scripts or terminal sessions, providing a seamless and efficient way to integrate Gemini AI into automated workflows. It helps users avoid the complexity of dealing with web interfaces by offering an easy, terminal-based alternative for AI model interaction. The Gemini CLI simplifies tasks that would otherwise require manual intervention or GUI-based tools, especially for users looking to integrate the Gemini model into system-level operations.
Key features of the Gemini CLI include the ability to choose specific models via the `-m` flag, control the output format with `-o` (either human-readable or structured JSON output), and manage sessions with the `--list-sessions` and `-r` flags for resuming past tasks. The CLI also provides flexibility for customizing the available tools and handling rate limits for different tiers of service. With the ability to configure a timeout for operations, it supports both simple and complex tasks, ensuring that users have full control over execution and output.
This skill is ideal for developers and system administrators who require quick and efficient access to Gemini AI for integration into their existing Bash-based workflows. It is also suitable for data scientists or automation engineers who need to automate AI-based tasks in a repeatable, scriptable manner. Those working with large-scale systems or complex automation processes will benefit from the ease of use and flexibility the Gemini CLI offers.
FAQ
How do I use Gemini CLI to interact with the Gemini AI model?
You can interact with the Gemini AI model by using the command `gemini '[prompt]' -m gemini-3-flash-preview -o text 2>&1`. This sends a prompt to the Gemini model and outputs the result in human-readable text.
What flags are available in Gemini CLI for customizing the output?
Gemini CLI provides several flags to customize the output, such as `-m gemini-3-flash-preview` to select the model, `-o text` for human-readable output, and `-o json` for structured output with stats.
Can I resume a previous session using Gemini CLI?
Yes, you can resume a previous session using the `-r [index]` flag, where the index corresponds to the session you wish to continue. To list available sessions, use the `--list-sessions` flag.
Are there any special requirements when using Gemini CLI in Bash?
Yes, to avoid errors related to file access, you should set `dangerouslyDisableSandbox: true` in your Bash calls. Additionally, it’s important to append `2>&1` to capture all output and set a timeout of at least 300000ms for more complex tasks.
What are the rate limits for using Gemini CLI?
The free tier of Gemini CLI has a rate limit of 60 requests per minute and 1000 requests per day. The CLI automatically retries with backoff if the rate limit is exceeded.
Install gemini-cli
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
