{"record":{"id":"3595264a6af43d9c","repo":"windmill-labs/windmill","slug":"workspace-name-conflict-use-force-to-overwrite","errorCode":null,"errorMessage":"Workspace name conflict. Use --force to overwrite or choose a different name.","messagePattern":"Workspace name conflict\\. Use --force to overwrite or choose a different name\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/workspace/workspace.ts","lineNumber":362,"sourceCode":"      );\n    } else {\n      // Different remote or workspaceId - this is a conflict\n      log.info(\n        colors.red.bold(`❌ Workspace name \"${workspace.name}\" already exists!`)\n      );\n      log.info(\n        `   Existing: ${nameConflict.workspaceId} on ${nameConflict.remote}`\n      );\n      log.info(`   New:      ${workspace.workspaceId} on ${workspace.remote}`);\n\n      if (!isInteractive) {\n        // In non-interactive mode (tests, scripts), auto-overwrite with force flag\n        if (opts.force) {\n          log.info(\n            colors.yellow(\"Force flag enabled, overwriting existing workspace.\")\n          );\n        } else {\n          throw new Error(\n            \"Workspace name conflict. Use --force to overwrite or choose a different name.\"\n          );\n        }\n      } else {\n        const overwrite = await Confirm.prompt({\n          message: \"Do you want to overwrite the existing workspace?\",\n          default: false,\n        });\n\n        if (!overwrite) {\n          log.info(colors.yellow(\"Operation cancelled.\"));\n          return false;\n        }\n      }\n    }\n  }\n\n  // Check 2: Same (remote, workspaceId) already exists with a different name","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/workspace/workspace.ts#L344-L380","documentation":"addWorkspace found an existing local workspace entry with the same name but pointing to a different remote/workspaceId; adding the new one under that name would shadow the old mapping. Without --force and outside interactive mode, it refuses rather than silently overwriting.","triggerScenarios":"Thrown at cli/src/commands/workspace/workspace.ts:362 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rerun with --force to overwrite the existing entry.","Choose a different local name for the new workspace.","Remove the conflicting entry first with `wmill workspace remove <name>`."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}