CLI commands
Commands to start, stop, check, and update the AntGain 1.1.4 CLI.
Use antgain --help and antgain COMMAND --help to check the installed executable's options. antgain --version identifies the installed executable; a running node uses that version only after restart.
Commands
| Command | Purpose |
|---|---|
antgain run | Start in the foreground. start is an alias. |
antgain run --daemon | Start a detached background process. -d is the short option. |
antgain stop | Stop the running node and preserve saved credentials and identity. |
antgain restart | Restart the node. |
antgain health | Read local connection health; exit 0 when healthy, 1 when unhealthy. |
antgain info | Show node information. |
antgain configure | Save the API key supplied in ANTGAIN_API_KEY without starting the node; keep the existing device identity. |
antgain status | Fetch account status and earnings. |
antgain status --format json | Output status in JSON rather than text. |
antgain logs -n 200 | Show the last 200 log lines. |
antgain logs -f | Follow logs. |
antgain logs --file /path/to/antgain.log | Read an explicit log file. |
antgain check | Run diagnostic checks; doctor is an alias. |
antgain logout | Stop the node and clear saved credentials. |
antgain update | Check for an update and install it if available. Restart the running node afterward. |
antgain uninstall | Uninstall the CLI and background service, with prompts. |
antgain uninstall --purge | Also remove local configuration, credentials, and state. |
antgain uninstall --yes | Accept uninstall prompts non-interactively. Review before using. |
Use health to check the connection and status to view account information. A connected node does not guarantee traffic or earnings.
Authentication and configuration
| Setting | Use |
|---|---|
ANTGAIN_API_KEY | Account API key. Required in Docker; a normal CLI can also use a saved key. |
--api-key | Command-line API key override. Prefer an environment variable to exposing a literal key in arguments. |
ANTGAIN_DATA_DIR | Override the default ~/.antgain data directory. Keep it consistent across commands. |
ANTGAIN_DEVICE_ID | Optional explicit UUID. Keep stable across restarts and distinct for simultaneously running nodes. |
ANTGAIN_API_URL | Leave unset to use the standard AntGain service. Change only when instructed by support. |
There is no standalone login command. See CLI installation for API key entry. Logout clears the saved key, not your shell's environment variable. Docker gets its key from the container environment; change that environment and recreate the container to change credentials.
Logs and data
The default log file is ~/.antgain/logs/antgain.log; a service installation can use its configured data directory or journal.
Review logs before sharing them. Logs can contain personal information, device information, and login details. Use only a short redacted excerpt when requesting help.
--purge deletes credentials and identity. It is an intentional cleanup action, not a routine connection fix or upgrade step.
