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:
| Flag | Description |
|---|---|
--node-id | The unique identifier for the node (from dashboard) |
--token | The authentication token (from dashboard) |
What it does:
- Registers the node with the OpsSquad platform
- Downloads the connectivity layer binary
- Creates configuration files
- 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 statusOutput 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: 12345opssquad node start
Manually starts the node process.
opssquad node startUse this if the node was stopped manually or failed to start automatically.
opssquad node stop
Manually stops the node process.
opssquad node stopWarning: 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 restartEquivalent to running stop followed by start. Useful after configuration changes.
opssquad node logs
Displays the node's log output.
opssquad node logs [flags]Flags:
| Flag | Short | Description | Default |
|---|---|---|---|
--follow | -f | Stream logs in real-time | false |
--lines | -n | Number of lines to show | 100 |
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 200opssquad node validate
Validates the installation and configuration.
opssquad node validateChecks 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:
| Flag | Description |
|---|---|
--force | Remove 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 --forceCLI Commands
opssquad upgrade
Updates the CLI tool to the latest available version.
opssquad upgradeWhat it does:
- Checks GitHub for the latest release
- Downloads the new binary for your platform
- Replaces the current installation
- 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 --versionExample output:
opssquad version 1.0.0 (abc1234)
Built: 2024-01-15opssquad --help
Displays help information for any command.
# General help
opssquad --help
# Help for a specific command
opssquad node --help
opssquad node install --helpCommand Summary
| Command | Description |
|---|---|
opssquad node install | Install and configure a new node |
opssquad node status | Check node status |
opssquad node start | Start the node |
opssquad node stop | Stop the node |
opssquad node restart | Restart the node |
opssquad node logs | View node logs |
opssquad node validate | Validate installation |
opssquad node uninstall | Remove the node |
opssquad upgrade | Update the CLI |
opssquad --version | Show version |
opssquad --help | Show help |
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Configuration error |
3 | Network/connectivity error |
4 | Permission error |
Next Steps
- Configuration - Learn about configuration files and parameters.
- Troubleshooting - Solutions to common issues.