Skip to Content

cmdok CLI

TL;DR

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 | bash

Windows (PowerShell)

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

After installation, verify it works:

cmdok --version

Quick Start

1. Authenticate

# Log in with your cmdop account cmdok auth login

2. Connect via SSH

# Interactive SSH session to a machine cmdok ssh my-server

3. 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 logout

cmdok machines

List and manage registered machines.

# List all machines cmdok machines list # Show machine details cmdok machines info <machine-name>

Options

FlagDescription
--versionShow version
--helpShow help
--api-keyUse API key instead of interactive login
--timeoutCommand timeout in seconds
--streamStream output in real-time
--jsonOutput in JSON format

Platforms

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

Environment Variables

VariableDescription
CMDOP_API_KEYAPI key for non-interactive authentication
CMDOP_DEFAULT_MACHINEDefault 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"
Last updated on