Diagnose common workspace, git, and runner issues quickly.
When a WSM command fails or produces unexpected output, the cause almost always falls into one of four categories: registry problems, workspace state issues, git conflicts, or command context errors. This guide helps you identify which category you are in and recover quickly.
Before diving into specific errors, run through this checklist:
pwd and confirm you are inside a workspace directory
(or pass --workspace <name> explicitly).wsm list repos -- does it include the
repositories you expect?wsm list workspaces -- is your workspace
listed?wsm status --workspace <name> --output-mode both
for the fullest picture.The repositories you specified with --repos are not in WSM's registry.
Diagnose:
wsm list repos --output-mode data
Look for the missing repository names. If they are absent:
Fix:
wsm discover ~/code # point at the parent directory containing your repos
wsm list repos # confirm they appear now
wsm create my-feature --repos the-missing-repo
WSM's registry stores absolute paths. If you move a repository to a different directory, the old path in the registry becomes invalid.
Fix: Re-run discovery. It overwrites the registry with fresh data:
wsm discover ~/new-location
WSM cannot detect which workspace you mean. This happens when:
Fix: Pass the workspace explicitly:
wsm status my-feature
# or
wsm status --workspace my-feature
Someone (or you) deleted the workspace directory manually, but the JSON config
file at ~/.config/workspace-manager/workspaces/<name>.json still exists.
Fix:
wsm delete <name> # removes the stale JSON config
If wsm delete fails because it cannot find the directory, delete the JSON file
manually:
rm ~/.config/workspace-manager/workspaces/<name>.json
Check the workspace JSON:
wsm info <name>
wsm info <name> --field path
If the path or repos look incorrect, delete and recreate:
wsm delete <name>
wsm create <name> --repos correct,repos
Rebase is the most complex multi-repo operation. Problems usually affect one repository at a time.
The other repositories may have rebased successfully. Check per-repo state:
wsm rebase status
This shows a table with columns: REPOSITORY, STATE, CONFLICTS, ERROR. Possible states:
none -- no rebase in progressin_progress -- rebase is paused (usually due to conflicts)Step-by-step recovery:
Identify conflicts:
wsm rebase status --repo <repo-name>
Resolve conflicts manually:
cd <workspace-path>/<repo-name>
# edit the conflicted files
git add <resolved-files>
Continue the rebase:
wsm rebase continue --repo <repo-name>
Or abort if recovery is not worth it:
wsm rebase abort --repo <repo-name>
If a rebase operation appears to hang, it may be waiting for an editor (for interactive rebase) or processing a large repository.
--interactive, WSM opens an editor. Complete the editor session.--manual to see the exact git commands, then run them yourself:
wsm rebase --manual --target main
Use --dry-run to see what would happen:
wsm rebase --dry-run
You ran wsm commit without -m and without --interactive.
Fix: Either provide a message or use interactive mode:
wsm commit -m "your message"
# or
wsm commit --interactive
All repositories are clean. Run wsm status to confirm, or wsm diff to check
for changes.
wsm commit -m "your message" --push
Add --add-all to also stage all unstaged changes:
wsm commit -m "your message" --add-all --push
WSM refuses to remove worktrees that have uncommitted changes. This is intentional -- it prevents data loss.
Options:
wsm delete <name> --force-worktrees
wsm delete <name>
Without --remove-files, WSM removes the workspace config and worktree
registrations but leaves the directory intact.
The script was not executed through wsm runner. The wsm module is only
available inside the runner's goja environment.
Fix: Use wsm runner, not node:
wsm runner my-script.js
The script needs to end with an expression (not a statement). Return an object literal:
// Wrong -- ends with a function call (statement)
console.log(result);
// Right -- ends with an expression
({
count: repos.length,
version: wsm.version,
});
Use --output-mode data and --print-result=false for clean machine-readable
output:
wsm runner script.js --output-mode data --print-result=false
TypeError from JS API callThe JS wrappers validate required inputs before running workflows. Common examples:
createWorkspace requires name and reposworkspaces.add requires workspaceName and repoNameworkspaces.merge requires workspaceNamegit.commit requires message or templategit.branch.create/switch require branchNameFix: pass all required fields in the method input object.
Some APIs return per-repository row results instead of throwing for every row
failure. Check row payloads for repository-level success/error fields:
git.branch.create/switch return results[]git.rebase.status/continue/abort return rows[]If the call itself fails (for example workspace not found), a top-level error is thrown.
Here are the most useful commands for debugging, all using --output-mode data
for structured output:
# What repos does WSM know about?
wsm list repos --output-mode data
# What workspaces exist?
wsm list workspaces --output-mode data
# Detailed status for a workspace
wsm status --workspace <name> --output-mode data
# Rebase state for all repos
wsm rebase status --output-mode data
# Workspace metadata
wsm info <name> --output-mode data
# Diff across workspace
wsm diff --output-mode data
# Run the smoke test
wsm runner demo/js/wsm-api-smoke.js --output-mode both
wsm --help for the top-level command list.wsm <command> --help for flags and usage of any specific command.wsm help wsm-persistence-and-state if you suspect state corruption.wsm help wsm-architecture-overview if contributing or debugging
internals.wsm help wsm-getting-startedwsm help wsm-command-referencewsm help wsm-persistence-and-state