CLI Reference

Manage your Uplink server from the command line.

Uplink ships with a CLI tool (uplink-chat) that handles starting, stopping, monitoring, and updating the server. If you installed globally via npm, the command is available everywhere. With npx, prefix commands with npx.

bash
uplink-chat [command] [options]

start

Start the Uplink server. This is the default command — running uplink-chat with no arguments is the same as uplink-chat start.

bash
# Foreground (default) — auto-restart via watchdog
uplink-chat

# Background (daemon mode)
uplink-chat start --detach

# Custom port
uplink-chat --port 8080

# Bind to specific host
uplink-chat --host 127.0.0.1

# Raw mode — no watchdog, no auto-restart
uplink-chat --no-watchdog

By default, Uplink starts with a watchdog that automatically restarts the server if it crashes. The watchdog uses exponential backoff (1s → 2s → 4s → max 30s) and resets after 60 seconds of stable uptime.

OptionDescriptionDefault
--port NPort to listen on3456
--host HHost/IP to bind to0.0.0.0
--detach, -dRun in background (daemon mode)off
--no-watchdogDisable auto-restart watchdogoff
💡 Foreground vs. Detached

In foreground mode (default), the server logs to your terminal and stops when you close it. In detached mode (-d), it runs silently in the background — ideal for always-on setups. Both modes include the watchdog by default.

stop

Stop a running Uplink server. Handles both foreground and daemon (watchdog) processes.

bash
uplink-chat stop

If the server was started with --detach, this stops the watchdog (which also stops the server). If it was started in foreground mode, it sends a SIGTERM to the server process directly.

status

Check whether Uplink is running and display process info.

bash
uplink-chat status

Example output when running in watchdog mode:

output
⬡ Uplink is running (watchdog mode)
  Watchdog PID: 12345
  Server PID:   12347
  Uptime:       2h 14m 30s
  Restarts:     0

If the server has crashed and restarted, you'll see the restart count and current backoff interval.

update

Update Uplink to the latest version from npm.

bash
uplink-chat update

The update command:

  1. Checks the current version
  2. Stops the server if it's running
  3. Runs npm update -g @mooncompany/uplink-chat
  4. Reports the version change (or confirms you're already up to date)
  5. Restarts the server if it was running before the update
⚠ Permissions

If you installed Uplink globally with sudo, the update may also need elevated permissions. On macOS/Linux, use sudo uplink-chat update. On Windows, run your terminal as Administrator.

Other Flags

FlagDescription
--version, -vPrint the installed version and exit
--help, -hShow usage help and exit
bash
# Check version
uplink-chat -v
# → uplink-chat v0.5.1

# Show help
uplink-chat --help

Watchdog

The watchdog is a lightweight supervisor that restarts the Uplink server if it exits unexpectedly. It's enabled by default in both foreground and detached modes.

BehaviorValue
Initial restart delay1 second
Backoff multiplier
Maximum backoff30 seconds
Backoff reset after stable uptime60 seconds
Clean exit (code 0) behaviorDoes not restart

The watchdog writes its state to .uplink-watchdog.json in the Uplink root directory, which is how uplink-chat status reports uptime and restart counts.

To disable the watchdog entirely, pass --no-watchdog:

bash
uplink-chat --no-watchdog

Examples

Run on a different port

bash
uplink-chat --port 8080

Always-on daemon

bash
# Start in background
uplink-chat start -d

# Check on it later
uplink-chat status

# Stop when needed
uplink-chat stop

Quick one-off with npx

bash
# Run without installing
npx @mooncompany/uplink-chat

Update and restart

bash
# One command — stops, updates, restarts
uplink-chat update

Environment Variables

These can be used as alternatives to CLI flags:

VariableDescriptionEquivalent Flag
PORTServer port--port
UPLINK_HOSTBind address--host

CLI flags take priority over environment variables.

Next Steps