专为 AI agent 打造的 SSH 客户端
ssh 会卡在提示上、忘掉 cd、要你的密码。xssh 跨工具调用保持 shell,一行报告状态,密码不给 agent。
发给你的 agent
安装 xssh:阅读 https://xssh.io/llms.txt 并照做。
或 PowerShell
> irm https://xssh.io/install.ps1 | iex$ xssh session run w -- 'sudo apt-get upgrade' Do you want to continue? [Y/n] [xssh w waiting prompt=confirm] $ xssh session send w y --enter Setting up nginx (1.24.0-2ubuntu7.5) … [xssh w done exit=0] $ xssh session run w -- pwd /srv/app [xssh w done exit=0]
不再卡在提示上
同一件事,两个工具。
$ ssh deploy@web1 'sudo apt-get upgrade' [sudo] password for deploy: … 120 s, no output …
卡在密码提示,超时。
$ xssh session run w -- 'sudo apt-get upgrade' Do you want to continue? [Y/n] [xssh w waiting prompt=confirm] $ xssh session send w y --enter [xssh w done exit=0]
提示被报告、被回答。shell 状态保留。
一条命令,一个精确结果
输出简洁、无颜色码,带退出码和下一步。
xssh host list- 已存服务器:备注、标签、系统、上次成功。
xssh exec H -- cmd- 单台、多台或 @tag 并行。真实退出码。
xssh session run N -- cmd- 跨调用保留 cwd、环境变量和程序的 shell。
xssh session send N …- 回答提示,驱动 REPL、vim、top。
xssh job start H -- cmd- 不怕超时和断线。
xssh file edit H PATH- 精确原子替换,自动备份。
xssh cp SRC… DST- rsync 式:跳过未变文件,大文件续传。
xssh forward add H -L …- -L、-R、SOCKS5,由守护进程托管。
xssh status | diag | logs H- 健康、诊断与下一步、日志。
xssh host trust H- 主机密钥变了?由人确认。
六种状态,不靠猜
每次回复以此结尾:
[xssh NAME STATE exit=CODE prompt=KIND]
- done
[xssh w done exit=0]已结束,退出码真实。 - waiting
[xssh w waiting prompt=confirm]有提示,用 session send 回答。 - running
[xssh w running]仍在输出,再读或等待。 - quiet
[xssh w quiet]在运行,无输出。 - tui
[xssh w tui]全屏程序,回复即屏幕。 - disconnected
[xssh w disconnected]断开(exit 69),持久会话自动重连。
密码留在你手里
agent 拿到能力,不拿凭据。
- 密码存于系统钥匙串。
- 由你在终端或对话框输入,不进对话。
- sudo 自动从钥匙串填写。
- {secret:NAME} 注入秘密,输出显示 ***。
- 主机密钥变化绝不绕过。
$ xssh file edit db /srv/app/.env --old 'DB_PASS=old' --new 'DB_PASS={secret:dbpw}' --secrets edited /srv/app/.env (1 replacement) 12 DB_PASS=*** $ xssh host set-password db → 由你在对话框输入
安装
Windows x64。远端:任意 POSIX shell。
告诉 agent
它自己装好 xssh 和 skill。
安装 xssh:阅读 https://xssh.io/llms.txt 并照做。或自己装
一行命令,或解压到任意位置。
> irm https://xssh.io/install.ps1 | iex录入密码
你输入一次,agent 只用别名。
> xssh host add web1 --host 10.0.0.5 --user deploy --ask-password
skill 支持 Claude Code · Codex · Gemini CLI · GitHub Copilot · Cursor · OpenCode · Windsurf · Amp · Qwen Code · Kiro · Trae · Roo Code · ~/.agents (Cline…)