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-serverYou’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-serverYour processes keep running!
What keyboard shortcuts are available?
| Shortcut | Action |
|---|---|
Ctrl+D | Detach from session |
Ctrl+C | Send SIGINT to process |
Ctrl+Z | Suspend 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 --observeUseful 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.08With Timeout
# Set 5-minute timeout for long-running scripts
cmdop exec prod-server "long-script.sh" --timeout 300JSON 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@hostnameHow 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?
| SSH | CMDOP |
|---|---|
ssh user@ip | cmdop terminal hostname |
| Need IP and port 22 | Just hostname |
| Keys in ~/.ssh | OAuth authentication |
| Connection = session | Session persists |
| One client | Multiple 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 connectPermission Denied
# Check your workspace membership
cmdop workspace current
cmdop workspace membersLag or Latency
# Check network
ping grpc.cmdop.com
# Try with debug
cmdop terminal prod-server --debugWhat should I read next?
- File Operations — Transfer files
- Workspace Management — Manage workspaces
Last updated on