Skip to Content

Commands Reference

TL;DR

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 output

What are the authentication commands?

login

Authenticate via OAuth (opens browser).

# Opens browser for OAuth sign-in cmdop login

logout

Clear authentication.

# Remove stored credentials cmdop logout

auth status

Check authentication status.

# Show user, workspace, and token expiry cmdop auth status

Output:

✓ Authenticated as: [email protected] ✓ Workspace: acme-corp ✓ Token expires: 2026-03-14

auth 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-keys

auth revoke-key

Revoke an API key.

# Permanently invalidate a key by its prefix cmdop auth revoke-key cmd_xxx

What are the machine management commands?

machines

List all machines in workspace.

# Show all machines with status and last seen time cmdop machines

Output:

HOSTNAME STATUS LAST SEEN prod-server connected just now staging connected 2 minutes ago dev-laptop offline 3 hours ago

Flags:

  • --status — Filter by status (connected, offline)
  • --json — Output as JSON

connect

Start agent on this machine.

# Register and start the background agent cmdop connect

Flags:

  • --name — Custom hostname
  • --foreground — Run in foreground
  • --debug — Debug output

status

Check agent status.

# Show agent connectivity and uptime cmdop status

What 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 mode

Flags:

  • --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 sessions

What 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 hidden

files 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.db

files 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.yaml

files 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 list

workspace 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 current

workspace members

List workspace members.

# Show all team members and their roles cmdop workspace members

How 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 theme

Flags:

  • -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.yaml

To disable automatic alias setup:

cmdop connect --no-aliases

What are the utility commands?

version

Show version.

# Print CLI version and build info cmdop version

completion

Generate shell completion.

# Generate tab-completion scripts for your shell cmdop completion bash cmdop completion zsh cmdop completion fish

config

Show configuration.

# View or update CLI configuration cmdop config show cmdop config set <key> <value>

What do the exit codes mean?

CodeDescription
0Success
1General error
2Invalid arguments
3Authentication error
4Connection error
5Timeout

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).db

Multi-Server Command

for server in web-1 web-2 web-3; do cmdop exec $server "apt update && apt upgrade -y" done
Last updated on