Skip to main content

Command Structure

rexec <command> [subcommand] [options]

Authentication Commands

login

Login to Rexec with interactive browser flow or API token.
rexec login [--token TOKEN]
Interactive Login (Browser)
rexec login
Opens browser for OAuth login. Starts local callback server on port 9876.Token Login
rexec login --token rexec_your_api_token_here
Login with API token from dashboard settings.Manual Login If browser flow fails, follow manual instructions:
  1. Visit https://rexec.pipeops.io/settings
  2. Generate API token
  3. Use rexec login --token YOUR_TOKEN
Example:
$ rexec login

╔══════════════════════════════════════════╗
           Rexec CLI Login
╚══════════════════════════════════════════╝

Opening browser for login...
Waiting for login... (Press Ctrl+C to cancel)

 Successfully logged in as johndoe ([email protected])

logout

Logout and clear stored credentials.
rexec logout
Example:
$ rexec logout
 Logged out

whoami

Show current user information and authentication status.
rexec whoami
Example:
$ rexec whoami

User Profile
─────────────────────────────
  Username: johndoe
  Email:    [email protected]
  Tier:     pro
  Host:     https://rexec.pipeops.io

Terminal Management Commands

ls / list

List all your terminals with status and details.
rexec ls
rexec list
Example:
$ rexec ls

Terminals
─────────────────────────────────────────────────────────────────────────────
ID           NAME                 IMAGE           STATUS       ROLE
─────────────────────────────────────────────────────────────────────────────
abc123def456 dev-environment      ubuntu:22.04    running      devops
xyz789ghi012 test-container       debian:bookworm stopped      default
jkl345mno678 python-sandbox       python:3.11     running      developer

create

Create a new terminal container.
rexec create [options]
FlagAliasDescriptionDefault
--name-nTerminal nameterminal-{timestamp}
--image-iDocker imageubuntu
--role-rUser roledefault
--memory-mMemory limit (e.g., 512m, 2g)512m
--cpu-cCPU limit (e.g., 0.5, 1, 750m)0.5
Available Images:
  • ubuntu - Ubuntu 22.04 LTS
  • debian - Debian Bookworm
  • arch - Arch Linux
  • python - Python 3.11
  • node - Node.js 20 LTS
  • golang - Go 1.21
  • Custom image: specify full Docker reference (e.g., nginx:alpine)
Available Roles:
  • default - Basic user
  • developer - Development tools
  • devops - DevOps/infrastructure tools
  • admin - Full admin access
Examples:
# Create with defaults
rexec create

# Create with custom name and image
rexec create --name mydev --image ubuntu:22.04

# Create with resource limits
rexec create --name heavy-build --memory 4g --cpu 2 --role devops

# Create with custom Docker image
rexec create --name nginx-test --image nginx:alpine
Output:
$ rexec create --name mydev --image ubuntu:22.04 --role devops
Creating terminal...

 Terminal created
  ID:    abc123def456
  Name:  mydev
  Image: ubuntu:22.04

Connect with: rexec connect abc123de

connect / ssh

Connect to a terminal with interactive shell.
rexec connect <terminal-id>
rexec ssh <terminal-id>
Terminal ID Use short ID prefix (shown in rexec ls). The CLI automatically resolves:
  • abc123 → full container ID
  • agent:xyz → agent terminal
Disconnecting
  • Press Ctrl+] to disconnect
  • Press Ctrl+C twice within 1 second to disconnect
  • Single Ctrl+C is forwarded to the remote terminal
Terminal Features
  • Full PTY with terminal resizing
  • Color support and ANSI codes
  • Auto-handles WebSocket connection
  • Supports both cloud containers and agent machines
Example:
$ rexec connect abc123
Connecting to terminal abc123def456...
Tip: press Ctrl+] or double Ctrl+C to disconnect.

root@abc123def456:~# echo "Hello from Rexec!"
Hello from Rexec!
root@abc123def456:~# exit

Disconnected.

start

Start a stopped terminal.
rexec start <terminal-id>
Example:
$ rexec start abc123
 Terminal started

stop

Stop a running terminal.
rexec stop <terminal-id>
Example:
$ rexec stop abc123
 Terminal stopped

rm / delete

Delete a terminal permanently (requires confirmation).
rexec rm <terminal-id>
rexec delete <terminal-id>
Example:
$ rexec delete abc123
Are you sure you want to delete terminal abc123? (y/N): y
 Terminal deleted

Snippets & Automation

snippets

List and manage code snippets and command macros.
rexec snippets [marketplace]
View Your Snippets:
$ rexec snippets

Your Snippets
─────────────────────────────────────────────────────────
  docker-install [private] - Install Docker on Ubuntu
    $ curl -fsSL https://get.docker.com | bash
  
  setup-node [public] - Install Node.js LTS
    $ curl -fsSL https://deb.nodesource.com/setup_lts.x | bash
Browse Marketplace:
$ rexec snippets marketplace

Marketplace Snippets
─────────────────────────────────────────────────────────
  docker-install - Install Docker Engine
    $ curl -fsSL https://get.docker.com | bash
  
  update-system - Update system packages
    $ apt update && apt upgrade -y

run

Run a snippet on a terminal.
rexec run <snippet-name> [--terminal TERMINAL_ID]
FlagAliasDescription
--terminal-tTarget terminal ID
Without Terminal ID: If you don’t specify --terminal, the CLI prompts you to select from available terminals.Snippet Sources:
  • Personal snippets from your library
  • Public snippets from marketplace
Example:
# Run snippet with interactive terminal selection
$ rexec run docker-install

Select terminal:
  1. dev-environment (abc123de)
  2. test-container (xyz789gh)

Enter number: 1
Running snippet 'docker-install' on terminal abc123de...
$ curl -fsSL https://get.docker.com | bash

[Docker installation output...]

 Command sent

# Run snippet on specific terminal
$ rexec run update-system --terminal abc123

Agent Mode Commands

agent register

Register the current machine as a Rexec terminal.
rexec agent register [options]
FlagAliasDescriptionDefault
--name-nAgent nameSystem hostname
--description-dAgent descriptionEmpty
Agent Configuration: Stored in ~/.rexec/agent.json
Example:
$ rexec agent register --name my-server --description "Production web server"

Agent Registration
─────────────────────────────────────────
This will register this machine as a rexec terminal.

  Name:        my-server
  Description: Production web server
  OS:          linux/amd64

Continue? (y/N): y

 Agent registered
Start the agent with: rexec agent start

agent start

Start the agent to connect machine to Rexec.
rexec agent start

agent stop

Stop the running agent.
rexec agent stop

agent status

Show agent registration and connection status.
rexec agent status
Example:
$ rexec agent status

Agent Status
─────────────────────────────────────────
  Registered:
  Name:       my-server
  Running:    No
For production agent deployment, use the standalone rexec-agent binary. See Agent Documentation.

Utility Commands

dashboard / ui / -i / tui

Launch interactive TUI dashboard.
rexec dashboard
rexec ui
rexec -i
rexec tui
All commands launch the Bubble Tea TUI interface. See TUI Overview for details.

config

View or modify CLI configuration.
rexec config [set KEY VALUE]
View Config:
$ rexec config

Configuration
─────────────────────────────────────────
  Config file: /home/user/.rexec/config.json
  Host:        https://rexec.pipeops.io
  Username:    johndoe
  Email:       [email protected]
  Tier:        pro
  Token:       rexec_abc123...xyz789
Set Config:
# Change API host
rexec config set host https://custom.rexec.io
 Config updated

version

Show CLI version and platform information.
rexec version
rexec -v
rexec --version
Example:
$ rexec version
rexec-cli v1.0.0
OS: linux/amd64

help

Show help message with all commands.
rexec help
rexec -h
rexec --help

Global Options

These environment variables work with all commands:
# Override API host
export REXEC_HOST="https://custom.rexec.io"

# Override authentication token
export REXEC_TOKEN="rexec_your_token_here"

# Use custom TUI binary path
export REXEC_TUI_PATH="/path/to/rexec-tui"

Exit Codes

CodeMeaning
0Success
1General error
1Not authenticated (run rexec login)
1Invalid command or arguments

Tips & Tricks

You don’t need the full terminal ID. Use the first 6-8 characters:
rexec connect abc123  # Instead of abc123def456ghi789
Use number keys 1-9 in the TUI to quickly connect to terminals:
rexec -i
# Press '1' to connect to first terminal
Use shell operators for workflows:
# Create and immediately connect
rexec create --name test && rexec connect $(rexec ls | grep test | awk '{print $1}')

# Stop all running terminals (be careful!)
rexec ls | grep running | awk '{print $1}' | xargs -n1 rexec stop

Build docs developers (and LLMs) love