@zicolasjac-ai/remote-readonly-ssh 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +26 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -11,35 +11,42 @@
11
11
  - **零依赖**:只依赖系统自带 `ssh` 客户端,无 npm 依赖树。
12
12
  - **AI Agent 友好**:附带 SKILL.md 可一键安装到 opencode / Claude / Cursor / Windsurf / Codex / OpenHands 等 AI 助手的 skills 目录。
13
13
 
14
- ## 安装
14
+ ## 开始使用
15
+
16
+ 一行命令搞定(推荐):
15
17
 
16
18
  ```bash
17
- npm install -g @zicolasjac-ai/remote-readonly-ssh
19
+ npx -y @zicolasjac-ai/remote-readonly-ssh@latest init
18
20
  ```
19
21
 
20
- 要求 Node.js >= 18,系统已装 OpenSSH 客户端(Windows 10+ / Linux / macOS 自带)。
21
-
22
- > **npx 一行命令**:`npx -y @zicolasjac-ai/remote-readonly-ssh init` 也可直接启动初始化向导(无需先 `npm install`)。
23
- >
24
- > 从旧包名 `remote-readonly-ssh`(v1.0.0)升级的用户,请先 `npm uninstall -g remote-readonly-ssh` 再安装,否则会报 `EEXIST: file already exists`。
22
+ npx 会自动拉取最新版本、进入初始化向导,依次询问:
25
23
 
26
- > **postinstall 自动引导**:全局安装完成后,TTY 环境下会自动进入初始化向导;非交互式安装(如 CI)会打印三行下一步提示,不会阻塞安装。
24
+ 1. 是否覆盖已有 `~/.rrs/config.json`(首次安装跳过此步)
25
+ 2. 堡垒机主机 / 端口 / 用户名 / SSH 私钥路径
26
+ 3. 目标主机白名单(每行 `ip=堡垒机搜索关键字`)
27
+ 4. 是否把 SKILL.md 安装到 opencode / Claude Code / Cursor 等 AI 助手
27
28
 
28
- ## 快速开始
29
+ 向导结束后 `~/.rrs/config.json` 已就位、`~/.rrs/audit.log` 已建好、AI skill 已分发。直接试跑:
29
30
 
30
31
  ```bash
31
- npm install -g @zicolasjac-ai/remote-readonly-ssh # 装完自动进向导
32
- # 或 npx -y @zicolasjac-ai/remote-readonly-ssh init
32
+ npx -y @zicolasjac-ai/remote-readonly-ssh@latest sys-info --json
33
33
  ```
34
34
 
35
- 向导会依次询问:
35
+ ### 反复使用?装到全局
36
36
 
37
- 1. 是否覆盖已有 `~/.rrs/config.json`(首次安装跳过此步)
38
- 2. 堡垒机主机 / 端口 / 用户名 / SSH 私钥路径
39
- 3. 目标主机白名单(每行 `ip=堡垒机搜索关键字`)
40
- 4. 是否把 SKILL.md 安装到 opencode / Claude / Cursor 等 AI 助手
37
+ 每次调用都 `npx` 较慢(需下载/缓存)。如果要把 `rrs` 作为日常命令长期使用:
38
+
39
+ ```bash
40
+ npm install -g @zicolasjac-ai/remote-readonly-ssh
41
+ rrs init # TTY 下仍是交互向导;非交互环境只生成配置模板
42
+ rrs sys-info --json # 直接用 rrs 前缀
43
+ ```
41
44
 
42
- 向导非交互式环境(CI、管道)会静默生成配置模板,不阻塞安装。
45
+ > **postinstall 自动引导**:`npm install -g` 完成后,TTY 环境会自动进入向导;非交互环境(如 CI)只打印三行下一步提示,不阻塞安装。
46
+ >
47
+ > 从旧包名 `remote-readonly-ssh`(v1.0.0)升级的用户,请先 `npm uninstall -g remote-readonly-ssh` 再安装,否则会报 `EEXIST: file already exists`。
48
+
49
+ 要求 Node.js >= 18,系统已装 OpenSSH 客户端(Windows 10+ / Linux / macOS 自带)。
43
50
 
44
51
  ## 用法
45
52
 
@@ -51,7 +58,7 @@ rrs <tool> [arg] [--host <ip>] [--config <file>] [--json]
51
58
 
52
59
  | 工具 | 说明 |
53
60
  |------|------|
54
- | `init` | 生成配置模板 `~/.rrs/config.json` |
61
+ | `init` | 启动初始化向导(TTY 交互) / 静默生成配置模板(非 TTY) |
55
62
  | `list-tools` | 查看工具、白名单、配置路径 |
56
63
  | `sys-info` | 主机名 / 系统版本 / 内核 / 运行时间 |
57
64
  | `proc <pattern>` | 进程查询(严格字符校验,防注入) |
@@ -92,6 +99,7 @@ rrs <tool> [arg] [--host <ip>] [--config <file>] [--json]
92
99
 
93
100
  ```bash
94
101
  rrs setup skills # 安装到全部三类目录
102
+ npx -y @zicolasjac-ai/remote-readonly-ssh@latest setup skills # 全局未装时用 npx
95
103
  rrs setup skills --agent opencode # 只写 opencode
96
104
  rrs setup skills --dry-run # 仅预览目标路径
97
105
  rrs setup uninstall skills # 从全部目录移除
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zicolasjac-ai/remote-readonly-ssh",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "只读 SSH 运维 CLI 与 Agent Skill:通过 JumpServer 堡垒机白名单强制执行只读查询;附 SKILL.md 让 opencode / Claude Code / Cursor 等 AI 助手自动发现并正确调用。",
5
5
  "license": "MIT",
6
6
  "bin": {