cmdok CLI
cmdok is a standalone command-line tool for connecting to your machines via SSH, executing commands, and running AI agents. Install with a single command — no SDK or programming language required. Works on macOS, Linux, and Windows.
A single binary that gives you secure access to your machines from any terminal.
For cmdok vs Go cmdop vs Python SDK, see the comparison on the SDK overview.
Installation
macOS & Linux
curl -fsSL cmdop.com/install-cli.sh | bashWindows (PowerShell)
iwr -useb cmdop.com/install-cli.ps1 | iexAfter installation, verify it works:
cmdok --versionQuick Start
1. Authenticate
# Log in with your cmdop account
cmdok auth login2. Connect via SSH
# Interactive SSH session to a machine
cmdok ssh my-server3. Execute commands
# Run a command on a remote machine
cmdok exec my-server "uname -a"
# Run with output streaming
cmdok exec my-server --stream "tail -f /var/log/app.log"Commands
cmdok ssh
Open an interactive SSH session to a registered machine.
cmdok ssh <machine-name>Works through any NAT — no port forwarding or VPN required. The connection is established via the cmdop relay, providing a seamless SSH experience.
cmdok exec
Execute a command on a remote machine and return the output.
# Basic execution
cmdok exec <machine-name> "command"
# Stream output in real-time
cmdok exec <machine-name> --stream "long-running-command"
# Set timeout (in seconds)
cmdok exec <machine-name> --timeout 60 "command"cmdok agent
Run an AI agent task on a remote machine.
# Run an agent prompt
cmdok agent <machine-name> "Check disk usage and clean up temp files"
# Run with structured output
cmdok agent <machine-name> --json "Report server health status"cmdok auth
Manage authentication.
# Log in to your account
cmdok auth login
# Show current auth status
cmdok auth status
# Log out
cmdok auth logoutcmdok machines
List and manage registered machines.
# List all machines
cmdok machines list
# Show machine details
cmdok machines info <machine-name>Options
| Flag | Description |
|---|---|
--version | Show version |
--help | Show help |
--api-key | Use API key instead of interactive login |
--timeout | Command timeout in seconds |
--stream | Stream output in real-time |
--json | Output in JSON format |
Platforms
| Platform | Architecture | Supported |
|---|---|---|
| macOS | arm64 (Apple Silicon) | Yes |
| macOS | amd64 (Intel) | Yes |
| Linux | amd64 | Yes |
| Linux | arm64 | Yes |
| Windows | amd64 | Yes |
Environment Variables
| Variable | Description |
|---|---|
CMDOP_API_KEY | API key for non-interactive authentication |
CMDOP_DEFAULT_MACHINE | Default machine name for commands |
Examples
Deploy and verify
# Deploy to production
cmdok exec prod-server "cd /app && git pull && docker compose up -d"
# Verify deployment
cmdok exec prod-server "curl -s localhost:3000/health"Server monitoring
# Check server health with AI
cmdok agent prod-server "Check CPU, memory, disk usage. Alert if anything is above 80%"Quick file inspection
# Check logs
cmdok exec prod-server "tail -50 /var/log/app.log"
# Check running processes
cmdok exec prod-server "ps aux | head -20"