Commands Reference
Complete reference for all CMDOP CLI commands. Covers authentication (login, logout, auth), machine management (machines, connect, status), terminal access (terminal, exec, sessions), file operations (files ls/get/put/rm/cat), workspace management, syntax highlighting with ccat, and utility commands. Includes global flags, exit codes, and scripting examples.
Complete reference for all CLI commands.
What global flags are available?
--help, -h Show help
--version, -v Show version
--workspace Override workspace
--output Output format (table, json, yaml)
--debug Enable debug output
--quiet Suppress non-error outputWhat are the authentication commands?
login
Authenticate via OAuth (opens browser).
# Opens browser for OAuth sign-in
cmdop loginlogout
Clear authentication.
# Remove stored credentials
cmdop logoutauth status
Check authentication status.
# Show user, workspace, and token expiry
cmdop auth statusOutput:
✓ Authenticated as: [email protected]
✓ Workspace: acme-corp
✓ Token expires: 2026-03-14auth create-key
Create an API key.
# Generate a new API key with a descriptive name
cmdop auth create-key --name "my-script"Flags:
--name— Key name (required)--permissions— Comma-separated permissions--expires— Expiration (e.g., “30d”, “1y”)
auth list-keys
List your API keys.
# Display all API keys with their permissions
cmdop auth list-keysauth revoke-key
Revoke an API key.
# Permanently invalidate a key by its prefix
cmdop auth revoke-key cmd_xxxWhat are the machine management commands?
machines
List all machines in workspace.
# Show all machines with status and last seen time
cmdop machinesOutput:
HOSTNAME STATUS LAST SEEN
prod-server connected just now
staging connected 2 minutes ago
dev-laptop offline 3 hours agoFlags:
--status— Filter by status (connected, offline)--json— Output as JSON
connect
Start agent on this machine.
# Register and start the background agent
cmdop connectFlags:
--name— Custom hostname--foreground— Run in foreground--debug— Debug output
status
Check agent status.
# Show agent connectivity and uptime
cmdop statusWhat are the terminal commands?
terminal
Open interactive terminal.
# Start an interactive shell session
cmdop terminal <hostname>Examples:
cmdop terminal prod-server
cmdop terminal prod-server --observe # Observer modeFlags:
--observe— Read-only mode
exec
Execute single command.
# Run a command and return the output
cmdop exec <hostname> "<command>"Examples:
cmdop exec prod-server "uptime"
cmdop exec prod-server "ls -la /var/log"Flags:
--timeout— Command timeout--json— Output as JSON
sessions
List active sessions.
# Show all active terminal sessions across machines
cmdop sessionsWhat are the file commands?
files ls
List directory contents.
# List files and directories at a remote path
cmdop files ls <hostname>:<path>Examples:
cmdop files ls prod-server:/var/log
cmdop files ls prod-server:/var/log --all # Include hiddenfiles get
Download file.
# Download a remote file to a local path
cmdop files get <hostname>:<remote-path> <local-path>Examples:
cmdop files get prod-server:/var/log/app.log ./app.log
cmdop files get prod-server:/app/data.db ./data.dbfiles put
Upload file.
# Upload a local file to a remote path
cmdop files put <local-path> <hostname>:<remote-path>Examples:
cmdop files put ./config.yaml prod-server:/app/config.yamlfiles rm
Delete file.
# Remove a file or directory from a remote machine
cmdop files rm <hostname>:<path>Flags:
--recursive, -r— Delete directory
files cat
Read file contents.
# Print remote file contents to stdout
cmdop files cat <hostname>:<path>What are the workspace commands?
workspace list
List your workspaces.
# Show all workspaces you belong to
cmdop workspace listworkspace use
Switch workspace.
# Set the active workspace for subsequent commands
cmdop workspace use <name>workspace current
Show current workspace.
# Display active workspace, role, and machine count
cmdop workspace currentworkspace members
List workspace members.
# Show all team members and their roles
cmdop workspace membersHow do I use syntax highlighting?
highlight
Display files with syntax highlighting.
cmdop highlight <file> [file...]Examples:
cmdop highlight main.py
cmdop highlight -n config.yaml # with line numbers
cmdop highlight -l python script # force language
cmdop highlight -t dracula main.go # different themeFlags:
-n, --line-numbers— Show line numbers-l, --language— Force language (auto-detect by default)-t, --theme— Color theme (default: monokai)--list-languages— List supported languages--list-themes— List available themes
Shell Alias: When you run cmdop connect, the ccat alias is automatically added:
ccat main.py # same as: cmdop highlight main.py
ccat -n config.yamlTo disable automatic alias setup:
cmdop connect --no-aliasesWhat are the utility commands?
version
Show version.
# Print CLI version and build info
cmdop versioncompletion
Generate shell completion.
# Generate tab-completion scripts for your shell
cmdop completion bash
cmdop completion zsh
cmdop completion fishconfig
Show configuration.
# View or update CLI configuration
cmdop config show
cmdop config set <key> <value>What do the exit codes mean?
| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Authentication error |
| 4 | Connection error |
| 5 | Timeout |
What are some common usage examples?
Deploy Script
#!/bin/bash
cmdop exec prod-server "cd /app && git pull && npm install && npm run build"
cmdop exec prod-server "systemctl restart app"Backup Files
#!/bin/bash
cmdop files get prod-server:/data/database.db ./backup/database-$(date +%Y%m%d).dbMulti-Server Command
for server in web-1 web-2 web-3; do
cmdop exec $server "apt update && apt upgrade -y"
done