Getting started
Install
Workler needs Node.js >= 18 and git on your PATH.
npm install -g workler
workler helpInitialize the project
Run workler init once in your project root:
workler initIt creates a starter .workler file, the .worktrees/ directory, and makes sure .worktrees/ is ignored by git (via .git/info/exclude, so nothing changes in your committed files):
created .workler
ready .worktrees
ignored .worktrees/ in .git/info/excludeinit is idempotent — running it again reports exists instead of created and changes nothing.
Declare the rules
Edit .workler to declare what a fresh workspace needs. It is line-based, like .gitignore but with an action first:
link node_modules # symlink back to the main project
copy .env # copied into the workspacelink <path>creates a symlink in the workspace back to the main project — right for big, regenerable directories likenode_modules.copy <path>copies the file or folder into the workspace — right for local config each workspace may want to change independently, like.env.
See Copy & link rules for the full syntax.
Create a workspace
workler add feature-aWorkler clones the main project into .worktrees/feature-a, creates and checks out a new branch feature-a from the main project's current HEAD, and applies the rules:
cloning /path/to/project
to /path/to/project/.worktrees/feature-a
create branch feature-a from HEAD
linked node_modules
copied .env
done feature-a
path /path/to/project/.worktrees/feature-aThe workspace is a full, independent clone — its own HEAD, index, and local branches — ready to run without an install step.
Not sure what a command will do? Every mutating command takes --dry-run:
workler add feature-b --dry-runprints the whole plan — clone, branch, every rule — without touching anything.
Move around
workler list # every workspace, its branch, its path
cd "$(workler path feature-a)" # jump into a workspaceOr load the shell helper once and use wcd:
eval "$(workler shell-init)" # put this in your shell rc
wcd feature-a
wcd mainEveryday commands
| Command | What it does |
|---|---|
workler add <name> | Clone a new workspace on a new branch, apply rules |
workler apply <name> | Re-apply the rules to a workspace |
workler list | Show every workspace with its branch and path |
workler path <name> | Print a workspace's path (for cd "$(...)") |
workler remove <name> | Delete a workspace (refuses if it has uncommitted changes) |
workler status | Branch, ahead/behind, clean/dirty for every workspace |
workler sync | Fetch everywhere, fast-forward what's safe |
See the CLI reference for every command and flag.
Where to go next
- Workspaces & branches — bases,
--branch,--checkout, and detached checkouts. - Copy & link rules — the
.worklerformat in full. - Keeping workspaces in sync —
status,fetch,sync, andbranch-sync. - Programmatic API — create, inspect, list, and remove workspaces from TypeScript or JavaScript.