Cli Structured Output + Gemini Collector
Enforce Cli Structured Output using data collected by Gemini Collector. Automatically check devex build and ci standards on every PR.
How Gemini Collector Powers This Guardrail
The Gemini Collector gathers metadata from your systems. This data flows into Lunar's Component JSON, where the Cli Structured Output guardrail evaluates it against your standards.
When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.
Quick Start Configuration
Add both the collector and policy to your lunar-config.yml to enable this guardrail.
# Step 1: Enable the Gemini Collector
collectors:
- uses: github://earthly/lunar-lib/collectors/gemini@v1.0.5
# with: ...
# Step 2: Enable the Gemini Guardrails
policies:
- uses: github://earthly/lunar-lib/policies/gemini@v1.0.5
include: [cli-structured-output]
# with: ...
What Gemini Collector Collects
This collector gathers the following data that the Cli Structured Output guardrail evaluates.
instruction-file
cicd
Detects Google Gemini CLI invocations in CI pipelines. Records the command string and version for policy-level flag analysis (dangerous flags like --yolo and -y).
Example Data Flow
Here's an example of the data that Gemini Collector writes to the Component JSON, which Cli Structured Output then evaluates.
{
"ai": {
"instructions": {
"all": [
{
"path": "GEMINI.md",
"dir": ".",
"filename": "GEMINI.md",
"lines": 60,
"bytes": 2400,
"is_symlink": false,
"symlink_target": null
}
]
},
"native": {
"gemini": {
"instruction_file": {
"exists": true,
"path": "GEMINI.md",
"lines": 60,
"bytes": 2400,
"is_symlink": false,
"symlink_target": null
},
"cicd": {
"cmds": [
{
"cmd": "gemini run --json 'review this PR'",
"tool": "gemini",
"version": "0.1.0"
}
]
}
}
}
}
}
Configuration Options
Gemini Guardrails Inputs
| Input | Required | Default | Description |
|---|---|---|---|
dangerous_flags |
Optional |
--yolo,-y
|
Comma-separated dangerous flags for Gemini CLI |
Ready to Automate Your Standards?
See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 200+ built-in guardrails.