Structured JSON Output (#8119)

This commit is contained in:
Jerop Kipruto
2025-09-11 05:19:47 +09:00
committed by GitHub
parent db99fc70b6
commit 514767c88b
20 changed files with 1526 additions and 23 deletions

View File

@@ -27,3 +27,19 @@ Gemini CLI executes the command and prints the output to your terminal. Note tha
```bash
gemini -p "What is fine tuning?"
```
For non-interactive usage with structured output, use the `--output-format json` flag for scripting and automation.
Get structured JSON output for scripting:
```bash
gemini -p "What is fine tuning?" --output-format json
# Output:
# {
# "response": "Fine tuning is...",
# "stats": {
# "models": { "gemini-2.5-flash": { "tokens": {"total": 45} } }
# },
# "error": null
# }
```