Show HN: Shellink – let AI agents run commands on servers behind jump hosts Shellink, an open-source session middleware for AI agents and humans working with SSH and local terminal sessions, provides a stable CLI for connection profiles, interactive sessions, command execution, file transfer, remote editing, and session state. The tool, available on GitHub, includes a local daemon that owns sessions and exposes a Web UI plus HTTP and WebSocket APIs, designed to let AI agents run commands on servers behind jump hosts while supporting multi-hop login automation, PTY-based continuity, human supervision, and auditable operations. One stable CLI and daemon for SSH, local PTY sessions, file transfer, and remote editing — built for AI agents and humans alike. Features features · Quick Start quick-start · Documentation table-of-contents · Contributing contributing · 中文文档 /jie123108/Shellink/blob/main/README.zh-CN.md An AI agent hops through a jump host and runs commands on the target server — driven entirely through the Shellink CLI. Shellink is an open-source session middleware for AI agents and humans working with SSH and local terminal sessions. It provides one stable CLI for connection profiles, interactive sessions, command execution, file transfer, remote editing, and session state. A local daemon owns the sessions and exposes a browser-friendly Web UI plus HTTP and WebSocket compatibility APIs. Repository: https://github.com/jie123108/Shellink https://github.com/jie123108/Shellink Security warning: command profiles execute their configured command as the server process user. Run Shellink only in a trusted environment and protect SHELLINK TOKEN . Shellink also lets an AI agent connect directly to production servers; this carries real operational risk, so prefer read-only, inspection, or analysis operations, or point the agent at non-production environments. Shellink shellink Web UI dashboard session list : Web UI live session terminal xterm.js , including a jump-host hop: CLI/TUI session view shellink cli : SSH and custom command sessions: Connect directly with SSH, or run a command/script inside a PTY. Multi-hop login automation: connectType: "command" supports expect and similar scripts for multi-level bastion hosts, jump-host menus, OTP prompts, and legacy authentication flows. Command execution and state handling: Execute commands, inspect state, provide interactive input, and wait for the session to become ready before the next operation. File transfer across jump hosts: Upload and download files through the existing PTY instead of requiring SFTP. This keeps transfers working through custom command chains and multi-hop connections. Remote file editing: Apply precise replacements with shellink session edit . Audit history and supervision: Session input/output is retained as history for audit and replay, while MANUAL mode lets a human take control and supervise or answer prompts. CLI/TUI, Web UI, REST, and WebSocket: Use the interface that fits the workflow, with stable --json output for automation. Encrypted profiles and optional single-file binaries: Credentials are protected in SQLite, and Bun builds are available for macOS and Linux. Shellink is designed around the situations where an AI agent needs reliable access but should not guess or bypass human controls: Scriptable multi-hop access: Agents can reuse expect or other custom login scripts for several bastion hops instead of implementing each site's authentication flow themselves. PTY-based continuity: Commands and file transfers use the same PTY path, so an agent can work through jump hosts even when no direct SFTP or SSH endpoint is available. Human supervision: AUTO mode is for agent actions; MANUAL mode hands the terminal to a person for approval, OTP entry, or intervention before automation continues. Auditable operations: Session input/output history and daemon logs give operators a record for reviewing what the agent saw and did. Observable progress: Explicit session states and machine-readable CLI output let an agent decide whether to execute, send input, wait, or ask for human help. The repository is an npm workspace monorepo with one additional non-workspace directory for agent skills: | Path | Type | Responsibility | |---|---|---| protocol/ | npm workspace | Versioned RPC methods, MessagePack frames, and Zod schemas | cli/ | npm workspace | shellink CLI, daemon lifecycle commands, and terminal UI | server/ | npm workspace | Unix-socket daemon, session engine, services, HTTP, and WebSocket gateway | web/ | npm workspace | Vue 3 browser console with xterm.js | skills/ | plain directory | Agent skills for remote operations and iTerm2 profile import | The runtime flow is: php flowchart LR Client "CLI / TUI" -- |Unix socket, MessagePack RPC| Daemon "Daemon services" Daemon -- Sessions "SSH / local PTY sessions" Daemon -- Storage "SQLite state and encrypted credentials" Daemon -- Gateway "HTTP REST / WebSocket gateway / Web UI" The Unix socket is the primary local interface. HTTP, WebSocket, and the Web UI are compatibility and browser layers. New local automation should use the CLI rather than implementing the socket protocol directly. Runtime: Node.js =22.19.0 ; Bun is optional for compiled binaries. Language: TypeScript with npm workspaces. Server: Fastify, ssh2 , node-pty , ws , SQLite via better-sqlite3 and Drizzle ORM. Protocol: MessagePack framing and Zod validation. Web: Vue 3, Vite, Naive UI, Pinia, and xterm.js. Testing: Vitest with V8 coverage and Docker-backed end-to-end fixtures. Using an AI coding agent?Paste this prompt into your agent's chat: Please help me install Shellink and its skills by following https://raw.githubusercontent.com/jie123108/Shellink/main/AGENTS INSTALL.md Prebuilt binaries are published for macOS and Linux darwin-arm64 , darwin-x64 , linux-arm64 , linux-x64 . Windows is not supported; build from source instead see below . curl -fsSL https://raw.githubusercontent.com/jie123108/Shellink/main/install.sh -o /tmp/shellink-install.sh cat /tmp/shellink-install.sh sh /tmp/shellink-install.sh Pin a release tag if needed: curl -fsSL https://raw.githubusercontent.com/jie123108/Shellink/main/install.sh -o /tmp/shellink-install.sh cat /tmp/shellink-install.sh sh /tmp/shellink-install.sh --version v0.1.0 For a system-wide install into /usr/local/bin already on PATH on most systems , run with sudo : sudo sh /tmp/shellink-install.sh --dir /usr/local/bin The script downloads the matching asset from GitHub Releases, verifies SHA256SUMS.txt , and installs shellink to $HOME/.local/bin by default. If that directory is not on PATH , the installer appends an export PATH=... line to your shell profile ~/.zshrc , ~/.bashrc , etc. . Open a new shell or re-export PATH , then verify: shellink -V Requirements: - Node.js 22.19 or newer. - npm. - Docker, only if you want to run the Docker-backed end-to-end tests. - Bun, only if you want to build a standalone binary. git clone https://github.com/jie123108/Shellink.git cd Shellink npm install npm run build The built CLI is available at ./node modules/.bin/shellink . To build a standalone executable for the current platform: npm run build:binary mkdir -p "$HOME/.local/bin" cp dist/shellink "$HOME/.local/bin/shellink" export PATH="$HOME/.local/bin:$PATH" Cross-build scripts are available for macos-arm64 , macos-x64 , linux-arm64 , and linux-x64 . Start the interactive terminal UI. It starts the user-level daemon automatically when necessary: shellink cli Check the daemon and print the machine-readable agent reference: shellink server status --json shellink agent-doc Create a command profile and session without putting credentials in shell history: shellink profile create --input - --json <<'JSON' {"name":"local-shell","connectType":"command","command":"/bin/sh"} JSON shellink profile list --query local --json shellink session create --profile