Back to Skills

gemini-json-parsing

verified

Parse Gemini CLI headless output (JSON and stream-JSON formats). Covers response extraction, stats interpretation, error handling, and tool call analysis. Use when processing Gemini CLI programmatic output.

View on GitHub

Marketplace

melodic-software

melodic-software/claude-code-plugins

Plugin

google-ecosystem

Repository
Verified Org

melodic-software/claude-code-plugins
13stars

plugins/google-ecosystem/skills/gemini-json-parsing/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/google-ecosystem/skills/gemini-json-parsing/SKILL.md -a claude-code --skill gemini-json-parsing

Installation paths:

Claude
.claude/skills/gemini-json-parsing/
Powered by add-skill CLI

Instructions

# Gemini JSON Parsing

## 🚨 MANDATORY: Invoke gemini-cli-docs First

> **STOP - Before providing ANY response about Gemini JSON output:**
>
> 1. **INVOKE** `gemini-cli-docs` skill
> 2. **QUERY** for the specific output format topic
> 3. **BASE** all responses EXCLUSIVELY on official documentation loaded

## Overview

Skill for parsing Gemini CLI's structured output formats. Essential for integration workflows where Claude needs to process Gemini's responses programmatically.

## When to Use This Skill

**Keywords:** parse gemini output, json output, stream json, gemini stats, token usage, jq parsing, gemini response

**Use this skill when:**

- Extracting responses from Gemini JSON output
- Analyzing token usage and costs
- Parsing tool call statistics
- Handling errors from Gemini CLI
- Building automation pipelines

## Output Formats

### Standard JSON (`--output-format json`)

Single JSON object returned after completion:

```json
{
  "response": "The main AI-generated content",
  "stats": {
    "models": {
      "gemini-2.5-pro": {
        "api": {
          "totalRequests": 2,
          "totalErrors": 0,
          "totalLatencyMs": 5053
        },
        "tokens": {
          "prompt": 24939,
          "candidates": 20,
          "total": 25113,
          "cached": 21263,
          "thoughts": 154,
          "tool": 0
        }
      }
    },
    "tools": {
      "totalCalls": 1,
      "totalSuccess": 1,
      "totalFail": 0,
      "totalDurationMs": 1881,
      "totalDecisions": {
        "accept": 0,
        "reject": 0,
        "modify": 0,
        "auto_accept": 1
      },
      "byName": {
        "google_web_search": {
          "count": 1,
          "success": 1,
          "fail": 0,
          "durationMs": 1881
        }
      }
    },
    "files": {
      "totalLinesAdded": 0,
      "totalLinesRemoved": 0
    }
  },
  "error": {
    "type": "ApiError",
    "message": "Error description",
    "code": 500
  }
}
```

### Stream JSON (`--output-format st

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
8575 chars