Skip to content

Commit 002fed7

Browse files
authored
feat(cli): restructure CLI commands for simpler UX (#156)
1 parent e3ea796 commit 002fed7

25 files changed

Lines changed: 1602 additions & 677 deletions

File tree

‎.agents/skills/debug-navigator-cluster/SKILL.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: debug-navigator-cluster
3-
description: Debug why a nemoclaw cluster failed to start or is unhealthy. Use when the user has a failed `nemoclaw cluster admin deploy`, cluster health check failure, or wants to diagnose cluster infrastructure issues. Trigger keywords - debug cluster, cluster failing, cluster not starting, deploy failed, cluster troubleshoot, cluster health, cluster diagnose, why won't my cluster start, health check failed.
3+
description: Debug why a nemoclaw cluster failed to start or is unhealthy. Use when the user has a failed `nemoclaw gateway start`, cluster health check failure, or wants to diagnose cluster infrastructure issues. Trigger keywords - debug cluster, cluster failing, cluster not starting, deploy failed, cluster troubleshoot, cluster health, cluster diagnose, why won't my cluster start, health check failed, gateway start failed, gateway not starting.
44
---
55

66
# Debug NemoClaw Cluster
77

8-
Diagnose why a nemoclaw cluster failed to start after `nemoclaw cluster admin deploy`.
8+
Diagnose why a nemoclaw cluster failed to start after `nemoclaw gateway start`.
99

1010
## Overview
1111

12-
`nemoclaw cluster admin deploy` creates a Docker container running k3s with the NemoClaw server and Envoy Gateway deployed via Helm. The deployment stages, in order, are:
12+
`nemoclaw gateway start` creates a Docker container running k3s with the NemoClaw server and Envoy Gateway deployed via Helm. The deployment stages, in order, are:
1313

14-
1. **Pre-deploy check**: `nemoclaw cluster admin deploy` in interactive mode prompts to **reuse** (keep volume, clean stale nodes) or **recreate** (destroy everything, fresh start). `mise run cluster` always recreates before deploy.
14+
1. **Pre-deploy check**: `nemoclaw gateway start` in interactive mode prompts to **reuse** (keep volume, clean stale nodes) or **recreate** (destroy everything, fresh start). `mise run cluster` always recreates before deploy.
1515
2. Ensure cluster image is available (local build or remote pull)
1616
3. Create Docker network (`navigator-cluster`) and volume (`navigator-cluster-{name}`)
1717
4. Create and start a privileged Docker container (`navigator-cluster-{name}`)
@@ -31,7 +31,7 @@ For local deploys, metadata endpoint selection now depends on Docker connectivit
3131
- default local Docker socket (`unix:///var/run/docker.sock`): `https://127.0.0.1:{port}` (default port 8080)
3232
- TCP Docker daemon (`DOCKER_HOST=tcp://<host>:<port>`): `https://<host>:{port}` for non-loopback hosts
3333

34-
The host port is configurable via `--port` on `nemoclaw cluster admin deploy` (default 8080) and is stored in `ClusterMetadata.gateway_port`.
34+
The host port is configurable via `--port` on `nemoclaw gateway start` (default 8080) and is stored in `ClusterMetadata.gateway_port`.
3535

3636
The TCP host is also added as an extra gateway TLS SAN so mTLS hostname validation succeeds.
3737

@@ -302,7 +302,7 @@ If DNS is broken, all image pulls from the distribution registry will fail, as w
302302
| Helm install job failed | Chart values error or dependency issue | Check `helm-install-navigator` job logs in `kube-system` |
303303
| Architecture mismatch (remote) | Built on arm64, deploying to amd64 | Cross-build the image for the target architecture |
304304
| SSH connection failed (remote) | SSH key/host/Docker issues | Test `ssh <host> docker ps` manually |
305-
| Port conflict | Another service on 6443 or the configured gateway host port (default 8080) | Stop conflicting service or use `--port` to pick a different host port |
305+
| Port conflict | Another service on 6443 or the configured gateway host port (default 8080) | Stop conflicting service or use `--port` on `nemoclaw gateway start` to pick a different host port |
306306
| gRPC connect refused to `127.0.0.1:443` in CI | Docker daemon is remote (`DOCKER_HOST=tcp://...`) but metadata still points to loopback | Verify metadata endpoint host matches `DOCKER_HOST` and includes non-loopback host |
307307
| DNS failures inside container | Entrypoint DNS detection failed | Check `/etc/rancher/k3s/resolv.conf` and container startup logs |
308308
| `metrics-server` errors in logs | Normal k3s noise, not the root cause | These errors are benign — look for the actual failing health check component |
@@ -331,7 +331,7 @@ docker -H ssh://<host> logs navigator-cluster-<name>
331331
**Setting up kubectl access** (requires tunnel):
332332

333333
```bash
334-
nemoclaw cluster admin tunnel --name <name> --remote <host>
334+
nemoclaw gateway tunnel --name <name> --remote <host>
335335
# Then in another terminal:
336336
export KUBECONFIG=~/.config/nemoclaw/clusters/<name>/kubeconfig
337337
kubectl get pods -A

‎.agents/skills/nemoclaw-cli/SKILL.md‎

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: nemoclaw-cli
3-
description: Guide agents through using the NemoClaw CLI (nemoclaw) for sandbox management, provider configuration, policy iteration, BYOC workflows, and inference routing. Covers basic through advanced multi-step workflows. Trigger keywords - nemoclaw, sandbox create, sandbox connect, sandbox logs, provider create, policy set, policy get, image push, port forward, BYOC, bring your own container, use nemoclaw, run nemoclaw, CLI usage, manage sandbox, manage provider.
3+
description: Guide agents through using the NemoClaw CLI (nemoclaw) for sandbox management, provider configuration, policy iteration, BYOC workflows, and inference routing. Covers basic through advanced multi-step workflows. Trigger keywords - nemoclaw, sandbox create, sandbox connect, logs, provider create, policy set, policy get, image push, forward, port forward, BYOC, bring your own container, use nemoclaw, run nemoclaw, CLI usage, manage sandbox, manage provider, gateway start, gateway select.
44
---
55

66
# NemoClaw CLI
@@ -9,7 +9,7 @@ Guide agents through using the `nemoclaw` CLI for sandbox and platform managemen
99

1010
## Overview
1111

12-
The NemoClaw CLI (`nemoclaw`) is the primary interface for managing sandboxes, providers, policies, inference routes, and clusters. This skill teaches agents how to orchestrate CLI commands for common and complex workflows.
12+
The NemoClaw CLI (`nemoclaw`) is the primary interface for managing sandboxes, providers, policies, inference routes, and gateways. This skill teaches agents how to orchestrate CLI commands for common and complex workflows.
1313

1414
**Companion skill**: For creating or modifying sandbox policy YAML content (network rules, L7 inspection, access presets), use the `generate-sandbox-policy` skill. This skill covers the CLI *commands* for the policy lifecycle; `generate-sandbox-policy` covers policy *content authoring*.
1515

@@ -26,7 +26,7 @@ This is your primary fallback. Use it freely -- the CLI's help output is authori
2626
## Prerequisites
2727

2828
- `nemoclaw` is on the PATH (install via `cargo install --path crates/navigator-cli`)
29-
- Docker is running (required for cluster operations and BYOC)
29+
- Docker is running (required for gateway operations and BYOC)
3030
- For remote clusters: SSH access to the target host
3131

3232
## Command Reference
@@ -42,21 +42,21 @@ Use this workflow when no cluster exists yet and the user wants to get a sandbox
4242
### Step 1: Bootstrap a cluster
4343

4444
```bash
45-
nemoclaw cluster admin deploy
45+
nemoclaw gateway start
4646
```
4747

48-
This provisions a local k3s cluster in Docker. The CLI will prompt interactively if a cluster already exists. The cluster is automatically set as the active cluster.
48+
This provisions a local k3s cluster in Docker. The CLI will prompt interactively if a cluster already exists. The cluster is automatically set as the active gateway.
4949

5050
For remote deployment:
5151

5252
```bash
53-
nemoclaw cluster admin deploy --remote user@host --ssh-key ~/.ssh/id_rsa
53+
nemoclaw gateway start --remote user@host --ssh-key ~/.ssh/id_rsa
5454
```
5555

5656
### Step 2: Verify the cluster
5757

5858
```bash
59-
nemoclaw cluster status
59+
nemoclaw status
6060
```
6161

6262
Confirm the cluster is reachable and shows a version.
@@ -139,14 +139,14 @@ nemoclaw sandbox create \
139139
--provider my-github \
140140
--provider my-claude \
141141
--policy ./my-policy.yaml \
142-
--sync \
142+
--upload .:/sandbox \
143143
-- claude
144144
```
145145

146146
Key flags:
147147
- `--provider`: Attach one or more providers (repeatable)
148148
- `--policy`: Custom policy YAML (otherwise uses built-in default or `NEMOCLAW_SANDBOX_POLICY` env var)
149-
- `--sync`: Push local git-tracked files to `/sandbox` in the container
149+
- `--upload <PATH>[:<DEST>]`: Upload local files into the sandbox (default dest: `/sandbox`)
150150
- `--keep`: Keep sandbox alive after the command exits (useful for non-interactive commands)
151151
- `--forward <PORT>`: Forward a local port (implies `--keep`)
152152

@@ -169,30 +169,30 @@ Opens an interactive SSH shell. To configure VS Code Remote-SSH:
169169
nemoclaw sandbox ssh-config my-sandbox >> ~/.ssh/config
170170
```
171171

172-
### Sync files
172+
### Upload and download files
173173

174174
```bash
175-
# Push local files to sandbox
176-
nemoclaw sandbox sync my-sandbox --up ./src /sandbox/src
175+
# Upload local files to sandbox
176+
nemoclaw sandbox upload my-sandbox ./src /sandbox/src
177177

178-
# Pull files from sandbox
179-
nemoclaw sandbox sync my-sandbox --down /sandbox/output ./local-output
178+
# Download files from sandbox
179+
nemoclaw sandbox download my-sandbox /sandbox/output ./local-output
180180
```
181181

182182
### View logs
183183

184184
```bash
185185
# Recent logs
186-
nemoclaw sandbox logs my-sandbox
186+
nemoclaw logs my-sandbox
187187

188188
# Stream live logs
189-
nemoclaw sandbox logs my-sandbox --tail
189+
nemoclaw logs my-sandbox --tail
190190

191191
# Filter by source and level
192-
nemoclaw sandbox logs my-sandbox --tail --source sandbox --level warn
192+
nemoclaw logs my-sandbox --tail --source sandbox --level warn
193193

194194
# Logs from the last 5 minutes
195-
nemoclaw sandbox logs my-sandbox --since 5m
195+
nemoclaw logs my-sandbox --since 5m
196196
```
197197

198198
### Delete sandboxes
@@ -246,7 +246,7 @@ Use `--keep` so the sandbox stays alive for iteration. The user can work in the
246246
In a separate terminal or as the agent:
247247

248248
```bash
249-
nemoclaw sandbox logs dev --tail --source sandbox
249+
nemoclaw logs dev --tail --source sandbox
250250
```
251251

252252
Look for log lines with `action: deny` -- these indicate blocked network requests. The logs include:
@@ -257,7 +257,7 @@ Look for log lines with `action: deny` -- these indicate blocked network request
257257
### Step 3: Pull the current policy
258258

259259
```bash
260-
nemoclaw sandbox policy get dev --full > current-policy.yaml
260+
nemoclaw policy get dev --full > current-policy.yaml
261261
```
262262

263263
The `--full` flag outputs valid YAML that can be directly re-submitted. This is the round-trip format.
@@ -277,7 +277,7 @@ Only `network_policies` and `inference` sections can be modified at runtime. If
277277
### Step 5: Push the updated policy
278278

279279
```bash
280-
nemoclaw sandbox policy set dev --policy current-policy.yaml --wait
280+
nemoclaw policy set dev --policy current-policy.yaml --wait
281281
```
282282

283283
The `--wait` flag blocks until the sandbox confirms the policy is loaded (polls every second). Exit codes:
@@ -288,7 +288,7 @@ The `--wait` flag blocks until the sandbox confirms the policy is loaded (polls
288288
### Step 6: Verify the update
289289

290290
```bash
291-
nemoclaw sandbox policy list dev
291+
nemoclaw policy list dev
292292
```
293293

294294
Check that the latest revision shows status `loaded`. If `failed`, check the error column for details.
@@ -302,13 +302,13 @@ Return to Step 2. Continue monitoring logs and refining the policy until all req
302302
View all revisions to understand how the policy evolved:
303303

304304
```bash
305-
nemoclaw sandbox policy list dev --limit 50
305+
nemoclaw policy list dev --limit 50
306306
```
307307

308308
Fetch a specific historical revision:
309309

310310
```bash
311-
nemoclaw sandbox policy get dev --rev 3 --full
311+
nemoclaw policy get dev --rev 3 --full
312312
```
313313

314314
---
@@ -335,10 +335,10 @@ When `--from` is specified, the CLI:
335335

336336
```bash
337337
# Foreground (blocks)
338-
nemoclaw sandbox forward start 8080 my-app
338+
nemoclaw forward start 8080 my-app
339339

340340
# Background (returns immediately)
341-
nemoclaw sandbox forward start 8080 my-app -d
341+
nemoclaw forward start 8080 my-app -d
342342
```
343343

344344
The service is now reachable at `localhost:8080`.
@@ -347,10 +347,10 @@ The service is now reachable at `localhost:8080`.
347347

348348
```bash
349349
# List active forwards
350-
nemoclaw sandbox forward list
350+
nemoclaw forward list
351351

352352
# Stop a forward
353-
nemoclaw sandbox forward stop 8080 my-app
353+
nemoclaw forward stop 8080 my-app
354354
```
355355

356356
### Step 4: Iterate
@@ -412,7 +412,7 @@ nemoclaw sandbox ssh-config work-session >> ~/.ssh/config
412412
While the user works, monitor the sandbox logs:
413413

414414
```bash
415-
nemoclaw sandbox logs work-session --tail --source sandbox --level warn
415+
nemoclaw logs work-session --tail --source sandbox --level warn
416416
```
417417

418418
Watch for `deny` actions that indicate the user's work is being blocked by policy.
@@ -421,10 +421,10 @@ Watch for `deny` actions that indicate the user's work is being blocked by polic
421421

422422
When denied actions are observed:
423423

424-
1. Pull current policy: `nemoclaw sandbox policy get work-session --full > policy.yaml`
424+
1. Pull current policy: `nemoclaw policy get work-session --full > policy.yaml`
425425
2. Modify the policy to allow the blocked actions (use `generate-sandbox-policy` skill for content)
426-
3. Push the update: `nemoclaw sandbox policy set work-session --policy policy.yaml --wait`
427-
4. Verify: `nemoclaw sandbox policy list work-session`
426+
3. Push the update: `nemoclaw policy set work-session --policy policy.yaml --wait`
427+
4. Verify: `nemoclaw policy list work-session`
428428

429429
The user does not need to disconnect -- policy updates are hot-reloaded within ~30 seconds (or immediately when using `--wait`, which polls for confirmation).
430430

@@ -472,36 +472,36 @@ nemoclaw cluster inference get
472472

473473
---
474474

475-
## Workflow 8: Cluster Management
475+
## Workflow 8: Gateway Management
476476

477-
### List and switch clusters
477+
### List and switch gateways
478478

479479
```bash
480-
nemoclaw cluster list # See all clusters
481-
nemoclaw cluster use my-cluster # Switch active cluster
482-
nemoclaw cluster status # Verify connectivity
480+
nemoclaw gateway select # See all gateways (no args shows list)
481+
nemoclaw gateway select my-cluster # Switch active gateway
482+
nemoclaw status # Verify connectivity
483483
```
484484
485485
### Lifecycle
486486
487487
```bash
488-
nemoclaw cluster admin deploy # Start local cluster
489-
nemoclaw cluster admin stop # Stop (preserves state)
490-
nemoclaw cluster admin deploy # Restart (reuses state)
491-
nemoclaw cluster admin destroy # Destroy permanently
488+
nemoclaw gateway start # Start local cluster
489+
nemoclaw gateway stop # Stop (preserves state)
490+
nemoclaw gateway start # Restart (reuses state)
491+
nemoclaw gateway destroy # Destroy permanently
492492
```
493493
494494
### Remote clusters
495495
496496
```bash
497497
# Deploy to remote host
498-
nemoclaw cluster admin deploy --remote user@host --ssh-key ~/.ssh/id_rsa --name remote-cluster
498+
nemoclaw gateway start --remote user@host --ssh-key ~/.ssh/id_rsa --name remote-cluster
499499

500500
# Set up kubectl access
501-
nemoclaw cluster admin tunnel --name remote-cluster
501+
nemoclaw gateway tunnel --name remote-cluster
502502

503503
# Get cluster info
504-
nemoclaw cluster admin info --name remote-cluster
504+
nemoclaw gateway info --name remote-cluster
505505
```
506506
507507
---
@@ -520,10 +520,10 @@ The CLI help is always authoritative. If the help output contradicts this skill,
520520
521521
```bash
522522
$ nemoclaw sandbox --help
523-
# Shows: create, get, list, delete, connect, sync, logs, ssh-config, forward, image, policy
523+
# Shows: create, get, list, delete, connect, upload, download, ssh-config, image
524524

525-
$ nemoclaw sandbox sync --help
526-
# Shows: --up, --down flags, positional arguments, usage examples
525+
$ nemoclaw sandbox upload --help
526+
# Shows: positional arguments (name, path, dest), usage examples
527527
```
528528
529529
---
@@ -532,24 +532,27 @@ $ nemoclaw sandbox sync --help
532532
533533
| Task | Command |
534534
|------|---------|
535-
| Deploy local cluster | `nemoclaw cluster admin deploy` |
536-
| Check cluster health | `nemoclaw cluster status` |
535+
| Deploy local cluster | `nemoclaw gateway start` |
536+
| Check cluster health | `nemoclaw status` |
537+
| List/switch gateways | `nemoclaw gateway select [name]` |
537538
| Create sandbox (interactive) | `nemoclaw sandbox create` |
538539
| Create sandbox with tool | `nemoclaw sandbox create -- claude` |
539540
| Create with custom policy | `nemoclaw sandbox create --policy ./p.yaml --keep` |
540541
| Connect to sandbox | `nemoclaw sandbox connect <name>` |
541-
| Stream live logs | `nemoclaw sandbox logs <name> --tail` |
542-
| Pull current policy | `nemoclaw sandbox policy get <name> --full > p.yaml` |
543-
| Push updated policy | `nemoclaw sandbox policy set <name> --policy p.yaml --wait` |
544-
| Policy revision history | `nemoclaw sandbox policy list <name>` |
542+
| Stream live logs | `nemoclaw logs <name> --tail` |
543+
| Pull current policy | `nemoclaw policy get <name> --full > p.yaml` |
544+
| Push updated policy | `nemoclaw policy set <name> --policy p.yaml --wait` |
545+
| Policy revision history | `nemoclaw policy list <name>` |
545546
| Create sandbox from Dockerfile | `nemoclaw sandbox create --from ./Dockerfile --keep` |
546-
| Forward a port | `nemoclaw sandbox forward start <port> <name> -d` |
547+
| Forward a port | `nemoclaw forward start <port> <name> -d` |
548+
| Upload files to sandbox | `nemoclaw sandbox upload <name> <path>` |
549+
| Download files from sandbox | `nemoclaw sandbox download <name> <path>` |
547550
| Create provider | `nemoclaw provider create --name N --type T --from-existing` |
548551
| List providers | `nemoclaw provider list` |
549552
| Configure cluster inference | `nemoclaw cluster inference set --provider P --model M` |
550553
| View cluster inference | `nemoclaw cluster inference get` |
551554
| Delete sandbox | `nemoclaw sandbox delete <name>` |
552-
| Destroy cluster | `nemoclaw cluster admin destroy` |
555+
| Destroy cluster | `nemoclaw gateway destroy` |
553556
| Self-teach any command | `nemoclaw <group> <cmd> --help` |
554557

555558
## Companion Skills

0 commit comments

Comments
 (0)