Antigravity CLI

repository·main·Indexed 23 days ago

https://github.com/google-antigravity/antigravity-cli

A terminal-based AI coding agent designed for high-speed, keyboard-driven workflows and remote SSH environments. It understands codebases, performs multi-file edits, executes commands, and integrates with the Antigravity 2.0 GUI via shared settings and session export.

Tokens
901
Snippets
2
Records
6
Agent score
32%

What's inside antigravity-cli

  1. Integrate Antigravity CLI with Antigravity 2.0

    main

    The CLI is part of a unified ecosystem with the Antigravity 2.0 GUI. They share the same core agent engine, meaning improvements to the engine apply to both interfaces.

    Key integration features include:

    • Shared Settings: Preferences and permissions sync bidirectionally between the CLI and the GUI.
    • Session Export: You can export a terminal session from the CLI to the Antigravity 2.0 GUI to continue your work in a visual environment.
  2. Authenticate with Antigravity CLI

    main

    The CLI uses your system keyring for authentication and falls back to Google Sign-In if no session is active.

    • Local sessions: The CLI will automatically open your default web browser to complete the login.
    • Remote / SSH sessions: The CLI detects the SSH environment and prints an authorization URL. You must copy this URL and complete the login on a local machine.
    • Sign Out: To clear saved credentials and end your session, run the /logout command within the CLI.
  3. Create a custom dynamic statusline for Antigravity CLI

    main

    You can create a custom, dynamic statusline by providing a script (e.g., statusline.sh) that reads a JSON payload from standard input. This payload contains the current state of the Antigravity CLI.

    To build a statusline, your script should:

    1. Parse the JSON input using a tool like jq to extract fields such as agent_state, vcs (version control system) info, context usage, and terminal dimensions.
    2. Compute visual indicators (for example, a Unicode progress bar to represent context window usage).
    3. Format the output using standard ANSI 16-color codes for visual distinction.
    4. Implement dynamic layout logic to adjust between 1 or 2 lines based on the terminal width provided in the payload.
  4. Install the Antigravity CLI

    main

    Install the Antigravity CLI using the command appropriate for your operating system. The CLI is designed for speed and keyboard efficiency, making it suitable for local development and remote SSH sessions.

    ### macOS / Linux
    ```bash
    curl -fsSL https://antigravity.google/cli/install.sh | bash

    Windows PowerShell

    irm https://antigravity.google/cli/install.ps1 | iex

    Windows CMD

    curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd
  5. Customize the Antigravity CLI window title

    main

    You can dynamically customize the Antigravity CLI window title by providing a script (e.g., title.sh) that reads a JSON payload from standard input. The script should parse the agent's state and workspace context to output a formatted string.

    Input Format

    The script receives a JSON payload via stdin containing:

    • agent_state: The current state of the agent (e.g., thinking, tool use, idle).
    • workspace.current_dir: The current working directory of the workspace.

    Output Format

    The script must output a formatted string in the following pattern: [Emoji] [State] | [Workspace]

    Implementation Logic Example

    1. Use jq to extract agent_state and workspace.current_dir from the input.
    2. Map the agent_state to an emoji:
      • Thinking: 🤔
      • Tool Use: 🛠️
      • Idle: 😴
    3. Parse the current directory to derive a short workspace name (including special handling for CitC workspaces).
    4. Print the final string to stdout.