google-gemini / google-gemini/gemini-cli
Improve Agent "Self-Awareness": Accurate CLI Flags, Hotkeys, and Self-Execution
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What would you like to be added?
## Objective
Ensure the Gemini CLI understands its own mechanics well enough to act as its own expert guide. The agent must be able to provide users with accurate facts about how it works, its hotkeys, and the exact CLI flags needed to run itself for specific workflows.
## The Problem
Users rely on the CLI to learn how to use the CLI. If the agent hallucinates flags (like suggesting the deprecated `--yolo` instead of `--approval-mode=yolo`) or forgets UI hotkeys (like `Double Esc` for `/rewind`), it blocks progress and creates friction. The agent needs strict grounding in its own documentation to accurately guide users.
### Why is this needed?
1. **Accurate Internal Facts:** The agent (specifically the `cli_help` subagent) must have flawless recall of its own UI keyboard shortcuts, slash commands, and settings hierarchy.
2. **Flag Construction:** It must be able to tell users exactly how to run it from the terminal for various use cases (e.g., suggesting `gemini -i "prompt" --sandbox --output-format json` for safe, headless scripting).
3. **Self-Execution & Guidance:** It should be able to write the exact commands needed to run itself, restart itself, or execute sub-tasks with the correct environment variables and flags.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.