windmill-labs/windmill · warning

⚠️ No workspace bound. Sync commands will not work without

Error message

⚠️  No workspace bound. Sync commands will not work without a workspace.
   Run 'wmill workspace bind' to bind a workspace to this project.

What it means

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.

Source

Thrown at cli/src/commands/init/init.ts:155

        }];
        boundProfile = activeWorkspace;
      }
    }

    await writeFile("wmill.yaml", generateCommentedTemplate(branchName, undefined, wsBindings), "utf-8");
    log.info(colors.green("wmill.yaml created with default settings"));
    if (wsBindings && wsBindings.length > 0) {
      didBindWorkspace = true;
      log.info(
        colors.green(
          `✓ Bound workspace '${wsBindings[0].name}' → ${wsBindings[0].workspaceId} on ${wsBindings[0].baseUrl}`
        )
      );
      log.info(
        colors.gray("To bind additional workspaces, run: wmill workspace bind")
      );
    } else {
      log.warn(
        "⚠️  No workspace bound. Sync commands will not work without a workspace.\n" +
        "   Run 'wmill workspace bind' to bind a workspace to this project."
      );
    }

    // Create lock file
    await readLockfile();

    // Check for backend git-sync settings — only if a workspace was bound and not --use-default
    if (!opts.useDefault && didBindWorkspace && boundProfile) {
      try {
        const { setClient } = await import("../../core/client.ts");

        // Use the bound profile directly — skip requireLogin which would resolve to the active profile
        setClient(boundProfile.token, boundProfile.remote.replace(/\/$/, ""));

        const wmill = await import("../../../gen/services.gen.ts");
        const settings = await wmill.getSettings({

View on GitHub (pinned to e474e8803c)

Solutions

  1. Run `wmill workspace bind` and select/create the workspace.
  2. Log in first if no credentials exist: `wmill login` then `wmill workspace bind`.
  3. Bind non-interactively in CI with `wmill workspace bind <workspace> --token <token>`.

Example fix

// before: project initialized but unbound; sync fails
wmill init
// after
wmill login && wmill workspace bind
Defensive patterns

Strategy: validation

Validate before calling

// after init, verify a workspace is bound before sync commands
import { readFile } from 'node:fs/promises';
const cfg = JSON.parse(await readFile('.wmill/settings.yaml', 'utf8').catch(() => '{}'));
if (!cfg.workspace) { throw new Error('no workspace bound — run: wmill workspace bind'); }

Type guard

null

Try / catch

try {
  await wmill.workspaceBindIfNotBoundDefault();
} catch (e) {
  console.error('Bind a workspace before sync commands: wmill workspace bind');
  process.exit(1);
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/a2790668c56f3992. Report an issue: GitHub.