Skip to content

feat(installer): add Antigravity CLI target#1

Closed
BaguetteUhq1 wants to merge 2 commits into
Cleboost:mainfrom
BaguetteUhq1:add-antigravity-target
Closed

feat(installer): add Antigravity CLI target#1
BaguetteUhq1 wants to merge 2 commits into
Cleboost:mainfrom
BaguetteUhq1:add-antigravity-target

Conversation

@BaguetteUhq1
Copy link
Copy Markdown

Description

This PR adds support for the Antigravity CLI agent in the codegraph-installer crate. It allows users of Antigravity CLI to automatically integrate the codegraph MCP server into their global configuration by running codegraph install.

Changes made

  • Created crates/codegraph-installer/src/targets/antigravity.rs implementing AgentTarget.
  • Added the target to the installer registry in lib.rs and exposed it in mod.rs.
  • Configured the installer to detect and write to both potential Antigravity global configuration paths:
    • ~/.gemini/antigravity-cli/mcp_config.json
    • ~/.gemini/config/mcp_config.json (as well as XDG ~/.config/gemini/... equivalents for Linux natively).

Proof of Functionality

The binary was compiled locally (cargo build --release) and executed against an existing Antigravity environment.

Output after compilation:

PS C:\Users\baguetteuhq\Desktop\codegraph-rs> .\target\release\codegraph.exe install
[antigravity] detected: AlreadyConfigured
  wrote C:\Users\baguetteuhq\.gemini\antigravity-cli\mcp_config.json
  wrote C:\Users\baguetteuhq\.gemini\config\mcp_config.json

The installer correctly resolves the global path and injects the mcpServers object pointing to the absolute path of the codegraph binary and the current project's workspace.

@BaguetteUhq1 BaguetteUhq1 force-pushed the add-antigravity-target branch 2 times, most recently from c6ec7b8 to 9faee9f Compare May 22, 2026 20:40
Comment on lines +14 to +19
if let Ok(p) = Utf8PathBuf::from_path_buf(home.join(".gemini").join("antigravity-cli").join("mcp_config.json")) {
paths.push(p);
}
if let Ok(p) = Utf8PathBuf::from_path_buf(home.join(".gemini").join("config").join("mcp_config.json")) {
paths.push(p);
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated

}

#[cfg(not(windows))]
fn ensure_in_path(bin_dir: &Path) -> Result<()> {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Comment thread scripts/install.ps1 Outdated
Comment on lines +1 to +39
$ErrorActionPreference = "Stop"

$Repo = "cleboost/codegraph"
$BinName = "codegraph.exe"

Write-Host "Detecting latest release..."
$LatestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/latest"
$Tag = $LatestRelease.tag_name

if ([string]::IsNullOrEmpty($Tag)) {
Write-Error "Could not detect the latest tag."
exit 1
}

$Target = "x86_64-pc-windows-msvc"
$Url = "https://github.com/$Repo/releases/download/$Tag/codegraph-$Target.zip"
$TmpDir = Join-Path $env:TEMP "codegraph-install-$(New-Guid)"
New-Item -ItemType Directory -Path $TmpDir -Force | Out-Null

try {
Write-Host "Downloading $Url"
$ZipPath = Join-Path $TmpDir "codegraph.zip"
Invoke-WebRequest -Uri $Url -OutFile $ZipPath

Write-Host "Extracting..."
Expand-Archive -Path $ZipPath -DestinationPath $TmpDir -Force

$ExtractedBin = Join-Path $TmpDir $BinName
if (-not (Test-Path $ExtractedBin)) {
Write-Error "Could not find $BinName in the downloaded archive."
exit 1
}

Write-Host "Running self-installer..."
& $ExtractedBin install

} finally {
Remove-Item -Path $TmpDir -Recurse -Force -ErrorAction SilentlyContinue
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related with antigravity?

Comment thread scripts/install.sh Outdated
Comment on lines +6 to +33
@@ -29,11 +28,6 @@ trap 'rm -rf "$tmp"' EXIT
echo "Downloading $url"
curl -fsSL "$url" -o "$tmp/cg.tar.gz"
tar -xzf "$tmp/cg.tar.gz" -C "$tmp"
mkdir -p "$INSTALL_DIR"
install -m 0755 "$tmp/$BIN_NAME" "$INSTALL_DIR/$BIN_NAME"

echo "Installed $BIN_NAME $tag to $INSTALL_DIR"
case ":$PATH:" in
*":$INSTALL_DIR:"*) ;;
*) echo "Note: $INSTALL_DIR is not in PATH. Add it or move the binary." ;;
esac
echo "Running self-installer..."
"$tmp/$BIN_NAME" install
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment thread README.md Outdated
Comment on lines +38 to +44
For Windows (PowerShell):

```powershell
irm https://raw.githubusercontent.com/cleboost/codegraph/main/scripts/install.ps1 | iex
```

The scripts will download the latest binary and run the self-installer, which will copy it to `~/.local/bin` and add it to your system's `PATH`.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@BaguetteUhq1 BaguetteUhq1 force-pushed the add-antigravity-target branch from e64a7ca to d4d7b0d Compare May 22, 2026 22:22
@BaguetteUhq1
Copy link
Copy Markdown
Author

Désolé pour la confusion ! J'avais poussé de la logique d'installation sans rapport (auto-PATH et binaire auto-installable) sur cette branche par erreur. J'ai fait un force-push pour retirer ces changements. Cette PR est maintenant strictement dédiée à la cible Antigravity CLI.

@Cleboost
Copy link
Copy Markdown
Owner

pls make an another pr without force push

@BaguetteUhq1
Copy link
Copy Markdown
Author

Closing in favor of the clean PR #3 to avoid force-push history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants