diff --git a/docs/cli/index.md b/docs/cli/index.md
index d424f9d3b3..d5926e42a7 100644
--- a/docs/cli/index.md
+++ b/docs/cli/index.md
@@ -194,6 +194,7 @@ Interactive wizard to set up gateway, workspace, and skills.
Options:
- `--workspace
`
+- `--reset` (reset config + credentials + sessions + workspace before wizard)
- `--non-interactive`
- `--mode `
- `--flow `
diff --git a/src/cli/program.ts b/src/cli/program.ts
index 3401e2aa1f..e6c0689aa8 100644
--- a/src/cli/program.ts
+++ b/src/cli/program.ts
@@ -244,6 +244,10 @@ export function buildProgram() {
"Interactive wizard to set up the gateway, workspace, and skills",
)
.option("--workspace ", "Agent workspace directory (default: ~/clawd)")
+ .option(
+ "--reset",
+ "Reset config + credentials + sessions + workspace before running wizard",
+ )
.option("--non-interactive", "Run without prompts", false)
.option("--flow ", "Wizard flow: quickstart|advanced")
.option("--mode ", "Wizard mode: local|remote")
diff --git a/src/commands/onboard-types.ts b/src/commands/onboard-types.ts
index bc5cfeebf3..d6afd410f1 100644
--- a/src/commands/onboard-types.ts
+++ b/src/commands/onboard-types.ts
@@ -33,6 +33,7 @@ export type OnboardOptions = {
flow?: "quickstart" | "advanced";
workspace?: string;
nonInteractive?: boolean;
+ reset?: boolean;
authChoice?: AuthChoice;
/** Used when `authChoice=token` in non-interactive mode. */
tokenProvider?: string;
diff --git a/src/commands/onboard.ts b/src/commands/onboard.ts
index 2608e80c12..5fd02bbee7 100644
--- a/src/commands/onboard.ts
+++ b/src/commands/onboard.ts
@@ -1,6 +1,9 @@
+import { readConfigFileSnapshot } from "../config/config.js";
import { assertSupportedRuntime } from "../infra/runtime-guard.js";
import type { RuntimeEnv } from "../runtime.js";
import { defaultRuntime } from "../runtime.js";
+import { resolveUserPath } from "../utils.js";
+import { DEFAULT_WORKSPACE, handleReset } from "./onboard-helpers.js";
import { runInteractiveOnboarding } from "./onboard-interactive.js";
import { runNonInteractiveOnboarding } from "./onboard-non-interactive.js";
import type { OnboardOptions } from "./onboard-types.js";
@@ -15,6 +18,16 @@ export async function onboardCommand(
const normalizedOpts =
authChoice === opts.authChoice ? opts : { ...opts, authChoice };
+ if (normalizedOpts.reset) {
+ const snapshot = await readConfigFileSnapshot();
+ const baseConfig = snapshot.valid ? snapshot.config : {};
+ const workspaceDefault =
+ normalizedOpts.workspace ??
+ baseConfig.agents?.defaults?.workspace ??
+ DEFAULT_WORKSPACE;
+ await handleReset("full", resolveUserPath(workspaceDefault), runtime);
+ }
+
if (process.platform === "win32") {
runtime.log(
[