antigravitycli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 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>      (prompt piped via stdin)

agy's `--print` is a string flag that REQUIRES a value (it is not a boolean toggle); `-` is the conventional stdin marker. 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.

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.

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) 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