OpsSquad
CLI Reference

Commands Reference

Complete reference for all OpsSquad CLI commands

This page provides a complete reference for all OpsSquad CLI commands.

Node Commands

All node management commands are grouped under opssquad node.

opssquad node install

Installs and configures a new node on the current server.

opssquad node install --node-id=<id> --token=<token>

Required Flags:

FlagDescription
--node-idThe unique identifier for the node (from dashboard)
--tokenThe authentication token (from dashboard)

What it does:

  1. Registers the node with the OpsSquad platform
  2. Downloads the connectivity layer binary
  3. Creates configuration files
  4. Sets up and starts the systemd service (on Linux with root)

Example:

opssquad node install \
  --node-id="node_abc123def456" \
  --token="tok_live_xxxxxxxxxxxxx"

opssquad node status

Displays the current status of the node service.

opssquad node status

Output includes:

  • Running state (Active/Stopped)
  • Connection status (Connected/Disconnected)
  • Version information
  • Uptime

Example output:

Node Status:  Active
Connection:   Connected
Version:      1.0.0
Uptime:       2h 34m 12s
PID:          12345

opssquad node start

Manually starts the node process.

opssquad node start

Use this if the node was stopped manually or failed to start automatically.


opssquad node stop

Manually stops the node process.

opssquad node stop

Warning: Stopping the node will disconnect it from the OpsSquad platform. Agents linked to this node won't be able to execute commands on this server until the node is restarted.


opssquad node restart

Restarts the node process.

opssquad node restart

Equivalent to running stop followed by start. Useful after configuration changes.


opssquad node logs

Displays the node's log output.

opssquad node logs [flags]

Flags:

FlagShortDescriptionDefault
--follow-fStream logs in real-timefalse
--lines-nNumber of lines to show100

Examples:

# Show last 100 lines
opssquad node logs

# Show last 50 lines
opssquad node logs --lines=50

# Stream logs in real-time
opssquad node logs --follow

# Short form
opssquad node logs -f -n 200

opssquad node validate

Validates the installation and configuration.

opssquad node validate

Checks for:

  • Configuration file existence and validity
  • Permission issues
  • Network connectivity to the platform
  • Node binary presence
  • Required directories

Example output:

✓ Configuration file found
✓ Configuration is valid
✓ Node binary exists
✓ Network connectivity OK
✓ Permissions OK

Validation passed!

opssquad node uninstall

Removes the node, configuration, and logs from the system.

opssquad node uninstall [flags]

Flags:

FlagDescription
--forceRemove without confirmation prompt

What it removes:

  • Node binary
  • Configuration files
  • Log files
  • Systemd service (if installed)

Danger: This action is irreversible. Make sure you want to completely remove the node before proceeding.

Example:

# With confirmation prompt
opssquad node uninstall

# Skip confirmation
opssquad node uninstall --force

CLI Commands

opssquad upgrade

Updates the CLI tool to the latest available version.

opssquad upgrade

What it does:

  1. Checks GitHub for the latest release
  2. Downloads the new binary for your platform
  3. Replaces the current installation
  4. Preserves all configuration

Example output:

Current version: 1.0.0
Latest version:  1.1.0

Downloading opssquad v1.1.0...
Upgrade complete!

opssquad --version

Displays the CLI version information.

opssquad --version

Example output:

opssquad version 1.0.0 (abc1234)
Built: 2024-01-15

opssquad --help

Displays help information for any command.

# General help
opssquad --help

# Help for a specific command
opssquad node --help
opssquad node install --help

Command Summary

CommandDescription
opssquad node installInstall and configure a new node
opssquad node statusCheck node status
opssquad node startStart the node
opssquad node stopStop the node
opssquad node restartRestart the node
opssquad node logsView node logs
opssquad node validateValidate installation
opssquad node uninstallRemove the node
opssquad upgradeUpdate the CLI
opssquad --versionShow version
opssquad --helpShow help

Exit Codes

CodeMeaning
0Success
1General error
2Configuration error
3Network/connectivity error
4Permission error

Next Steps

On this page