using-gemini-clilisted
Install: claude install-skill shekohex/dotai
# Using Gemini CLI
Use `gemini` through PTY. Prefer headless mode for automation and one-off tasks. Use the interactive TUI only when the user explicitly wants it or when you need the `/model` picker.
## Defaults
- Non-interactive Gemini means `gemini -p "..."`.
- Always run Gemini in PTY so you can read the full output buffer and wait through retries.
- Keep the same `workdir` for `-p`, `--list-sessions`, and `--resume`. Sessions are project-scoped.
- Prefer `-o json` when the output will be parsed or resumed later.
- Prefer `-o text` when the user wants the plain answer only.
- If stdin is piped, Gemini prepends stdin content and then appends the `-p` prompt after it.
## Quick Start
One-off text response:
```bash
gemini -p "Summarize this repo in 3 bullets" -o text
```
One-off structured response:
```bash
gemini -p "Return JSON with keys name and purpose" -o json
```
Continue the latest project session:
```bash
gemini --resume latest -p "Now make it shorter" -o text
```
## Model Selection
Pass model choice with `-m` or `--model`.
Preferred forms:
```bash
gemini -m flash -p "..." -o text
gemini -m pro -p "..." -o text
gemini -m flash-lite -p "..." -o text
gemini -m gemini-2.5-flash -p "..." -o text
gemini -m gemini-3.1-pro-preview -p "..." -o text
```
Use aliases when the user speaks in tiers:
- User says `use flash` or `use Gemini flash` -> use `-m flash`
- User says `use pro` or `ask Gemini pro` -> use `-m pro`
- User says `use flash-lite` -> use `-m flash-