@fredlackey/cli-proxmox 0.0.1

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.
package/COMMANDS.md ADDED
@@ -0,0 +1,453 @@
1
+ # CLI Commands
2
+
3
+ ## Global Flags
4
+
5
+ `--json` and `--interactive` can be placed before any subcommand to control output format. `--json` forces JSON output (the default when stdout is not a TTY). `--interactive` forces human-friendly output.
6
+
7
+ ## Credential Flags
8
+
9
+ The following flags are accepted by every API-calling subcommand. They are optional if credentials have already been saved via `proxmox configure`.
10
+
11
+ | Flag | Description |
12
+ |---|---|
13
+ | `--base-url <url>` | Proxmox host root URL (e.g. https://pve.example.com:8006) |
14
+ | `--token-id <id>` | Proxmox API token ID (e.g. root@pam!terraform-token) |
15
+ | `--token-secret <secret>` | Proxmox API token secret (UUID) |
16
+ | `--verify-ssl` | Verify the Proxmox TLS certificate (default: false for self-signed) |
17
+
18
+ ## Node Flag
19
+
20
+ `--node <name>` is accepted by all node-scoped commands. It is optional if `defaultNode` is set in the saved config.
21
+
22
+ ---
23
+
24
+ ## Cluster
25
+
26
+ Cluster-wide operations.
27
+
28
+ ### resources
29
+
30
+ List all resources across the cluster (VMs, nodes, storage).
31
+
32
+ ```
33
+ proxmox cluster resources [--type <type>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
34
+ ```
35
+
36
+ | Flag | Required | Description |
37
+ |---|---|---|
38
+ | `--type <type>` | optional | Filter by type: vm, storage, node, sdn |
39
+
40
+ ---
41
+
42
+ ## Configure
43
+
44
+ Write Proxmox credentials to ~/.config/cli-proxmox/config.json. In interactive mode (TTY), missing values are prompted for. In non-interactive mode, flags are required for any value not already saved.
45
+
46
+ ```
47
+ proxmox configure [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--default-node <name>] [--verify-ssl] [--no-verify-ssl]
48
+ ```
49
+
50
+ | Flag | Required | Description |
51
+ |---|---|---|
52
+ | `--base-url <url>` | optional | Proxmox host root URL (e.g. https://pve.example.com:8006) |
53
+ | `--token-id <id>` | optional | Proxmox API token ID (e.g. root@pam!terraform-token) |
54
+ | `--token-secret <secret>` | optional | Proxmox API token secret (UUID) |
55
+ | `--default-node <name>` | optional | Default PVE node name |
56
+ | `--verify-ssl` | optional | Verify TLS cert (default: false for self-signed) |
57
+ | `--no-verify-ssl` | optional | Do not verify TLS cert |
58
+
59
+ ---
60
+
61
+ ## Node
62
+
63
+ Node operations.
64
+
65
+ ### list
66
+
67
+ List all nodes in the Proxmox cluster.
68
+
69
+ ```
70
+ proxmox node list [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
71
+ ```
72
+
73
+ No command-specific flags.
74
+
75
+ ### status
76
+
77
+ Get detailed status of a specific node.
78
+
79
+ ```
80
+ proxmox node status [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
81
+ ```
82
+
83
+ | Flag | Required | Description |
84
+ |---|---|---|
85
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
86
+
87
+ ---
88
+
89
+ ## Snapshot
90
+
91
+ VM snapshot operations.
92
+
93
+ ### list
94
+
95
+ List snapshots for a VM.
96
+
97
+ ```
98
+ proxmox snapshot list --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
99
+ ```
100
+
101
+ | Flag | Required | Description |
102
+ |---|---|---|
103
+ | `--vmid <id>` | **required** | VM ID |
104
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
105
+
106
+ ### create
107
+
108
+ Create a snapshot of a VM.
109
+
110
+ ```
111
+ proxmox snapshot create --vmid <id> --snapname <name> [--description <text>] [--vmstate] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
112
+ ```
113
+
114
+ | Flag | Required | Description |
115
+ |---|---|---|
116
+ | `--vmid <id>` | **required** | VM ID |
117
+ | `--snapname <name>` | **required** | Snapshot name |
118
+ | `--description <text>` | optional | Snapshot description |
119
+ | `--vmstate` | optional | Include RAM state in the snapshot |
120
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
121
+
122
+ ### remove
123
+
124
+ Delete a snapshot from a VM.
125
+
126
+ ```
127
+ proxmox snapshot remove --vmid <id> --snapname <name> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
128
+ ```
129
+
130
+ | Flag | Required | Description |
131
+ |---|---|---|
132
+ | `--vmid <id>` | **required** | VM ID |
133
+ | `--snapname <name>` | **required** | Snapshot name to delete |
134
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
135
+
136
+ ### rollback
137
+
138
+ Rollback a VM to a previous snapshot.
139
+
140
+ ```
141
+ proxmox snapshot rollback --vmid <id> --snapname <name> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
142
+ ```
143
+
144
+ | Flag | Required | Description |
145
+ |---|---|---|
146
+ | `--vmid <id>` | **required** | VM ID |
147
+ | `--snapname <name>` | **required** | Snapshot name to rollback to |
148
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
149
+
150
+ ---
151
+
152
+ ## Storage
153
+
154
+ Storage pool operations.
155
+
156
+ ### list
157
+
158
+ List storage pools on a node.
159
+
160
+ ```
161
+ proxmox storage list [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
162
+ ```
163
+
164
+ | Flag | Required | Description |
165
+ |---|---|---|
166
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
167
+
168
+ ### content
169
+
170
+ List contents of a storage pool (ISOs, disk images, backups, templates).
171
+
172
+ ```
173
+ proxmox storage content --storage <name> [--content <type>] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
174
+ ```
175
+
176
+ | Flag | Required | Description |
177
+ |---|---|---|
178
+ | `--storage <name>` | **required** | Storage pool name |
179
+ | `--content <type>` | optional | Content type filter (iso, images, backup, vztmpl) |
180
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
181
+
182
+ ---
183
+
184
+ ## Task
185
+
186
+ Task operations.
187
+
188
+ ### list
189
+
190
+ List recent tasks on a node.
191
+
192
+ ```
193
+ proxmox task list [--limit <n>] [--source <type>] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
194
+ ```
195
+
196
+ | Flag | Required | Description |
197
+ |---|---|---|
198
+ | `--limit <n>` | optional | Max tasks to return (default: 50) |
199
+ | `--source <type>` | optional | Filter by source (active, archive, all) |
200
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
201
+
202
+ ### get
203
+
204
+ Get status and log of a specific task by UPID.
205
+
206
+ ```
207
+ proxmox task get --upid <upid> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
208
+ ```
209
+
210
+ | Flag | Required | Description |
211
+ |---|---|---|
212
+ | `--upid <upid>` | **required** | Task UPID |
213
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
214
+
215
+ ### wait
216
+
217
+ Wait for a task to complete by polling its UPID.
218
+
219
+ ```
220
+ proxmox task wait --upid <upid> [--timeout <seconds>] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
221
+ ```
222
+
223
+ | Flag | Required | Description |
224
+ |---|---|---|
225
+ | `--upid <upid>` | **required** | Task UPID to wait for |
226
+ | `--timeout <seconds>` | optional | Timeout in seconds (default: 300) |
227
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
228
+
229
+ ---
230
+
231
+ ## VM
232
+
233
+ Virtual machine operations (QEMU).
234
+
235
+ ### list
236
+
237
+ List all QEMU VMs on a node.
238
+
239
+ ```
240
+ proxmox vm list [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
241
+ ```
242
+
243
+ | Flag | Required | Description |
244
+ |---|---|---|
245
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
246
+
247
+ ### get
248
+
249
+ Get the full configuration of a VM.
250
+
251
+ ```
252
+ proxmox vm get --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
253
+ ```
254
+
255
+ | Flag | Required | Description |
256
+ |---|---|---|
257
+ | `--vmid <id>` | **required** | VM ID |
258
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
259
+
260
+ ### start
261
+
262
+ Start a VM.
263
+
264
+ ```
265
+ proxmox vm start --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
266
+ ```
267
+
268
+ | Flag | Required | Description |
269
+ |---|---|---|
270
+ | `--vmid <id>` | **required** | VM ID |
271
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
272
+
273
+ ### stop
274
+
275
+ Force-stop a VM (power off, no graceful ACPI).
276
+
277
+ ```
278
+ proxmox vm stop --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
279
+ ```
280
+
281
+ | Flag | Required | Description |
282
+ |---|---|---|
283
+ | `--vmid <id>` | **required** | VM ID |
284
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
285
+
286
+ ### shutdown
287
+
288
+ Gracefully shut down a VM via ACPI (needs guest agent).
289
+
290
+ ```
291
+ proxmox vm shutdown --vmid <id> [--timeout <seconds>] [--force] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
292
+ ```
293
+
294
+ | Flag | Required | Description |
295
+ |---|---|---|
296
+ | `--vmid <id>` | **required** | VM ID |
297
+ | `--timeout <seconds>` | optional | Seconds to wait before giving up |
298
+ | `--force` | optional | Force-stop if graceful shutdown times out |
299
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
300
+
301
+ ### reboot
302
+
303
+ Reboot a VM.
304
+
305
+ ```
306
+ proxmox vm reboot --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
307
+ ```
308
+
309
+ | Flag | Required | Description |
310
+ |---|---|---|
311
+ | `--vmid <id>` | **required** | VM ID |
312
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
313
+
314
+ ### create
315
+
316
+ Create a new QEMU VM.
317
+
318
+ ```
319
+ proxmox vm create --vmid <id> [--name <name>] [--memory <mb>] [--cores <n>] [--sockets <n>] [--ostype <type>] [--scsi0 <spec>] [--ide2 <spec>] [--net0 <spec>] [--boot <order>] [--agent <0|1>] [--cpu <type>] [--scsihw <type>] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
320
+ ```
321
+
322
+ | Flag | Required | Description |
323
+ |---|---|---|
324
+ | `--vmid <id>` | **required** | VM ID (unique integer) |
325
+ | `--name <name>` | optional | VM name |
326
+ | `--memory <mb>` | optional | Memory in MB (default: 2048) |
327
+ | `--cores <n>` | optional | CPU cores (default: 1) |
328
+ | `--sockets <n>` | optional | CPU sockets (default: 1) |
329
+ | `--ostype <type>` | optional | OS type (default: l26 for Linux) |
330
+ | `--scsi0 <spec>` | optional | SCSI disk (e.g., local-lvm:32) |
331
+ | `--ide2 <spec>` | optional | CD-ROM/ISO (e.g., local:iso/ubuntu.iso,media=cdrom) |
332
+ | `--net0 <spec>` | optional | Network (e.g., virtio,bridge=vmbr0) |
333
+ | `--boot <order>` | optional | Boot order (e.g., order=scsi0;ide2;net0) |
334
+ | `--agent <0\|1>` | optional | QEMU guest agent (0 or 1) |
335
+ | `--cpu <type>` | optional | CPU type (e.g., host, kvm64) |
336
+ | `--scsihw <type>` | optional | SCSI controller (default: virtio-scsi-single) |
337
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
338
+
339
+ ### clone
340
+
341
+ Clone a VM or template to a new VM.
342
+
343
+ ```
344
+ proxmox vm clone --vmid <id> --newid <id> [--name <name>] [--full] [--target <node>] [--storage <name>] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
345
+ ```
346
+
347
+ | Flag | Required | Description |
348
+ |---|---|---|
349
+ | `--vmid <id>` | **required** | Source VM ID to clone from |
350
+ | `--newid <id>` | **required** | New VM ID for the clone |
351
+ | `--name <name>` | optional | Name for the cloned VM |
352
+ | `--full` | optional | Full clone (not linked) |
353
+ | `--target <node>` | optional | Target node (for cross-node clone) |
354
+ | `--storage <name>` | optional | Target storage for full clone |
355
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
356
+
357
+ ### delete
358
+
359
+ Delete a VM.
360
+
361
+ ```
362
+ proxmox vm delete --vmid <id> [--purge] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
363
+ ```
364
+
365
+ | Flag | Required | Description |
366
+ |---|---|---|
367
+ | `--vmid <id>` | **required** | VM ID to delete |
368
+ | `--purge` | optional | Remove from backup/replication jobs too |
369
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
370
+
371
+ ### config
372
+
373
+ Update VM hardware configuration (CPU, memory, network, etc.).
374
+
375
+ ```
376
+ proxmox vm config --vmid <id> [--memory <mb>] [--cores <n>] [--sockets <n>] [--cpu <type>] [--name <name>] [--ostype <type>] [--net0 <spec>] [--net1 <spec>] [--scsi0 <spec>] [--scsi1 <spec>] [--ide2 <spec>] [--boot <order>] [--agent <0|1>] [--onboot <0|1>] [--balloon <mb>] [--scsihw <type>] [--delete <keys>] [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
377
+ ```
378
+
379
+ | Flag | Required | Description |
380
+ |---|---|---|
381
+ | `--vmid <id>` | **required** | VM ID |
382
+ | `--memory <mb>` | optional | Memory in MB |
383
+ | `--cores <n>` | optional | CPU cores |
384
+ | `--sockets <n>` | optional | CPU sockets |
385
+ | `--cpu <type>` | optional | CPU type (e.g., host, kvm64) |
386
+ | `--name <name>` | optional | VM name |
387
+ | `--ostype <type>` | optional | OS type |
388
+ | `--net0 <spec>` | optional | Network interface 0 |
389
+ | `--net1 <spec>` | optional | Network interface 1 |
390
+ | `--scsi0 <spec>` | optional | SCSI disk 0 |
391
+ | `--scsi1 <spec>` | optional | SCSI disk 1 |
392
+ | `--ide2 <spec>` | optional | IDE device 2 (CD-ROM) |
393
+ | `--boot <order>` | optional | Boot order |
394
+ | `--agent <0\|1>` | optional | QEMU guest agent (0 or 1) |
395
+ | `--onboot <0\|1>` | optional | Start on boot (0 or 1) |
396
+ | `--balloon <mb>` | optional | Balloon memory minimum in MB |
397
+ | `--scsihw <type>` | optional | SCSI controller type |
398
+ | `--delete <keys>` | optional | Comma-separated list of settings to delete |
399
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
400
+
401
+ ### resize
402
+
403
+ Resize a VM disk (grow only, works while VM is running).
404
+
405
+ ```
406
+ proxmox vm resize --vmid <id> --disk <name> --size <size> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
407
+ ```
408
+
409
+ | Flag | Required | Description |
410
+ |---|---|---|
411
+ | `--vmid <id>` | **required** | VM ID |
412
+ | `--disk <name>` | **required** | Disk name (e.g., scsi0, virtio0) |
413
+ | `--size <size>` | **required** | New size or delta (e.g., +10G, 50G) |
414
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
415
+
416
+ ### status
417
+
418
+ Get current runtime status of a VM.
419
+
420
+ ```
421
+ proxmox vm status --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
422
+ ```
423
+
424
+ | Flag | Required | Description |
425
+ |---|---|---|
426
+ | `--vmid <id>` | **required** | VM ID |
427
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
428
+
429
+ ### suspend
430
+
431
+ Suspend (pause) a VM to memory.
432
+
433
+ ```
434
+ proxmox vm suspend --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
435
+ ```
436
+
437
+ | Flag | Required | Description |
438
+ |---|---|---|
439
+ | `--vmid <id>` | **required** | VM ID |
440
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
441
+
442
+ ### resume
443
+
444
+ Resume a suspended VM.
445
+
446
+ ```
447
+ proxmox vm resume --vmid <id> [--node <name>] [--base-url <url>] [--token-id <id>] [--token-secret <secret>] [--verify-ssl]
448
+ ```
449
+
450
+ | Flag | Required | Description |
451
+ |---|---|---|
452
+ | `--vmid <id>` | **required** | VM ID |
453
+ | `--node <name>` | optional | Proxmox node name (falls back to configured defaultNode) |
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2026 Fred Lackey
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @fredlackey/cli-proxmox
2
+
3
+ Command-line interface for [Proxmox VE](https://www.proxmox.com/en/proxmox-virtual-environment/overview) node, VM, storage, and snapshot management. JSON output by default so AI agents and scripts can consume it directly, with a human-friendly mode when you're working interactively.
4
+
5
+ ## Install
6
+
7
+ ```
8
+ npm install -g @fredlackey/cli-proxmox
9
+ ```
10
+
11
+ ## Configure
12
+
13
+ ```
14
+ proxmox configure \
15
+ --base-url https://pve.example.com:8006 \
16
+ --token-id 'root@pam!terraform-token' \
17
+ --token-secret <secret> \
18
+ --default-node pm-b
19
+ ```
20
+
21
+ Running `proxmox configure` without flags prompts for each value interactively. Credentials are stored in `~/.config/cli-proxmox/config.json` and that file is the only config source. There are no environment variables to set.
22
+
23
+ TLS certificate verification is disabled by default since Proxmox typically uses self-signed certs. Pass `--verify-ssl` to `configure` if you have a properly signed certificate.
24
+
25
+ ## Usage
26
+
27
+ ```
28
+ proxmox vm list
29
+ proxmox vm clone \
30
+ --vmid 9000 \
31
+ --newid 200 \
32
+ --name web-prod \
33
+ --full
34
+ proxmox snapshot create \
35
+ --vmid 200 \
36
+ --snapname before-upgrade \
37
+ --vmstate
38
+ proxmox storage content --storage local --content iso
39
+ proxmox task wait --upid <upid> --timeout 120
40
+ ```
41
+
42
+ ## Full Command Reference
43
+
44
+ For the complete list of commands and flags, see [COMMANDS.md](COMMANDS.md).
45
+
46
+ ## Output
47
+
48
+ All commands write JSON to stdout by default. When run in an interactive terminal, output switches to a human-friendly format with colors. Use the global `--json` and `--interactive` flags to override the auto-detection.
49
+
50
+ ## Contributing
51
+
52
+ If you find a gap or have a feature request, open an issue or submit a pull request on [GitHub](https://github.com/FredLackeySandbox/cli-proxmox).
53
+
54
+ ## Questions?
55
+
56
+ If you have questions, comments, or just want to talk shop, feel free to reach out.
57
+
58
+ Fred Lackey
59
+ [fred.lackey@gmail.com](mailto:fred.lackey@gmail.com)
60
+ [https://fredlackey.com](https://fredlackey.com)
61
+
62
+ ## License
63
+
64
+ Apache-2.0
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@fredlackey/cli-proxmox",
3
+ "version": "0.0.1",
4
+ "description": "AI-first CLI for managing Proxmox VE nodes, VMs, storage, and snapshots",
5
+ "author": {
6
+ "name": "Fred Lackey",
7
+ "email": "fred.lackey@gmail.com",
8
+ "url": "https://fredlackey.com"
9
+ },
10
+ "license": "Apache-2.0",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+ssh://git@github.com/FredLackeySandbox/cli-proxmox.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/FredLackeySandbox/cli-proxmox/issues"
17
+ },
18
+ "homepage": "https://github.com/FredLackeySandbox/cli-proxmox#readme",
19
+ "keywords": [
20
+ "proxmox",
21
+ "proxmox-ve",
22
+ "virtual-machines",
23
+ "infrastructure",
24
+ "cli",
25
+ "ai-first",
26
+ "json"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "type": "module",
32
+ "bin": {
33
+ "proxmox": "./src/bin/proxmox.js"
34
+ },
35
+ "scripts": {
36
+ "start": "node src/bin/proxmox.js"
37
+ },
38
+ "dependencies": {
39
+ "axios": "^1.7.0",
40
+ "chalk": "^5.3.0",
41
+ "commander": "^12.0.0"
42
+ }
43
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { cli } from '../index.js';
3
+
4
+ cli(process.argv);
@@ -0,0 +1,54 @@
1
+ /**
2
+ * `proxmox cluster` subcommands: resources.
3
+ *
4
+ * Cluster-level operations that span all nodes. These commands accept
5
+ * the standard credential flags but do not require --node.
6
+ */
7
+
8
+ import { Command } from 'commander';
9
+ import { getRuntime } from '../utils/runtime.js';
10
+ import { createOutput } from '../utils/output.js';
11
+ import { resolveCredentials } from '../utils/config.js';
12
+ import { createProxmoxClient, withCredentialOptions } from '../utils/proxmox-client.js';
13
+
14
+ export function clusterCommand() {
15
+ const cmd = new Command('cluster');
16
+ cmd.description('Cluster-wide operations');
17
+
18
+ // ── resources ────────────────────────────────────────────────────
19
+ withCredentialOptions(
20
+ cmd.command('resources')
21
+ .description('List all resources across the cluster (VMs, nodes, storage)')
22
+ .option('--type <type>', 'Filter by type: vm, storage, node, sdn')
23
+ ).action(async (opts) => {
24
+ const runtime = getRuntime();
25
+ const out = createOutput(runtime);
26
+ const creds = resolveCredentials(opts);
27
+ const client = createProxmoxClient(creds);
28
+
29
+ const params = opts.type ? { type: opts.type } : undefined;
30
+ const data = await client.get('cluster/resources', params);
31
+ const list = Array.isArray(data) ? data : [];
32
+
33
+ out.heading('Cluster resources');
34
+ if (runtime.interactive) {
35
+ if (!list.length) {
36
+ out.dim('(no resources)');
37
+ } else {
38
+ for (const r of list) {
39
+ const type = (r.type || '').padEnd(10);
40
+ const id = (r.id || '').padEnd(20);
41
+ const status = (r.status || '').padEnd(8);
42
+ const node = r.node || '-';
43
+ out.info(`${type} ${id} ${status} node=${node}`);
44
+ }
45
+ out.dim(`${list.length} resource(s)`);
46
+ }
47
+ }
48
+ out.set('resources', list);
49
+ out.set('total', list.length);
50
+ out.flush();
51
+ });
52
+
53
+ return cmd;
54
+ }