{"record":{"id":"a2790668c56f3992","repo":"windmill-labs/windmill","slug":"no-workspace-bound-sync-commands-will-not-wor","errorCode":null,"errorMessage":"⚠️  No workspace bound. Sync commands will not work without a workspace.\n   Run 'wmill workspace bind' to bind a workspace to this project.","messagePattern":"⚠️  No workspace bound\\. Sync commands will not work without a workspace\\.\n   Run 'wmill workspace bind' to bind a workspace to this project\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/init/init.ts","lineNumber":155,"sourceCode":"        }];\n        boundProfile = activeWorkspace;\n      }\n    }\n\n    await writeFile(\"wmill.yaml\", generateCommentedTemplate(branchName, undefined, wsBindings), \"utf-8\");\n    log.info(colors.green(\"wmill.yaml created with default settings\"));\n    if (wsBindings && wsBindings.length > 0) {\n      didBindWorkspace = true;\n      log.info(\n        colors.green(\n          `✓ Bound workspace '${wsBindings[0].name}' → ${wsBindings[0].workspaceId} on ${wsBindings[0].baseUrl}`\n        )\n      );\n      log.info(\n        colors.gray(\"To bind additional workspaces, run: wmill workspace bind\")\n      );\n    } else {\n      log.warn(\n        \"⚠️  No workspace bound. Sync commands will not work without a workspace.\\n\" +\n        \"   Run 'wmill workspace bind' to bind a workspace to this project.\"\n      );\n    }\n\n    // Create lock file\n    await readLockfile();\n\n    // Check for backend git-sync settings — only if a workspace was bound and not --use-default\n    if (!opts.useDefault && didBindWorkspace && boundProfile) {\n      try {\n        const { setClient } = await import(\"../../core/client.ts\");\n\n        // Use the bound profile directly — skip requireLogin which would resolve to the active profile\n        setClient(boundProfile.token, boundProfile.remote.replace(/\\/$/, \"\"));\n\n        const wmill = await import(\"../../../gen/services.gen.ts\");\n        const settings = await wmill.getSettings({","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/init/init.ts#L137-L173","documentation":"During `wmill init`, if the project ends up with no workspace bound, the CLI warns that all sync commands (push/pull/generate-metadata) require a bound workspace and instructs running `wmill workspace bind`. Initialization still completes, including lock-file creation.","triggerScenarios":"Running `wmill init` non-interactively or declining/interrupting the workspace-binding step; `wmill init` in an environment with no existing workspace configuration (fresh machine, CI).","commonSituations":"Cloning a repo and running init without ever logging in; CI provisioning a project skeleton; user skipped the bind prompt; remote/context mismatch so no workspace was resolved.","solutions":["Run `wmill workspace bind` and select/create the workspace.","Log in first if no credentials exist: `wmill login` then `wmill workspace bind`.","Bind non-interactively in CI with `wmill workspace bind <workspace> --token <token>`."],"exampleFix":"// before: project initialized but unbound; sync fails\nwmill init\n// after\nwmill login && wmill workspace bind","handlingStrategy":"validation","validationCode":"// after init, verify a workspace is bound before sync commands\nimport { readFile } from 'node:fs/promises';\nconst cfg = JSON.parse(await readFile('.wmill/settings.yaml', 'utf8').catch(() => '{}'));\nif (!cfg.workspace) { throw new Error('no workspace bound — run: wmill workspace bind'); }","typeGuard":"null","tryCatchPattern":"try {\n  await wmill.workspaceBindIfNotBoundDefault();\n} catch (e) {\n  console.error('Bind a workspace before sync commands: wmill workspace bind');\n  process.exit(1);\n}","preventionTips":["Always run `wmill login && wmill workspace bind` right after `wmill init`.","In CI, bind non-interactively with a token before any push/pull step.","Add a settings/binding check to your repo bootstrap script."],"tags":["cli","workspace","initialization","configuration"],"backgroundTag":"no-workspace-bound","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"}