File size: 1,277 Bytes
9332ccf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

import process from 'node:process';

const ANTIGRAVITY_SH_INSTALL =
  'curl -fsSL https://antigravity.google/cli/install.sh | bash';

export interface AntigravityInstallInfo {
  platformName: string;
  installCmd: string;
}

/**
 * Gets the platform-specific installation details for the Antigravity CLI.
 * Returns null if the current platform is unsupported.
 */
export function getAntigravityInstallInfo(): AntigravityInstallInfo | null {
  if (process.platform === 'win32') {
    if (process.env['PSModulePath']) {
      return {
        platformName: 'Windows (PowerShell)',
        installCmd: 'irm https://antigravity.google/cli/install.ps1 | iex',
      };
    } else {
      return {
        platformName: 'Windows (Command Prompt)',
        installCmd:
          'curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd',
      };
    }
  } else if (process.platform === 'darwin') {
    return {
      platformName: 'macOS',
      installCmd: ANTIGRAVITY_SH_INSTALL,
    };
  } else if (process.platform === 'linux') {
    return {
      platformName: 'Linux',
      installCmd: ANTIGRAVITY_SH_INSTALL,
    };
  }
  return null;
}