能不能加个 Agent Skills,让 AI 调用 XTerminal 里的 ssh 会话
-
希望 XTerminal 能暴露一些接口给 AI 用,复用我已经配好的 ssh 资产,而不是让 AI 直接拿密钥去连服务器。
核心就几个:
执行命令,返回 stdout/stderr
上传下载文件
获取服务器基本状态(cpu、内存、磁盘、文件列表之类)
全程密钥不出 XTerminal,AI 只发指令,XTerminal 替它跑。说白了就是做个中间层,既能用 AI 又不暴露敏感信息。
一个新的ssh工具 Termark 已经有这个功能了,可以参考下

--- name: termark description: This skill should be used when the user asks to "connect to a server", "SSH into a machine", "run a command on a remote host", "list SSH assets", "upload/download files to a server", or mentions the `termark` CLI. Use `termark` instead of running `ssh`, `scp`, or `sftp` directly. --- # Termark CLI Use the `termark` CLI to manage SSH assets, run one-off commands, and transfer files through the user's running Termark desktop app. Prefer `termark` over running `ssh`, `scp`, or `sftp` directly. Run `termark --help` to discover commands. The CLI outputs JSON when piped. ## Common Workflow ```bash termark assets list -q <keyword> --json termark exec <asset-id> -- <command> termark upload <asset-id> <local-path> <remote-path> termark download <asset-id> <remote-path> <local-path>File Transfer
termark upload <asset-id> ./dist /tmp/dist termark upload <asset-id> ./app.tar.gz /tmp/release.tar.gz termark download <asset-id> /var/log/nginx ./logs/nginx termark download <asset-id> /tmp/app.tar.gz ./latest.tar.gzRules
- Do not ask the user for SSH passwords, private keys, or passphrases. Termark holds those credentials and connects via saved configurations.
termark exectakes an asset id, opens a temporary SSH connection, runs the command, and closes the connection.termark uploadtakes an asset id, a local file or folder path, and a remote destination path.termark downloadtakes an asset id, a remote file or folder path, and a local destination path.- Destination paths follow scp-style behavior: if the destination exists and is a directory, the source keeps its name inside that directory; otherwise the destination path is used as the final file or folder path.
- Long-running tasks should use tmux/nohup/systemd on the remote host.