2025-05-15 20:04:33 -07:00
|
|
|
|
# Gemini CLI
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Within Gemini CLI, `packages/cli` is the frontend for users to send and receive
|
|
|
|
|
|
prompts with the Gemini AI model and its associated tools. For a general
|
|
|
|
|
|
overview of Gemini CLI, see the [main documentation page](../index.md).
|
2025-06-13 09:53:30 -07:00
|
|
|
|
|
2025-10-01 16:24:29 -07:00
|
|
|
|
## Basic features
|
|
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **[Commands](./commands.md):** A reference for all built-in slash commands
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Custom commands](./custom-commands.md):** Create your own commands and
|
2025-10-09 08:17:37 -04:00
|
|
|
|
shortcuts for frequently used prompts.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Headless mode](./headless.md):** Use Gemini CLI programmatically for
|
2025-10-09 08:17:37 -04:00
|
|
|
|
scripting and automation.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Model selection](./model.md):** Configure the Gemini AI model used by the
|
2025-11-18 12:01:16 -05:00
|
|
|
|
CLI.
|
|
|
|
|
|
- **[Settings](./settings.md):** Configure various aspects of the CLI's behavior
|
|
|
|
|
|
and appearance.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **[Themes](./themes.md):** Customizing the CLI's appearance with different
|
|
|
|
|
|
themes.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Keyboard shortcuts](./keyboard-shortcuts.md):** A reference for all
|
2025-10-09 08:17:37 -04:00
|
|
|
|
keyboard shortcuts to improve your workflow.
|
2025-10-01 16:24:29 -07:00
|
|
|
|
- **[Tutorials](./tutorials.md):** Step-by-step guides for common tasks.
|
|
|
|
|
|
|
|
|
|
|
|
## Advanced features
|
|
|
|
|
|
|
2026-02-08 22:25:02 -05:00
|
|
|
|
- **[Plan mode (experimental)](./plan-mode.md):** Use a safe, read-only mode for
|
|
|
|
|
|
planning complex changes.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **[Checkpointing](./checkpointing.md):** Automatically save and restore
|
|
|
|
|
|
snapshots of your session and files.
|
2026-01-15 07:59:31 -08:00
|
|
|
|
- **[Enterprise configuration](./enterprise.md):** Deploy and manage Gemini CLI
|
|
|
|
|
|
in an enterprise environment.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **[Sandboxing](./sandbox.md):** Isolate tool execution in a secure,
|
|
|
|
|
|
containerized environment.
|
2026-01-27 19:42:41 -05:00
|
|
|
|
- **[Agent Skills](./skills.md):** Extend the CLI with specialized expertise and
|
|
|
|
|
|
procedural workflows.
|
2025-10-09 08:17:37 -04:00
|
|
|
|
- **[Telemetry](./telemetry.md):** Configure observability to monitor usage and
|
|
|
|
|
|
performance.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Token caching](./token-caching.md):** Optimize API costs by caching tokens.
|
|
|
|
|
|
- **[Trusted folders](./trusted-folders.md):** A security feature to control
|
2025-10-09 08:17:37 -04:00
|
|
|
|
which projects can use the full capabilities of the CLI.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Ignoring files (.geminiignore)](./gemini-ignore.md):** Exclude specific
|
2025-10-09 08:17:37 -04:00
|
|
|
|
files and directories from being accessed by tools.
|
2025-12-01 11:38:48 -08:00
|
|
|
|
- **[Context files (GEMINI.md)](./gemini-md.md):** Provide persistent,
|
2025-10-09 08:17:37 -04:00
|
|
|
|
hierarchical context to the model.
|
2025-12-19 22:11:37 +02:00
|
|
|
|
- **[System prompt override](./system-prompt.md):** Replace the built‑in system
|
|
|
|
|
|
instructions using `GEMINI_SYSTEM_MD`.
|
2025-05-15 20:04:33 -07:00
|
|
|
|
|
2025-06-13 09:53:30 -07:00
|
|
|
|
## Non-interactive mode
|
2025-06-07 10:47:30 -07:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
Gemini CLI can be run in a non-interactive mode, which is useful for scripting
|
|
|
|
|
|
and automation. In this mode, you pipe input to the CLI, it executes the
|
|
|
|
|
|
command, and then it exits.
|
2025-06-07 10:47:30 -07:00
|
|
|
|
|
2025-06-13 09:53:30 -07:00
|
|
|
|
The following example pipes a command to Gemini CLI from your terminal:
|
2025-06-07 10:47:30 -07:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
echo "What is fine tuning?" | gemini
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-09-17 04:01:15 +09:00
|
|
|
|
You can also use the `--prompt` or `-p` flag:
|
2025-06-07 10:47:30 -07:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
gemini -p "What is fine tuning?"
|
|
|
|
|
|
```
|
2025-09-11 05:19:47 +09:00
|
|
|
|
|
2025-10-09 08:17:37 -04:00
|
|
|
|
For comprehensive documentation on headless usage, scripting, automation, and
|
2025-12-01 11:38:48 -08:00
|
|
|
|
advanced examples, see the **[Headless mode](./headless.md)** guide.
|