Skip to Content
SDKcmdop connectCLI

cmdop connect — CLI reference

TL;DR

cmdop connect is the CLI surface for reaching machines registered in your CMDOP fleet. Connect interactively, run one-shot commands, list machines, and manage per-machine passwords — no port forwarding or SSH keys required.

cmdop connect is part of the Go cmdop binary. Install the full CLI, then use cmdop connect for machine access. Works on macOS, Linux, and Windows.

For all CLI verbs, see the CLI docs.

Installation

macOS & Linux

curl -sSL cmdop.com/install.sh | bash

Windows (PowerShell)

iwr -useb cmdop.com/install.ps1 | iex

Verify:

cmdop --version

Quick Start

1. Authenticate

cmdop login

2. List registered machines

cmdop connect --list

3. Attach to a machine

cmdop connect vps-audi

4. Run a one-shot command

cmdop connect exec vps-audi -- uname -a

Command surface

Interactive attach

cmdop connect # fuzzy picker → confirm → PTY cmdop connect vps-audi # skip picker, direct attach

One-shot exec

cmdop connect exec <host> -- <command...> # With flags cmdop connect exec vps-audi --timeout 60 -- systemctl status nginx cmdop connect exec vps-audi --json -- df -h

exec exits with the remote’s status code. With --json it emits:

{"stdout":"...","stderr":"","exit_code":0,"duration_ms":42}

Per-machine passwords

cmdop connect password set # store password for this machine cmdop connect password status # check if a password is stored cmdop connect password list # list machines with stored passwords cmdop connect password clear # remove stored password

Machine inventory

cmdop connect --list # all machines in the active fleet cmdop connect --list --online # only currently connected machines cmdop connect --list --json # JSON output

Flags

FlagDescription
--api-key, -k <key>Override API key for this call
--server, -s <addr>Override gRPC relay address
--workspace <name>Use a named fleet (legacy flag name)
--jsonStructured JSON output
--no-interactive, -qNever prompt; fail fast
--listPrint machine inventory and exit
--onlineWith --list, show only online machines
--timeout, -t <sec>Command timeout in seconds (exec only, default 30s)

Platforms

PlatformArchitectureSupported
macOSarm64 (Apple Silicon)Yes
macOSamd64 (Intel)Yes
Linuxamd64Yes
Linuxarm64Yes
Windowsamd64Yes

Environment Variables

VariableDescription
CMDOP_API_KEYAPI key for non-interactive authentication

Scripting

Use --json --no-interactive for CI and automation:

# Deploy and verify cmdop connect exec prod-server --json --no-interactive -- "cd /app && git pull && docker compose up -d" # Check server health cmdop connect exec prod-server --json -- "curl -s localhost:3000/health" # Monitor logs cmdop connect exec prod-server -- "tail -50 /var/log/app.log" # List online machines in CI cmdop connect --list --online --json

Exit codes

CodeMeaning
0Success
1Generic error
2Auth failure
3Machine offline
4Ambiguous hostname
Last updated on