SSH Remote Integration
The SSH integration enables you to bring your prompts and execute them on a remote server via SSH. In interactive mode, your prompts become available in your remote shell session, executable exactly like on your computer.
Non Interactive Mode
When executing a prompt, you can change the "execution context" to become that of a remote SSH server.
log_analyzer --ssh-dest user@remote_hostThis tells remote-capable helpers to execute on the indicated server rather than on your local machine.
For instance if the prompt file of log_analyzer looks like:
then executing the prompt with --ssh-dest would fetch and render /var/log/nginx.conf from the specified server. Without --ssh-dest, it would be read locally.
Interactive Mode
Interactive mode allows you to SSH into a server, and execute your enabled prompts on that server directly inside the remote shell, exactly like how you would do on your local machine. Simply prepend promptctl to your usual ssh command while creating the connection:
$ promptctl ssh -p 2222 root@proxmox.lan
# enabled prompts available on server
root@proxmox.lan:~# log_analyzer --helpUnder the hood, promptctl just executes your system's SSH binary, thus you may pass all your usual SSH arguments, or define them in ~/.ssh/config as always. This creates a thin, session-bound mapping of remote shell functions to your prompts, and a channel for communicating with your local promptcmd instance.
INFO
In both interactive and non-interactive modes, neither your API keys nor your prompts files are transferred to the remote host. Prompt execution still takes place locally.
Channels
The remote shell communicates with the locally running promptctl for executing prompts via a channel that gets established over the SSH connection. You can choose from several channel types.
TIP
Normally you should not need to change default channel, unless in an unlikely scenario that a target server is not compatible with default one.
| Channel | Communication Over | Server Requirements |
|---|---|---|
| fifo | named Pipes in a multiplexed SSH connection | Ability to execute mkfifo |
| nc | remote forwarded port | TCP forwarding enabled in sshd, nc in path |
| socat | remote forwarded unix socket | TCP forwarding enabled in sshd, socat in path |
| bashtcp | remote forwarded port | TCP forwarding enabled in sshd, bash |
Configuration
In your config you can customize the integration for each server. While establishing the SSH connection, the specified username and server are used in finding the closest matching configuration.
# Global, for all ssh hosts
[[ssh]]
# Display Message of the Day if not disabled by remote user
motd = false
# Communication Channel between remote and local
channel = "fifo"
# Remote shell. Leave default for auto detection.
shell = "auto"
# Define multiple times for different hosts
[[ssh]]
host = "proxmox.lan"
shell = "bash"
# or for a specific user on a host
[[ssh]]
host = "proxmox.lan"
user = "root"
channel = "nc"See config sample for full reference.
Limitations
The are some limitations that are still currently being worked on: