Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions docs/manage-sandboxes/lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,21 @@ To remove NemoClaw and all resources created during setup, run the CLI's built-i
$$nemoclaw uninstall
```

| Flag | Effect |
|--------------------|------------------------------------------------------|
| `--yes` | Skip the confirmation prompt. |
| `--keep-openshell` | Leave OpenShell binaries installed. |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models. |
| Flag | Effect |
|-----------------------|---------------------------------------------------------------------------------------------------------|
| `--yes` | Skip all confirmation prompts and remove preserved user data; pair with `--keep-user-data` to preserve. |
| `--keep-openshell` | Leave OpenShell binaries installed. |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models. |
| `--destroy-user-data` | Remove preserved user data (`rebuild-backups/`, `backups/`, `sandboxes.json`) without requiring `--yes`.|
| `--keep-user-data` | Preserve `rebuild-backups/`, `backups/`, and `sandboxes.json` under `~/.nemoclaw/` even with `--yes`. |
| `--gateway <name>` | Override the gateway name to remove (default: `nemoclaw`). |

<Note>
The uninstall command preserves `~/.nemoclaw/rebuild-backups/` (host-side snapshots that snapshot and `backup-all` commands write), `~/.nemoclaw/backups/` (workspace backups that `scripts/backup-workspace.sh` writes), and `~/.nemoclaw/sandboxes.json` (the sandbox registry) by default.
The uninstall command treats `~/.nemoclaw/rebuild-backups/` (host-side snapshots that snapshot and `backup-all` commands write), `~/.nemoclaw/backups/` (workspace backups that `scripts/backup-workspace.sh` writes), and `~/.nemoclaw/sandboxes.json` (the sandbox registry) as preserve-able user data.
Uninstall removes every other entry under `~/.nemoclaw/`.
Interactive runs prompt before they remove the preserved entries; the default answer keeps them.
For non-interactive runs (`--yes`, `NEMOCLAW_NON_INTERACTIVE=1`, or a non-TTY shell), set `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1` to acknowledge data loss and remove the preserved entries as well.
Non-interactive runs treat `--yes` as acknowledgement of every prompt, including the data-loss prompt: `--yes` removes the preserved entries. Pass `--keep-user-data` alongside `--yes` to retain them.
On a non-TTY shell or with `NEMOCLAW_NON_INTERACTIVE=1` but no `--yes`, the preserved entries are kept by default; pass `--destroy-user-data` (or set `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1`) to remove them.
See the [Commands reference](../reference/commands#$$nemoclaw-uninstall) for the full preservation contract.
</Note>

Expand All @@ -272,7 +276,7 @@ If the CLI is missing or broken, fall back to the hosted script:
curl -fsSL https://raw.githubusercontent.com/NVIDIA/NemoClaw/refs/heads/main/uninstall.sh | bash
```

The same `--yes`, `--keep-openshell`, and `--delete-models` flags listed above also apply to the hosted script. Pass them after `bash -s --`.
The same `--yes`, `--keep-openshell`, `--delete-models`, `--destroy-user-data`, `--keep-user-data`, and `--gateway` flags listed above also apply to the hosted script. Pass them after `bash -s --`.

```bash
curl -fsSL https://raw.githubusercontent.com/NVIDIA/NemoClaw/refs/heads/main/uninstall.sh | bash -s -- --yes --delete-models
Expand Down
16 changes: 11 additions & 5 deletions docs/reference/commands-nemohermes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1610,13 +1610,15 @@ On Linux, uninstall removes `~/.local/state/nemoclaw`, which contains Docker-dri

| Flag | Effect |
|---|---|
| `--yes` | Skip the confirmation prompt |
| `--yes` | Skip all confirmation prompts and remove preserved user data; pair with `--keep-user-data` to preserve |
| `--keep-openshell` | Leave OpenShell binaries installed |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models |
| `--destroy-user-data` | Remove preserved user data (`rebuild-backups/`, `backups/`, `sandboxes.json`) without requiring `--yes` |
| `--keep-user-data` | Preserve `rebuild-backups/`, `backups/`, and `sandboxes.json` under `~/.nemoclaw/` even with `--yes` |
| `--gateway <name>` | Override the gateway name to remove (default: `nemohermes`) |

```bash
nemohermes uninstall [--yes] [--keep-openshell] [--delete-models] [--gateway <name>]
nemohermes uninstall [--yes] [--keep-openshell] [--delete-models] [--destroy-user-data] [--keep-user-data] [--gateway <name>]
```

##### User-data preservation under `~/.nemoclaw/`
Expand All @@ -1635,9 +1637,13 @@ Decision matrix:

| Context | Behaviour |
|---|---|
| Interactive TTY, preserved entries present, no env override | Prompts `Also remove them? [y/N]`. Default `N` keeps the entries. |
| Interactive TTY, user answers `y` | Removes everything under `~/.nemoclaw/` (the previous full-removal behaviour). |
| Non-interactive (`--yes`, `NEMOCLAW_NON_INTERACTIVE=1`, or non-TTY shell) | Preserves the entries and prints a one-line notice. |
| Interactive TTY, preserved entries present, no flag override | Prompts `Also remove them? [y/N]`. Default `N` keeps the entries. |
| Interactive TTY, user answers `y` | Removes everything under `~/.nemoclaw/`. |
| `--yes` (any context) | Acknowledges every prompt, including the data-loss prompt; removes everything under `~/.nemoclaw/`. |
| `--yes --keep-user-data` (any context) | Acknowledges the uninstall but preserves the listed entries under `~/.nemoclaw/`. |
| Non-interactive (`NEMOCLAW_NON_INTERACTIVE=1` or non-TTY shell) without `--yes` | Preserves the entries and prints a one-line notice. |
| Any context with `--destroy-user-data` | Skips the prompt and removes everything under `~/.nemoclaw/`. Takes precedence over the env var. |
| Any context with `--keep-user-data` | Skips the prompt and preserves the listed entries. Takes precedence over `--destroy-user-data`, `--yes`, and the env var. |
| Any context with `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1` | Skips the prompt and removes everything under `~/.nemoclaw/`. |

The preserved entries survive uninstall as inert files on disk.
Expand Down
16 changes: 11 additions & 5 deletions docs/reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1949,13 +1949,15 @@ On Linux, uninstall removes `~/.local/state/nemoclaw`, which contains Docker-dri

| Flag | Effect |
|---|---|
| `--yes` | Skip the confirmation prompt |
| `--yes` | Skip all confirmation prompts and remove preserved user data; pair with `--keep-user-data` to preserve |
| `--keep-openshell` | Leave OpenShell binaries installed |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models |
| `--destroy-user-data` | Remove preserved user data (`rebuild-backups/`, `backups/`, `sandboxes.json`) without requiring `--yes` |
| `--keep-user-data` | Preserve `rebuild-backups/`, `backups/`, and `sandboxes.json` under `~/.nemoclaw/` even with `--yes` |
| `--gateway <name>` | Override the gateway name to remove (default: `$$nemoclaw`) |

```bash
$$nemoclaw uninstall [--yes] [--keep-openshell] [--delete-models] [--gateway <name>]
$$nemoclaw uninstall [--yes] [--keep-openshell] [--delete-models] [--destroy-user-data] [--keep-user-data] [--gateway <name>]
```

##### User-data preservation under `~/.nemoclaw/`
Expand All @@ -1974,9 +1976,13 @@ Decision matrix:

| Context | Behaviour |
|---|---|
| Interactive TTY, preserved entries present, no env override | Prompts `Also remove them? [y/N]`. Default `N` keeps the entries. |
| Interactive TTY, user answers `y` | Removes everything under `~/.nemoclaw/` (the previous full-removal behaviour). |
| Non-interactive (`--yes`, `NEMOCLAW_NON_INTERACTIVE=1`, or non-TTY shell) | Preserves the entries and prints a one-line notice. |
| Interactive TTY, preserved entries present, no flag override | Prompts `Also remove them? [y/N]`. Default `N` keeps the entries. |
| Interactive TTY, user answers `y` | Removes everything under `~/.nemoclaw/`. |
| `--yes` (any context) | Acknowledges every prompt, including the data-loss prompt; removes everything under `~/.nemoclaw/`. |
| `--yes --keep-user-data` (any context) | Acknowledges the uninstall but preserves the listed entries under `~/.nemoclaw/`. |
| Non-interactive (`NEMOCLAW_NON_INTERACTIVE=1` or non-TTY shell) without `--yes` | Preserves the entries and prints a one-line notice. |
| Any context with `--destroy-user-data` | Skips the prompt and removes everything under `~/.nemoclaw/`. Takes precedence over the env var. |
| Any context with `--keep-user-data` | Skips the prompt and preserves the listed entries. Takes precedence over `--destroy-user-data`, `--yes`, and the env var. |
| Any context with `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1` | Skips the prompt and removes everything under `~/.nemoclaw/`. |

The preserved entries survive uninstall as inert files on disk.
Expand Down
22 changes: 18 additions & 4 deletions src/commands/internal/uninstall/run-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@
// SPDX-License-Identifier: Apache-2.0

import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

import { runUninstallPlan } from "../../../lib/actions/uninstall/run-plan";
import { CLI_DISPLAY_NAME, CLI_NAME } from "../../../lib/cli/branding";
import { NemoClawCommand } from "../../../lib/cli/nemoclaw-oclif-command";

export default class InternalUninstallRunPlanCommand extends NemoClawCommand {
static hidden = true;
static strict = true;
static summary = `${CLI_DISPLAY_NAME} Uninstaller`;
static description = `Remove host-side ${CLI_DISPLAY_NAME} resources.`;
static usage = ["internal uninstall run-plan [--yes] [--keep-openshell] [--delete-models]"];
static usage = [
"internal uninstall run-plan [--yes] [--keep-openshell] [--delete-models] [--destroy-user-data] [--keep-user-data]",
];
static examples = [`${CLI_NAME} internal uninstall run-plan --yes`];
static flags = {
yes: Flags.boolean({ description: "Skip the confirmation prompt" }),
yes: Flags.boolean({
description:
"Skip the confirmation prompts; removes preserved ~/.nemoclaw/ user data unless --keep-user-data is also passed",
}),
"keep-openshell": Flags.boolean({ description: "Leave the openshell binary installed" }),
"delete-models": Flags.boolean({
description: `Remove ${CLI_DISPLAY_NAME}-pulled Ollama models`,
}),
"destroy-user-data": Flags.boolean({
description:
"Also remove preserved user data under ~/.nemoclaw/ (rebuild-backups/, backups/, sandboxes.json)",
}),
"keep-user-data": Flags.boolean({
description:
"Preserve user data under ~/.nemoclaw/ (rebuild-backups/, backups/, sandboxes.json) even with --yes",
}),
gateway: Flags.string({ description: "Gateway name", default: "nemoclaw" }),
};

Expand All @@ -28,8 +40,10 @@ export default class InternalUninstallRunPlanCommand extends NemoClawCommand {
const result = runUninstallPlan({
assumeYes: flags.yes ?? false,
deleteModels: flags["delete-models"] ?? false,
destroyUserData: flags["destroy-user-data"] ?? false,
gatewayName: flags.gateway,
keepOpenShell: flags["keep-openshell"] ?? false,
keepUserData: flags["keep-user-data"] ?? false,
});
this.applyExitResult(result);
}
Expand Down
12 changes: 10 additions & 2 deletions src/lib/actions/root-help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import { AGENT_PRODUCT_NAME, CLI_DISPLAY_NAME, CLI_NAME } from "../cli/branding";
import {
brandedPublicText,
type CommandDef,
commandsByGroup,
visibleCommands,
type CommandDef,
} from "../cli/command-registry";
import { getRegisteredOclifCommandSummary } from "../cli/oclif-metadata";
import { getVersion } from "../core/version";
Expand Down Expand Up @@ -73,9 +73,17 @@ export function help(): void {

lines.push("");
lines.push(` ${G}Uninstall flags:${R}`);
lines.push(` --yes${" ".repeat(29)}Skip the confirmation prompt`);
lines.push(
` --yes${" ".repeat(29)}Skip prompts and remove preserved ~/.nemoclaw/ user data (use --keep-user-data to preserve)`,
);
lines.push(` --keep-openshell${" ".repeat(18)}Leave the openshell binary installed`);
lines.push(` --delete-models${" ".repeat(19)}Remove ${CLI_DISPLAY_NAME}-pulled Ollama models`);
lines.push(
` --destroy-user-data${" ".repeat(15)}Remove preserved ~/.nemoclaw/ user data (rebuild-backups/, backups/, sandboxes.json)`,
);
lines.push(
` --keep-user-data${" ".repeat(18)}Preserve ~/.nemoclaw/ user data even with --yes`,
);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

lines.push("");
lines.push(` ${G}Reconfiguration (after onboard):${R}`);
Expand Down
Loading
Loading