Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
16 changes: 9 additions & 7 deletions docs/manage-sandboxes/lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,19 @@ 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 the confirmation prompt. |
| `--keep-openshell` | Leave OpenShell binaries installed. |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models. |
| `--destroy-user-data` | Also remove preserved user data (`rebuild-backups/`, `backups/`, `sandboxes.json`). |
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
| `--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.
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.
For non-interactive runs (`--yes`, `NEMOCLAW_NON_INTERACTIVE=1`, or a non-TTY shell), pass `--destroy-user-data` (or set `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1`) to acknowledge data loss and remove the preserved entries as well.
See the [Commands reference](../reference/commands#$$nemoclaw-uninstall) for the full preservation contract.
</Note>

Expand All @@ -272,7 +274,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`, 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
4 changes: 3 additions & 1 deletion docs/reference/commands-nemohermes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1613,10 +1613,11 @@ On Linux, uninstall removes `~/.local/state/nemoclaw`, which contains Docker-dri
| `--yes` | Skip the confirmation prompt |
| `--keep-openshell` | Leave OpenShell binaries installed |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models |
| `--destroy-user-data` | Also remove preserved user data (`rebuild-backups/`, `backups/`, `sandboxes.json`) |
| `--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] [--gateway <name>]
```

##### User-data preservation under `~/.nemoclaw/`
Expand All @@ -1638,6 +1639,7 @@ Decision matrix:
| 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. |
| Any context with `--destroy-user-data` | Skips the prompt and removes everything under `~/.nemoclaw/`. Takes precedence over 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 @@ -1961,13 +1961,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 @@ -1986,9 +1988,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
12 changes: 9 additions & 3 deletions src/commands/internal/uninstall/run-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@
// 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]",
];
static examples = [`${CLI_NAME} internal uninstall run-plan --yes`];
static flags = {
yes: Flags.boolean({ description: "Skip the confirmation prompt" }),
"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)",
}),
gateway: Flags.string({ description: "Gateway name", default: "nemoclaw" }),
};

Expand All @@ -28,6 +33,7 @@ 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,
});
Expand Down
5 changes: 4 additions & 1 deletion 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 @@ -76,6 +76,9 @@ export function help(): void {
lines.push(` --yes${" ".repeat(29)}Skip the confirmation prompt`);
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("");
lines.push(` ${G}Reconfiguration (after onboard):${R}`);
Expand Down
Loading
Loading