CLI installation
Install AntGain with the CLI installer and your account API key.
The CLI command is antgain. On Linux or macOS, the installer selects the correct build for your computer and verifies the download. For Windows, follow the Windows installation guide.
Get your API key
Sign in to AntGain and open Account Settings. Copy your API Key, or click Generate API Key if you do not have one yet. Keep this key private.
Install and start
Replace PASTE_YOUR_API_KEY_HERE and run:
curl -fsSL https://install.antgain.app/install-cli.sh | ANTGAIN_API_KEY='PASTE_YOUR_API_KEY_HERE' bashThe installer downloads the latest release and starts the node. With administrator access, it installs a background service. Without administrator access, it installs under ~/.local/bin and uses a user service or background process. Open a new terminal if antgain is not yet on your PATH.
A device ID is generated automatically. Updating or reinstalling preserves the saved identity. Open your dashboard to see your device and its connection status.
For service management, updates, and uninstall instructions, follow the guide for your system:
Optional: run manually
To install the CLI without creating a background service:
curl -fsSL https://install.antgain.app/install-cli.sh | ANTGAIN_SKIP_START=1 bashThen enter your API key and start a foreground node:
export ANTGAIN_API_KEY='PASTE_YOUR_API_KEY_HERE'
antgain runPress Ctrl+C to stop it. To run in the background, use antgain run --daemon instead. Do not start a second node alongside an installed service using the same identity.
For a manually started node:
antgain health
antgain info
antgain status
antgain logs -n 100The CLI saves credentials for later launches. There is no separate antgain login command. Clear the environment variable with unset ANTGAIN_API_KEY when you no longer need it in your shell.
Stop, logout, and update
Use antgain stop to stop a manually started node while preserving credentials. Use antgain logout to stop it and clear saved credentials; also unset any exported API key if you want to sign out completely.
Use antgain update to update a user installation. For a system service, follow your platform guide so the command uses the correct data directory and permissions. Restart a running node after a manual update to load the new executable.
Local data
User installations store credentials and identity under ~/.antgain; system services use /var/lib/antgain. Preserve the data directory across updates. Keep configuration files private; see local configuration.
Use separate data directories for distinct nodes. Do not run the desktop client and CLI simultaneously with the same identity. Leave ANTGAIN_API_URL unset to use the standard AntGain service.
