Skip to content

CLI command reference

anet manages the Hub, accounts, Networks, nodes, and external channels. This page keeps the current commands and behavior most likely to cause mistakes; follow the linked guides for full configuration.

Install and get help

bash
# Stable
npm install -g @sleep2agi/agent-network@latest

# Preview
npm install -g @sleep2agi/agent-network@preview

anet --help
anet <command> --help
anet -v

Node.js 22.13+ and Bun 1.2+ are required. --help only prints help; it does not mint a token, start a service, or perform another business action.

Shortest startup path

bash
# Terminal 1
anet hub start

# Terminal 2
anet login --hub http://127.0.0.1:9200 --username admin

# After login
anet node create my-agent
anet node start my-agent

The initial password depends on the release channel: stable (@latest) uses a fixed default documented under --password in anet hub start --help; preview (@preview) prints a one-time random password on first start. Run anet passwd immediately after logging in.

See Getting started for installation and first-time setup.

Hub

CommandPurpose
anet hub startStart the Hub; listens on 127.0.0.1:9200 by default
anet hub stop [--port <p>]Stop the local Hub listening on a port
anet hub status [--port <p>]Show listener state, PID, and server version
anet hub dashboardStart the Dashboard on port 3000 by default
anet hub configInspect or change local Hub launch settings
anet hub admin reset-user --username <user>Reset a user's password and user tokens on the Hub host

Common start options:

OptionPurpose
--port <port>Hub port; default 9200
--host <host> / --ip <host>Bind address; defaults to loopback-only 127.0.0.1
--username <user>Set the bootstrap administrator username
--password <pass>Explicitly set the bootstrap administrator password
--dev-openDisable authentication; isolated development only

Do not use --dev-open or expose 0.0.0.0:9200 directly in production. See Production deployment.

Accounts, Networks, and tokens

Accounts

CommandPurpose
anet registerCreate an account
anet loginLog in with username and password
anet login --token <token>Log in with an existing API token
anet logoutDelete the locally saved login token; does not revoke it on the Hub
anet whoamiShow the current user and accessible Networks
anet passwdChange the password and rotate the current login token

Networks

CommandPurpose
anet network lsList Networks the current user has joined
anet network create <name>Create a Network
anet network use <name>Switch the current Network
anet network infoInspect the current Network
anet network rename <old> <new>Rename a Network
anet network delete <name> --forceDelete a Network
anet network invite [options]Create an invite code
anet network join <code>Join with an invite code
anet network membersList current Network members

Invite options include --role admin|member|viewer, --uses <n>, and --expires <days>.

Tokens

CommandPurpose
anet token / anet token lsList the current user's API tokens
anet token create <name>Create an API token; plaintext is shown once
anet token revoke <token-id>Revoke a token

See Token model for token types, scopes, and compatibility behavior.

Nodes

CommandPurpose
anet node create <name>Create a node; opens the runtime wizard when omitted
anet node start <name>Start a node in the current terminal
anet node start <name> --tmuxStart or attach to a node in tmux
anet node stop <name>Stop the node and its same-name tmux session
anet node restart <name>Stop and start one node
anet node resume <name> [--session <id>]Resume the saved or specified session
anet node delete <name> --forceDelete local node configuration
anet node rename <ref> <new>Rename a node already registered with the Hub
anet node lsList local nodes and network state
anet info <name>Show node configuration, process, and recent tasks
anet logs <name> [--follow]Read or follow node logs
anet node migrate-token-to-envref <name>Replace plaintext secrets with envRef after writing a backup

node delete does not automatically revoke the node's issued ntok_. To invalidate it completely, also run anet token revoke <token-id>.

COMMHUB_TOKEN is not a CLI option, and there is no anet node start --token. Node authentication resolves in this order: node config, global config, then the legacy COMMHUB_TOKEN environment fallback. anet login --token logs in the CLI user; it does not inject a temporary node token into node start.

Common creation options:

OptionPurpose
--runtime <runtime>Select a runtime; use the current channel's wizard and Runtime comparison as the source of truth
--model <id>Override the runtime's default model
--resume <id>claude-code-cli: bind a specific Claude Code session
--resume-latestclaude-code-cli: bind the latest session in this project
--tools <list>Configure tools for runtimes that support this option

anet session ls lists Claude Code sessions for the current directory. Session semantics differ by runtime; do not use a Claude session ID as a Codex thread ID.

Project-wide lifecycle

These commands scan .anet/nodes/ under the current directory:

CommandPurpose
anet project upStart every node that is not already running
anet project restartRestart every node
anet project downStop every node and report it offline

Shared options:

  • --stagger <seconds>: delay between nodes; default 3 seconds, 0 disables it.
  • --only a,b: operate only on listed aliases or node IDs.
  • --exclude x,y: skip listed aliases or node IDs.

See Batch agents for batch creation and cleanup.

Channels

CommandPurpose
anet channel add telegram <node> --bot-token <token> --allow <uid>Add Telegram
anet channel add feishu <node> ...Add Feishu; currently a preview feature
anet channel allow feishu <node> ...Change Feishu DM or group allowlists
anet channel ls [node]List channels
anet channel status [node]Show Telegram's effective config path and allowlist

Channel settings are not hot-reloaded; restart the node after changing them. anet channel add wechat has not shipped. See Channel integration.

Goals

CommandPurpose
anet goal list [node]List local goals
anet goal show <node> <id>Show details and progress records
anet goal wake-log <node> <id> [--tail N] [--json]Export the complete wake history
anet goal edit <node> <id> ...Change interval, text, or status
anet goal cancel <node> <id>Mark a goal cancelled
anet node loop <node> "<task>" [--every 5m]Create a recurring task on an online node and wait up to 15 seconds for confirmation

node loop submits /aloop through the Hub. goal edit/cancel modify .anet/nodes/<node>/goals.json directly. A running node does not hot-reload external file changes; restart it after edit/cancel. See Goals and Loops for native Dashboard /goal and /loop, ANet /aloop and /agoal, statuses, and self-management tools.

Diagnostics and maintenance

CommandPurpose
anet statusShow nodes and task summary for the current Network
anet tasks [status] [--limit <n>]Query tasks
anet doctorCheck configuration, Hub, dependencies, secrets, and channels
anet doctor --fixApply compatibility migrations and repair recoverable token problems; modifies configuration
`anet upgrade [--channel latestpreview] [--dry-run]`
anet config / anet config path / anet config jsonShow global config summary, path, or raw JSON
anet initConfigure the Hub URL
anet init projectCreate CommHub MCP project files in the current directory
anet setupInstall dependencies for selected runtimes

See the Upgrade guide for upgrade details.

Preview-only features

The following commands exist in the current preview and must not be presented as stable features:

CommandPurpose
anet daemon up [name]Create and start a host_supervisor
anet daemon init <name> / start <name> / listManage local daemons
anet node start <name> --copresenceStart Codex app-server, bridge, and shared TUI
anet opencode ...Manage the preview OpenCode integration

--copresence only applies to runtime=codex-app-server. Its default sandbox is read-only. Full filesystem and network access requires --dangerously-allow-full-access; a TTY requires typing yes, and a non-TTY caller must also pass --yes-danger-full-access.

Resume a co-presence node with anet node start <name> --copresence; do not replace it with a normal node start.

opencode-cli is currently an agent-node-managed task runtime, not an attachable shared OpenCode TUI. The shared Grok TUI runtime grok-build-cli is also absent from the current preview packages; the available grok-build-acp runtime does not support attach.

Other commands

CommandPurpose
anet import [alias]Import recoverable local node configuration from the Hub
anet run --alias <name>Start a minimal SSE echo agent that does not invoke an LLM
anet demo [name]Run experimental demos; not a production orchestration path
anet batch <verb>Manage groups created by anet create --batch
anet license / anet activate <key>Legacy license compatibility; Apache-2.0 users normally do not need these

Legacy aliases such as anet create and anet start remain for compatibility. New documentation uses anet node ... consistently.

Configuration locations and environment variables

PathContents
~/.anet/config.jsonCurrent Hub, user token, and Network
.anet/nodes/<node>/config.jsonNode configuration
~/.commhub/commhub.dbDefault Hub SQLite database
~/.anet/server/admin-utok.jsonLocal administrator recovery token on the Hub host

Common environment variables:

VariablePurpose
COMMHUB_URLHub URL
COMMHUB_ALIASNode alias
COMMHUB_TOKENAuthentication token; a token in node configuration takes precedence
COMMHUB_AUTH_TOKENLegacy Hub master-token compatibility path; new deployments use user and node tokens
ANTHROPIC_BASE_URLAnthropic-compatible model endpoint
ANTHROPIC_AUTH_TOKENCredential for third-party Anthropic-compatible endpoints
ANTHROPIC_API_KEYCredential for Anthropic's official endpoint

Use envRef for secrets; do not commit tokens or model keys in configuration. See Security model.

See also

Powered by Sleep2AGI