Skip to Content

Terminal Access

TL;DR

Access remote terminals with cmdop terminal <hostname>. CMDOP provides full PTY support with colors, tab completion, and interactive programs like vim and htop. Sessions persist across disconnects, multiple clients can share a session, and observer mode enables read-only watching. Use cmdop exec for single-command execution with optional JSON output.

Access remote terminals from your command line.

How do I connect to a remote terminal?

# Open interactive shell on a remote machine cmdop terminal <hostname>

Example:

# Connect to the production server cmdop terminal prod-server

You’re now in an interactive shell:

Connected to prod-server Session: a1b2c3d4-e5f6-7890-abcd-ef1234567890 deploy@prod-server:~$ _

What features does the terminal support?

Full PTY Support

  • Colors and formatting
  • Arrow keys and navigation
  • Tab completion
  • Interactive programs (vim, htop, tmux)

How does session persistence work?

Close terminal with Ctrl+D or exit:

Session continues running. Reconnect with: cmdop terminal prod-server

Your processes keep running!

What keyboard shortcuts are available?

ShortcutAction
Ctrl+DDetach from session
Ctrl+CSend SIGINT to process
Ctrl+ZSuspend process
Ctrl+\Send SIGQUIT

How do I use observer mode?

Watch without ability to type:

# Watch session without ability to type (read-only) cmdop terminal prod-server --observe

Useful for:

  • Training/shadowing
  • Audit/compliance
  • Monitoring

How do I use multiple sessions?

Open multiple terminals to same machine:

Terminal 1:

cmdop terminal prod-server echo "Hello from terminal 1"

Terminal 2:

cmdop terminal prod-server # Sees "Hello from terminal 1"! echo "Hello from terminal 2"

Both terminals share the same session.

How do I execute a single command?

For scripts, use exec instead:

# Run a single command without opening an interactive shell cmdop exec prod-server "uptime"

Output:

14:23:01 up 42 days, 3:15, 2 users, load average: 0.15, 0.10, 0.08

With Timeout

# Set 5-minute timeout for long-running scripts cmdop exec prod-server "long-script.sh" --timeout 300

JSON Output

# Get structured output for scripting and automation cmdop exec prod-server "uptime" --json
{ "hostname": "prod-server", "command": "uptime", "exit_code": 0, "output": "14:23:01 up 42 days...", "duration_ms": 150 }

Can I use SSH-style syntax?

# Use familiar user@host format (same as SSH) cmdop terminal user@hostname

How do I pass environment variables?

# Pass environment cmdop exec prod-server --env "DEBUG=1" --env "API_KEY=xxx" "./script.sh"

How does CMDOP compare to SSH?

SSHCMDOP
ssh user@ipcmdop terminal hostname
Need IP and port 22Just hostname
Keys in ~/.sshOAuth authentication
Connection = sessionSession persists
One clientMultiple clients

How do I troubleshoot terminal issues?

Connection Timeout

# Check machine status cmdop machines # If offline, restart agent on target # (on the target machine) cmdop connect

Permission Denied

# Check your workspace membership cmdop workspace current cmdop workspace members

Lag or Latency

# Check network ping grpc.cmdop.com # Try with debug cmdop terminal prod-server --debug
Last updated on