AntGainDocs
Node (CLI)

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

CommandPurpose
antgain runStart in the foreground. start is an alias.
antgain run --daemonStart a detached background process. -d is the short option.
antgain stopStop the running node and preserve saved credentials and identity.
antgain restartRestart the node.
antgain healthRead local connection health; exit 0 when healthy, 1 when unhealthy.
antgain infoShow node information.
antgain configureSave the API key supplied in ANTGAIN_API_KEY without starting the node; keep the existing device identity.
antgain statusFetch account status and earnings.
antgain status --format jsonOutput status in JSON rather than text.
antgain logs -n 200Show the last 200 log lines.
antgain logs -fFollow logs.
antgain logs --file /path/to/antgain.logRead an explicit log file.
antgain checkRun diagnostic checks; doctor is an alias.
antgain logoutStop the node and clear saved credentials.
antgain updateCheck for an update and install it if available. Restart the running node afterward.
antgain uninstallUninstall the CLI and background service, with prompts.
antgain uninstall --purgeAlso remove local configuration, credentials, and state.
antgain uninstall --yesAccept 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

SettingUse
ANTGAIN_API_KEYAccount API key. Required in Docker; a normal CLI can also use a saved key.
--api-keyCommand-line API key override. Prefer an environment variable to exposing a literal key in arguments.
ANTGAIN_DATA_DIROverride the default ~/.antgain data directory. Keep it consistent across commands.
ANTGAIN_DEVICE_IDOptional explicit UUID. Keep stable across restarts and distinct for simultaneously running nodes.
ANTGAIN_API_URLLeave 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.

Docker commands · Safety & Privacy

CLI commands | AntGain