028 min

CLI Essentials

Master the command-line interface for xSwarm power users

The One Command You Need

xSwarm is designed around a single entry point:

npx xswarm

This command does the right thing depending on your state:

  • First time? Opens GitHub auth flow
  • Not running? Starts the worker daemon
  • Already running? Shows status
npx xswarm command demo
One command handles everything

Checking Status

See what your worker is up to:

npx xswarm status

This shows:

  • Daemon status (running/stopped)
  • Process ID (PID)
  • Memory usage
  • CPU usage
  • Restart count
  • Active tasks
xSwarm status command
Worker status at a glance

Viewing Logs

Watch what your worker is doing in real-time:

npx xswarm logs

By default, shows the last 50 lines. For more:

npx xswarm logs --lines 200
xSwarm logs command
Live logs from your worker
Pro tip: Logs are stored in ~/.xswarm/logs/ if you need to search through historical output.

Controlling the Daemon

Start, stop, and restart your worker:

npx xswarm startStart the worker daemon
npx xswarm stopStop the worker daemon
npx xswarm restartRestart the worker daemon
Daemon control commands
Control your worker lifecycle

Authentication

Manage your GitHub connection:

npx xswarm loginRe-authenticate with GitHub
npx xswarm logoutClear stored credentials

Your authentication token is stored in ~/.xswarm/token. The logout command removes this file.

Configuration

Check your current configuration:

npx xswarm config

This shows your API endpoint and whether you have valid authentication. Configuration is stored in ~/.xswarm/.

~/.xswarm/
├── token Your auth token
├── config.json Worker settings
└── logs/ Log files

Quick Reference

CommandDescription
npx xswarmSmart default: auth → start → status
npx xswarm statusShow worker status
npx xswarm logsView worker logs
npx xswarm startStart worker daemon
npx xswarm stopStop worker daemon
npx xswarm restartRestart worker daemon
npx xswarm loginRe-authenticate with GitHub
npx xswarm logoutClear credentials
npx xswarm configShow configuration

What's Next?

Now that you know the CLI, explore the web dashboard: