Skip to main content

Antigravity CLI

What​

Display Antigravity CLI session information including the current AI model, token usage, and workspace details. Shows a visual gauge of context window usage and formatted token information for monitoring your Antigravity session.

This segment integrates with Antigravity CLI's statusline functionality to provide real-time session data in your prompt.

For setup instructions, see Change your prompt.

Working directory

oh-my-posh antigravity renders directory-aware segments — path, git, project and the language segments — and the .PWD, .Folder and .AbsolutePWD template values against the directory the payload reports in workspace.current_dir, falling back to cwd. When the payload reports neither, or reports a path that is not an existing absolute directory, the renderer's own working directory is used, as before.

The renderer's working directory itself is not changed, so external commands — including version manager shims — and the cmd, readFile and glob template functions still resolve relative to the directory Antigravity CLI started the renderer in, not to workspace.current_dir.

Sample Configuration​

− ▢ ×  Gemini 3 Pro  _ ohmyposh.dev − ▢ ×  Gemini 3 Pro  _ ohmyposh.dev

Template (info)​

default template
\uf135 {{ .Model.DisplayName }} \uf2d0 {{ .TokenGauge }}

Options​

NameTypeDefaultDescription
gauge_marked_charstring▰Character used for filled blocks in gauge visualizations
gauge_unmarked_charstring▱Character used for empty blocks in gauge visualizations

Properties​

NameTypeDescription
.CWDstringDirectory Antigravity CLI was launched from
.SessionIDstringUnique identifier for the Antigravity session
.ConversationIDstringIdentifier for the current conversation; empty when absent
.TranscriptPathstringPath to the conversation transcript file
.ModelModelAI model information
.WorkspaceWorkspaceWorkspace directory information
.VersionstringAntigravity CLI version
.ProductstringProduct name reported by the payload; empty when absent
.ContextWindowContextWindowToken usage information
.Exceeds200KTokensboolWhether the most recent API response exceeded 200K total tokens
.Quotamap[string]QuotaPer-model quota information, keyed by model id
.VCSVCSVersion control status for the workspace; nil when absent
.SandboxSandboxSandbox execution state; nil when absent
.VimVimVim mode information; nil when absent
.AgentStatestringCurrent agent state; empty when absent
.ArtifactCountintNumber of artifacts produced in the session
.PlanTierstringSubscription plan tier; empty when absent
.EmailstringAuthenticated user email; empty when absent
.PendingInputCountintNumber of pending input requests
.ToolConfirmationPendingboolWhether a tool call is waiting on user confirmation
.TaskCountintNumber of tasks tracked in the session
.TerminalWidthintReported terminal width in columns
.ExecutionModestringCurrent execution mode; empty when absent
.TokenUsagePercentPercentagePercentage of context window used (0-100)
.TokenGaugestringGauge showing remaining context capacity using configured characters (e.g., ▰▰▰▱▱)
.TokenGaugeUsedstringGauge showing used context capacity using configured characters (e.g., ▰▰▱▱▱)
.RemainingPercentPercentagePercentage of context window remaining (0-100)
.FormattedTokensstringHuman-readable token count (e.g., "1.2K", "15.3M")
nil pointer fields

.VCS, .Sandbox, and .Vim are all nil when the underlying data is absent. Guard direct field access with {{if .VCS}}{{.VCS.Branch}}{{end}} to avoid template errors.

Model Properties​

NameTypeDescription
.IDstringTechnical model identifier
.DisplayNamestringHuman-readable model name (e.g., "Gemini 3 Pro")

Workspace Properties​

NameTypeDescription
.CurrentDirstringCurrent working directory
.ProjectDirstringProject root directory; may differ from .CurrentDir

ContextWindow Properties​

NameTypeDescription
.TotalInputTokensintTotal input tokens used in the session
.TotalOutputTokensintTotal output tokens generated in the session
.ContextWindowSizeintMaximum context window size for the model
.CurrentUsageCurrentUsageCurrent message token usage; nil when absent
.UsedPercentage*float64Pre-calculated usage percentage; nil when unknown
.RemainingPercentage*float64Pre-calculated remaining percentage; nil when unknown

CurrentUsage Properties​

NameTypeDescription
.InputTokensintInput tokens for the current message
.OutputTokensintOutput tokens for the current message
.CacheCreationInputTokensintTokens used to create a new cache entry
.CacheReadInputTokensintTokens read from an existing cache entry

Quota Properties​

Keyed by a model or quota bucket id, e.g. {{ (index .Quota "gemini-weekly").RemainingFraction }}.

NameTypeDescription
.RemainingFraction*float64Fraction of quota remaining (0-1); nil when unknown
.ResetTimestringISO 8601 timestamp the quota resets at
.ResetInSeconds*intSeconds until the quota resets; nil when unknown

VCS Properties​

NameTypeDescription
.TypestringVersion control system in use, e.g. git
.BranchstringCurrent branch name; empty when absent
.DirtyboolWhether the working tree has uncommitted changes

Sandbox Properties​

NameTypeDescription
.EnabledboolWhether sandboxed execution is active
.AllowNetwork*boolWhether the sandbox allows network access; nil when unset

Vim Properties​

NameTypeDescription
.ModestringCurrent vim mode; empty when vim mode is disabled

Percentage Methods​

The Percentage type (returned by .TokenUsagePercent, .RemainingPercent) provides additional methods for direct use in templates:

MethodReturnsDescription
.GaugestringVisual gauge showing remaining capacity using hardcoded ▰/▱ characters
.GaugeUsedstringVisual gauge showing used capacity using hardcoded ▰/▱ characters
.StringstringNumeric percentage value (e.g., "75" for use in templates)
Custom gauge characters

Use .TokenGauge and .TokenGaugeUsed instead of the raw .Percentage methods above — they respect the gauge_marked_char and gauge_unmarked_char options.

How it works​

The oh-my-posh antigravity command reads Antigravity CLI's session JSON from stdin, caches the parsed data, then renders your configured prompt. Antigravity CLI sends a fresh JSON payload on every statusline refresh.

The segment is only visible when Antigravity CLI is actively providing session data.