Download the PHP package develate/antigravity-cli-php without Composer

On this page you can find all versions of the php package develate/antigravity-cli-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package antigravity-cli-php

antigravity-cli-php

A PHP SDK for driving the Antigravity CLI (agy) headlessly.

It speaks the CLI's documented print-mode interface and nothing else: no private endpoint, no undocumented protocol, and no shared-configuration workaround. What the CLI cannot be asked to do, this SDK reports as unsupported rather than approximating.

Requirements

Installation

Runs

A run is one turn. query() waits for the answer; stream() hands back a Run you can iterate as it happens.

Result carries the answer text, the turn's status, its usage, the tool calls it made, any actions the CLI's permission rules refused, and every event verbatim.

Cancelling

Run::cancel() stops the process at the next poll. The child is stopped when a run is cancelled, throws, or is simply abandoned mid-iteration.

Conversations

Antigravity allocates the conversation id; this SDK never invents one. It appears on the result and on the session once the CLI has answered.

Resuming needs that id explicitly:

agy --continue resumes whatever conversation the CLI touched last, which on a shared machine is not necessarily yours. The SDK does not offer it.

One process per turn, or one per conversation

session() starts a process per turn, which is what you want when turns are queued independently and cancelled on their own. persistentSession() keeps one process for the whole conversation, which is cheaper per turn:

Turns run one at a time either way. A second turn started while the first is in flight throws, because two answers on one pipe cannot be told apart.

Token accounting

The CLI's result event reports usage for the whole conversation, not the turn. A second turn that reported it as its own would charge the first turn twice.

Result::$usage is therefore built from the steps that completed during the turn, and Result::$cumulativeUsage carries the CLI's running total unchanged:

When neither the steps nor a trustworthy baseline can supply a figure, $usage is null. Unknown is reported as unknown.

Permissions

Antigravity's own permission rules apply, and they keep their native meaning.

A headless run cannot answer a permission prompt, so a sandboxed run denies what it cannot approve and says so on the result:

A turn can therefore succeed having quietly skipped work you asked for. Check hasDenials() when that matters.

ExecutionMode::Plan is Antigravity's own planning mode. It prefixes the conversation with a planning instruction; it is not a read-only enforcement boundary, and this SDK does not present it as one.

Capabilities

Some things the CLI's headless interface simply does not offer. They are named rather than emulated:

Unsupported: interactive approval, image input, forking, rewinding, and managed authentication.

Model-specific reasoning effort

Use the pure helper for a selected slug, including a custom model or one that has not been fetched. It does not instantiate a client or start a process:

Models returned by $agy->models() also expose $model->supportsReasoningEffort(). The helper means separately adjustable effort, not whether the model reasons.

agy models in CLI 1.1.27 returns only slug/label pairs, with no capability metadata. ModelCapabilities centralizes the fallback rules, verified on that version using agy --print=/usage --output-format=json --model=SLUG --effort=LEVEL (no model turn):

Matching is case-insensitive. Other Claude or “thinking” names are not excluded. Unknown/custom names return true to preserve pass-through behavior; this is not a guarantee that the CLI recognizes a model. Null and empty selections also return true: the SDK cannot resolve the account's default without a process, so an explicitly selected effort is still sent and the CLI validates it.

Command construction uses this same helper to omit --effort for unsupported models, including saved effort values on resumed sessions. The selected model, other options, and the immutable session options are preserved. Null effort always omits the flag, for every model.

Reports and commands

/usage is answered by the CLI itself, without asking a model:

When the output is not recognised, available is false and the raw text and stderr are kept. No percentage, reset time or account detail is ever invented.

The supported command families are wrapped too. Each one runs only when you call it; none is a side effect of a run:

mcp() and plugins() edit configuration shared by every Antigravity session on the machine.

MCP servers

Register local stdio servers with arguments and environment variables, or remote HTTP servers with request headers:

Adding an existing name updates its configuration. Mutation methods return CommandOutput and throw ProcessFailed when the CLI exits unsuccessfully. The existing add('name', ['command', 'argument']) API also accepts named env, headers, and type (stdio or http) arguments. Values are passed as individual process arguments, without shell interpolation.

These operations use the CLI's shared user configuration. Configure servers before starting sessions; the SDK does not inject temporary MCP settings into individual turns. Credentials supplied here are persisted by the CLI along with the server configuration. This API follows agy mcp add --help in CLI 1.1.27 and the official MCP command release notes.

Compatibility

A binary whose version cannot be read is unknown, not incompatible. Compatibility is decided by the interface being present.

Environment and identity

The environment belongs to the client, not to a single call, so a listing and a run cannot disagree about which configuration they are using. false removes an inherited variable:

Antigravity adopts the local configuration it finds. It has no identity-isolation variable to set, and signing in and out is done through the CLI itself.

Errors

Exception Meaning
AntigravityNotFound the binary is missing or not executable
ProcessFailed the process ended without answering the turn
ProcessTimedOut the deadline passed
ProcessCancelled the run was cancelled
RunFailed the turn itself ended unsuccessfully
InvalidOptions options the CLI cannot honour, rejected before starting
UnsupportedCapability asked for something the CLI does not offer
InvalidStreamJson malformed output, in strict parsing mode

An unsuccessful turn is reported on the result rather than thrown, because the CLI signals it in the result event and can still exit 0. Use Run::resultOrFail() when you would rather have an exception.

Antigravity writes a lot of diagnostic chatter to stderr on healthy runs, so stderr alone is never read as failure.

Testing

The suite runs against a stand-in binary that speaks the real flag and NDJSON protocol, so no network access or Antigravity account is needed.

License

MIT


All versions of antigravity-cli-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
symfony/process Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package develate/antigravity-cli-php contains the following files

Loading the files please wait ...