2025-05-15 20:04:33 -07:00
# Gemini CLI
2025-06-13 09:53:30 -07: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-10-01 16:24:29 -07:00
## Basic features
- **[Commands ](./commands.md ):** A reference for all built-in slash commands (e.g., `/help` , `/chat` , `/tools` ).
- **[Custom Commands ](./custom-commands.md ):** Create your own commands and shortcuts for frequently used prompts.
- **[Headless Mode ](./headless.md ):** Use Gemini CLI programmatically for scripting and automation.
- **[Themes ](./themes.md ):** Customizing the CLI's appearance with different themes.
- **[Keyboard Shortcuts ](./keyboard-shortcuts.md ):** A reference for all keyboard shortcuts to improve your workflow.
- **[Tutorials ](./tutorials.md ):** Step-by-step guides for common tasks.
## Advanced features
- **[Checkpointing ](./checkpointing.md ):** Automatically save and restore snapshots of your session and files.
- **[Enterprise Configuration ](./enterprise.md ):** Deploying and manage Gemini CLI in an enterprise environment.
- **[Sandboxing ](./sandbox.md ):** Isolate tool execution in a secure, containerized environment.
- **[Telemetry ](./telemetry.md ):** Configure observability to monitor usage and performance.
- **[Token Caching ](./token-caching.md ):** Optimize API costs by caching tokens.
- **[Trusted Folders ](./trusted-folders.md ):** A security feature to control which projects can use the full capabilities of the CLI.
- **[Ignoring Files (.geminiignore) ](./gemini-ignore.md ):** Exclude specific files and directories from being accessed by tools.
- **[Context Files (GEMINI.md) ](./gemini-md.md ):** Provide persistent, hierarchical context to the model.
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-06-13 09:53:30 -07: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-01 16:24:29 -07:00
For comprehensive documentation on headless usage, scripting, automation, and advanced examples, see the * * [Headless Mode ](./headless.md )** guide.