cli
Delegate coding tasks, code reviews, and research to a headless Antigravity agent with file, web, and shell access. Returns responses with conversation IDs for follow-ups.
Instructions
Send a task to Antigravity CLI (agy) and return the response. Antigravity runs headlessly with full tool access (file read/write, web search, shell commands) and operates in the working directory you specify via cwd.
When to use this tool:
Delegating rote coding tasks: boilerplate generation, repetitive refactors, bulk edits across many files
Getting a second opinion: code review, architecture feedback, sanity-checking an approach
Research and brainstorming: Antigravity has web search and a large context window, useful for exploring options or summarizing docs
Large file analysis: processing files that would be expensive to handle directly
Parallel workstreams: offloading independent subtasks while you continue other work
Sandbox: on by default. Antigravity's file tools can still edit the workspace, but shell commands can only write under /tmp. Set sandbox: false for tasks whose shell commands must write to the workspace (builds, installs, git commits, test runs that produce files).
Conversation resumption: each response includes a conversationId. Pass it back via the conversationId parameter (with the same cwd) to continue a conversation without re-sending context — useful for multi-step tasks or follow-up questions.
Keep prompts self-contained: include all necessary context in the prompt since Antigravity has no access to your conversation history or MCP state.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>",
"cwd": "<cwd>"
},
"name": "cli"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute path to the working directory (workspace) for Antigravity to operate in | |
| mode | No | Agent execution mode. "plan" drafts an implementation plan before acting; in headless mode the plan is auto-approved, so this shapes the workflow but does not prevent edits. | |
| agent | No | Name of a custom agent to run, defined at .agents/agents/<name>.md in the workspace or ~/.gemini/config/agents/. Omit for the default agent. | |
| model | No | Model to use. Omit to use Antigravity's default. Examples: "gemini-3.1-pro-high", "gemini-3.1-pro-low", "gemini-3.8-flash-medium", "claude-sonnet-4-6", "claude-opus-4-6-thinking". Run `agy models` for the full list. | |
| effort | No | Reasoning effort for the session. Omit to use Antigravity's default. | |
| prompt | Yes | The task or question to send to Antigravity CLI | |
| sandbox | No | Run shell commands in a sandbox where they can read anywhere but write only under /tmp. File edit tools are unaffected. Default: true. | |
| timeout | No | Timeout in seconds. Default: 120. Increase for complex multi-step tasks. On expiry the call returns an error with any partial response in the structured output. | |
| jsonSchema | No | JSON Schema to enforce on the final answer. The parsed object is returned in `structuredOutput`. | |
| conversationId | No | Resume a previous conversation by ID. The ID is returned in the structured output of each call. Conversations are scoped to a workspace, so pass the same `cwd` as the original call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| usage | Yes | Token usage for this turn | |
| status | Yes | Run status reported by agy (e.g. SUCCESS) | |
| numTurns | Yes | Number of agent turns in the conversation | |
| response | Yes | Antigravity's text response | |
| deniedActions | Yes | Tools agy was denied permission to use | |
| conversationId | Yes | Antigravity conversation ID | |
| durationSeconds | Yes | Wall-clock time of the run | |
| structuredOutput | Yes | Parsed answer when `jsonSchema` was given |