Desktop CLI

The Desktop build of DR-Terminal ships a command-line interface. Useful for IDE integrations, scripting and automation.

Usage

DR-Terminal connect <target> [flags]

Flags

FlagDescription
-u, --userUser name (for host:port targets).
-p, --passwordPassword on the command line (insecure — may hit shell history).
--password-stdinRead password from stdin (safe: pass show server | DR-Terminal ...). --exec only.
-i, --identityPrivate key file (PEM). --exec only.
-j, --jumpChain of jump hosts by name, e.g. bastion1,bastion2.
-c, --commandShell snippet: injected after login (default) or executed headlessly with --exec.
--new-tabForce opening a new tab in the running instance.
--execHeadless: run command, stream stdout/stderr, exit with the remote exit code.
-h, --helpShow this help.

-i and --password-stdin apply to headless --exec runs only. When opening a tab in the GUI, authentication uses the saved connection's credentials or the regular in-app prompts.

Examples

# Open a new tab in the running instance and log into saved "lager"
DR-Terminal connect lager --new-tab

# Ad-hoc host with user — the app prompts for credentials
DR-Terminal connect 10.0.0.1:22 -u pi --new-tab

# Jump chain: bastion1 → bastion2 → target
DR-Terminal connect production -j bastion1,bastion2 --new-tab

# Headless exec with a key file — prints uptime and exits
DR-Terminal connect 10.0.0.1:22 -u pi -i ~/.ssh/id_ed25519 --exec -c 'uptime'

# CLI start script: run commands after login
DR-Terminal connect dev --new-tab -c 'cd /srv/app && tmux attach -t main'

Local terminal from the CLI

DR-Terminal local [flags]

Opens a new Local terminal tab in the GUI (starting it when it is not running) and optionally types a command into the ready shell. The shell stays interactive after the command finishes — the tab is a regular local session.

FlagDescription
-t, --typeShell to open: system, cmd, powershell, pwsh, wsl or wsl:<distribution>. Omitted: the local shell configured in Settings — the same one the Local terminal button opens. The choice applies to this tab only.
-c, --commandTyped into the new tab's shell once it is ready — never into the session that happened to be active.
--cwdWorking directory for the shell. Omitted: the directory the CLI was invoked from, so relative paths in --command point at the same files whether the app was already running or not.

cmd, powershell, pwsh and wsl are Windows shells; on other systems use --type system or configure the shell in Settings.

# Default local shell, run a script from the current directory
DR-Terminal local --command "python3 aaaa.py"

# Windows: force CMD and a working directory with spaces
DR-Terminal.exe local --type cmd --cwd "C:\projekty\demo" --command "python3 aaaa.py"

# Just open a WSL tab in a picked distribution
DR-Terminal local --type wsl:Ubuntu-24.04

Symlink into PATH

After installing DR-Terminal, create a symlink so the command works globally:

sudo ln -s /path/to/DR-Terminal/bin/DR-Terminal /usr/local/bin/dr-terminal
dr-terminal connect lager --exec -c 'df -h'

Single-instance

DR-Terminal keeps one instance per user (Unix domain socket or named pipe on Windows). A second DR-Terminal connect ... or DR-Terminal local ... forwards its args to the running instance and exits — the running instance then opens the new tab.

Previous
Local & serial
Next
Security & data