Skip to main content

Overview

The m87 CLI provides several commands for accessing and monitoring remote devices. These commands allow you to open interactive shells, execute commands remotely, check device status, and audit device access logs.

Shell Command

Open a persistent interactive shell session on a remote device.

Syntax

Description

The shell command provides a full interactive shell with PTY support, similar to SSH. It opens a persistent bash session on the remote device with full terminal capabilities.

Features

  • Full PTY support - Colors, cursor control, and terminal formatting
  • TUI applications - Works with vim, htop, less, nano, and other terminal UI apps
  • Default shell - Uses the user’s default shell defined in $SHELL
  • Easy exit - Press Ctrl+D to exit the shell session

Examples

For scripting and automation, use exec instead of shell. The shell command is designed for interactive work only.

Shell vs Exec Comparison


Exec Command

Execute commands on remote devices with optional stdin forwarding and TTY support.

Syntax

Options

Execution Modes

Examples

Shell Quoting

Commands are interpreted by your local shell first. Use single quotes to send commands literally to the remote device.

Ctrl+C Behavior

TTY flag behavior: The -t flag without -i allocates a TTY for output formatting but does not connect stdin. This means keyboard input (including Ctrl+C) has no effect. Use -t alone for commands that need colored/formatted output but no interaction.

Process Cleanup

When the connection closes (Ctrl+C, network drop, etc.), the remote process is automatically terminated. No orphaned processes are left on the device.

Status Command

Check the status of a remote device including health, crashes, and incidents.

Syntax

Description

Displays comprehensive status information about the device, including:
  • Connection status (online/offline)
  • System health metrics
  • Recent crashes or errors
  • Active incidents
  • Runtime information

Example

Use m87 devices list to see the status of all devices at once.

Audit Command

View audit logs showing who interacted with the device and when.

Syntax

Options

Examples

Audit Log Information

Audit logs capture:
  • User access events (shell, exec, etc.)
  • Command executions
  • File transfers
  • Port forwarding sessions
  • Deployment operations
  • Timestamps and user identifiers
Audit logs help with compliance, security monitoring, and troubleshooting device access issues.