antigravitycli

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package antigravitycli implements the Antigravity model adapter. The CLI binary is `agy`. It is a full peer of the codex/claude adapters — reviewer, synthesizer, and input-budget setter.

Invocation

agy is driven non-interactively via:

agy --print=- --print-timeout <dur> --model <name>   (prompt via stdin)

agy's `--print` is a string flag that REQUIRES a value (it is not a boolean toggle); `-` is the conventional stdin marker. agy is multi-model (Gemini, Claude, GPT-OSS variants — see `agy models`); the adapter pins `--model` to DefaultModel so reviews are reproducible rather than depending on agy's user/config session default. Override via SetModel (wired to --antigravity-model / $DIFFSMITH_ANTIGRAVITY_MODEL). When stdin is a pipe, agy reads the prompt from it, so prompts up to the 1 MiB input budget travel via stdin per ADR 0007 rather than argv (past ARG_MAX). Output is raw model text with no envelope, so stdout pipes directly into model.ParseFindings — unlike Gemini's `-o json`, which wrapped output in {"response": …}. There is no --output-schema flag, so JSON reliability is prompt-engineered (the same risk profile as codex without a schema), handled by the defensive parser.

Auth (S8b resolved)

Spike S8b (2026-05-22) stubbed this adapter because agy v1.0.0 required interactive browser OAuth on every invocation. agy 1.0.9 fixed that ("Fixed OAuth token persistence and authentication hangs"), so tokens persist across calls and `agy --print` runs non-interactively once the user has logged in. Preflight only checks that `agy` is on PATH; a user who has never authenticated sees agy's own login prompt surfaced at Review time (the runner propagates stderr), matching codex/claude.

Index

Constants

View Source
const DefaultInputBudgetBytes = 1024 * 1024

DefaultInputBudgetBytes caps the prompt size sent to agy. Matches the codex/claude budget (1 MiB) so users get consistent behavior regardless of model choice. See codexcli for the underlying rationale.

View Source
const DefaultModel = "Gemini 3.1 Pro (High)"

DefaultModel is the agy model diffsmith pins by default. agy's own session default is user/config-dependent (often Gemini 3.5 Flash), which would make reviews non-deterministic across machines; pinning a model keeps them reproducible. Gemini 3.1 Pro (High) is a distinct family from codex (GPT) and claude (Claude) for cross-model diversity, with Pro-tier reasoning suited to correctness review. Override via --antigravity-model / $DIFFSMITH_ANTIGRAVITY_MODEL; see `agy models`.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements the model.Model interface against the Antigravity CLI (`agy`). agy 1.0.9 resolved the S8b auth blocker (persistent OAuth tokens), so this is a full peer: it reviews, synthesizes, and honors an input budget, matching the codex/claude adapters.

func New

func New(run provider.Runner) *Adapter

New constructs an Adapter. Passing nil uses provider.IsolatedRunner so agy can't onboard from the caller's cwd; lookPath defaults to exec.LookPath. Tests override fields directly (the package is internal-only).

func (*Adapter) Name

func (a *Adapter) Name() string

Name returns the model identifier surfaced to users via the picker and attached to validated findings. This is diffsmith's adapter name ("antigravity"), not the underlying agy model (see SetModel/DefaultModel).

func (*Adapter) Preflight

func (a *Adapter) Preflight(_ context.Context) error

Preflight verifies the agy binary is on PATH. Auth failures (a user who has never run an interactive `agy` login) surface at Review time via agy's own stderr, which the runner propagates — matching codex/claude.

func (*Adapter) Review

Review invokes agy against the standard review prompt.

func (*Adapter) SetInputBudget added in v0.3.0

func (a *Adapter) SetInputBudget(bytes int)

SetInputBudget overrides the default prompt-size cap. Values <= 0 are ignored so an unset --input-budget flag can't silently disable enforcement and let an arbitrarily large prompt slip through.

func (*Adapter) SetModel added in v0.3.1

func (a *Adapter) SetModel(name string)

SetModel overrides the agy model passed via --model. An empty name is ignored so an unset --antigravity-model flag can't blank out the pinned default and make agy reject the invocation (mirrors SetInputBudget).

func (*Adapter) Synthesize

func (a *Adapter) Synthesize(ctx context.Context, input *review.ReviewInput, results []*review.ModelReviewResult) (*review.ModelReviewResult, error)

Synthesize runs agy against the synthesis prompt that combines the diff with N other reviewers' findings. Output is parsed identically to Review.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL