ssh-cli

Solid

Execute commands and manage files on remote machines over SSH via a zero-dependency Node CLI (ssh-cli.js). Use when the user needs to run commands, read/write/edit files, or diagnose connectivity on a remote host, or asks for anything "on the server / remote machine / dev box".

Data & Documents 154 stars 31 forks Updated 2 days ago Apache-2.0

Install

View on GitHub

Quality Score: 88/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# SSH CLI 通过系统 `ssh` 二进制操作远程机器。单文件零依赖 CLI,无需安装任何东西: ``` node .claude/skills/ssh-cli/scripts/ssh-cli.js <子命令> ... ``` ## 子命令 | 子命令 | 用途 | 示例 | | --- | --- | --- | | `exec` | 远程执行命令(支持管道/&&/重定向) | `exec dev-server "cd /app && npm test"` | | `read` | 读远程文本文件(可只读行区间) | `read dev-server /etc/hosts --offset 5 --limit 10` | | `write` | 写/追加远程文件 | `write dev-server /app/.env "KEY=value"`(追加加 `--append`,长内容用 `--stdin`) | | `edit` | 精确替换(old_string 必须唯一,多匹配加 `--all`) | `edit dev-server /app/main.js "old" "new"` | | `ls` | 目录列表 | `ls dev-server /app` | | `push` | 本地上传远程(scp,`--recursive` 传目录) | `push ./dist dev-server /srv/app/dist` | | `pull` | 远程下载本地(scp) | `pull dev-server /var/log/app.log ./app.log` | | `test` | 连接诊断(主机名/系统/连通性) | `test dev-server` | ## 交互模式(推荐) ��续操作同一台主机时,直接 `ssh-cli <host>` 进入主机上下文,之后只敲子命令(host 自动带入),`exit` 或 Ctrl-D 退出: ```bash node .claude/skills/ssh-cli/scripts/ssh-cli.js dev-server # dev-server> exec "cd /app && npm test" # dev-server> read /etc/hosts --limit 10 # dev-server> push ./dist /srv/app/dist --recursive # dev-server> pull /var/log/app.log ./app.log # dev-server> exit ``` 交互模式下 `push`/`pull` 省略 host:`push <local> <remote>`、`pull <remote> <local>`;其余子命令参数与单次调用一致。所有命令照常受白名单/审计约束。 ## 参数约定 - `host`:`user@host` 或 `~/.ssh/config` 别名;凭据只走系统 ssh(config/agent/key),**密码不进入脚本**(需要账号密码的机器先 `ssh-copy-id`) - 全局选项:`--hosts <白名单>`(逗号分隔,`*` 放行所有;不传默认放行)、`--timeout <ms>`、`--port <n>`、`--key <path>`、`--audit-log <path>` - 环境变量:`SSH_CLI_ALLOWED_HOSTS` / `SSH_CLI...

Details

Author
KonghaYao
Repository
KonghaYao/peri
Created
5 months ago
Last Updated
2 days ago
Language
Rust
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category