srvgov-cli 0.3.0 → 0.5.0

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 +48 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -28,6 +28,7 @@ srvgov ports -o json
28
28
  srvgov logs --unit sshd --since "1 hour ago" --lines 50 -o json
29
29
  srvgov svc status sshd -o json
30
30
  srvgov file stat /etc/hosts -o json
31
+ srvgov docker list -o json
31
32
  srvgov exec --dry-run "uptime" -o json
32
33
  srvgov exec "uptime" -o json
33
34
  srvgov audit query --limit 20 -o json
@@ -84,6 +85,7 @@ The observation commands turn common read-only SSH output into stable JSON:
84
85
  ```bash
85
86
  srvgov status -o json
86
87
  srvgov ports -o json
88
+ srvgov status --targets web-a,web-b --concurrency 5 -o json
87
89
  srvgov logs --unit nginx --since "30 minutes ago" --priority warning --lines 100 -o json
88
90
  srvgov logs --file /var/log/nginx/error.log --grep "upstream" --lines 100 -o json
89
91
  ```
@@ -95,6 +97,24 @@ operators. `ports` falls back from `ss` to `netstat`. Unit logs fall back from
95
97
  adds `sudo`; unavailable PID/process fields remain empty. Log text, process
96
98
  names, generated command text, caller output, and audit records are redacted.
97
99
 
100
+ ### Read-only fleet fanout
101
+
102
+ `status`, `ports`, and `exec` accept comma-separated context names:
103
+
104
+ ```bash
105
+ srvgov status --targets web-a,web-b,web-c --concurrency 5 -o json
106
+ srvgov ports --targets web-a,web-b,web-c -o json
107
+ srvgov exec --targets web-a,web-b,web-c "uptime" -o json
108
+ ```
109
+
110
+ Fanout is deliberately R0-only in v1. Before any SSH connection, srvgov
111
+ classifies the command and computes effective risk for every target. If any
112
+ target is above R0, the entire fanout is rejected; there is no multi-target
113
+ ticket or allow flow. Targets are deduplicated and sorted, each target is
114
+ audited independently, and one failed host does not stop the others. Any
115
+ per-target failure returns exit code 7 after emitting the complete result.
116
+ `--targets` and `--context` are mutually exclusive.
117
+
98
118
  ## Service Control
99
119
 
100
120
  `svc` exposes only a fixed service-operation whitelist. Unit names are treated
@@ -144,6 +164,34 @@ file content; audit stores only the redacted path, byte count, and SHA-256.
144
164
  Writes are direct and non-atomic; temporary-file plus rename is not implemented
145
165
  in this release. `file` never uses SFTP and never adds `sudo`.
146
166
 
167
+ ## Docker Governance
168
+
169
+ Docker reads provide stable, redacted structures:
170
+
171
+ ```bash
172
+ srvgov docker list -o json
173
+ srvgov docker inspect api -o json
174
+ srvgov docker logs api --tail 100 -o json
175
+ ```
176
+
177
+ `docker list`, `inspect`, and `logs` are audited R0 operations. Inspect uses a
178
+ remote fixed-field projection and excludes container environment variables and
179
+ the full inspect document. Logs default to 100 lines and accept `--tail`
180
+ between 1 and 10000.
181
+
182
+ Lifecycle changes are R2 and require human authorization:
183
+
184
+ ```bash
185
+ srvgov docker restart api \
186
+ --reason "restart after reviewed deployment" --ticket OPS-123 --yes -o json
187
+ ```
188
+
189
+ The fixed whitelist contains only `ps`/`list`, `inspect`, `logs`, `start`,
190
+ `stop`, `restart`, and `rm`, one container at a time. It never exposes Docker
191
+ run, create, exec, build, copy, compose, or prune. Protected contexts raise
192
+ lifecycle changes to R3 and require human-supplied `--allow-destructive`.
193
+ Container identifiers are shell-quoted.
194
+
147
195
  ## Governed Execution
148
196
 
149
197
  Preview without connecting or executing:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "srvgov-cli",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Governed remote server command execution CLI for AI agents",
5
5
  "bin": {
6
6
  "srvgov": "bin/srvgov-cli.js",