Skip to content

workler apply

(Re-)apply the copy/link rules from .workler to workspaces.

bash
workler apply [name] [--all] [--force] [--dry-run]

Behavior

InvocationEffect
workler apply <name>Apply the rules to that workspace
workler apply --allApply the rules to every workspace (except main)
workler apply (inside a workspace)Refresh this workspace from its immediate parent's .workler
workler apply (in the main project)Error — say which workspace, or --all

For each rule, an up-to-date destination is reported ok and left alone; a missing source is skipped; anything else in the way is a conflict that requires --force. See Safety, --force, --dry-run for the exact semantics.

Typical reasons to re-run apply: you edited .workler, .env changed in the main project, or a rule was skipped earlier because its source didn't exist yet.

Options

FlagDescription
--allEvery workspace; cannot be combined with [name]
--forceReplace destinations that already exist and differ
--dry-runPrint what would happen without changing anything

Output

text
applying feature-a
ok     link node_modules (already linked)
copied .env (replaced existing file)
skip   copy fixtures/db.sqlite (source does not exist: fixtures/db.sqlite)

With --dry-run, actions become would ... lines, conflicts are listed, and a summary asks for --force:

text
dry run: nothing will be changed
would  copy .env -> .worktrees/feature-a/.env
conflict copy config/local.json
1 conflict(s); re-run with --force to replace the destination(s)

Errors

  • No workspace named <name>.
  • --all combined with a workspace name.
  • Bare apply outside a workspace.
  • A conflicting destination without --force — the error shows source, destination, and what is currently there.

Examples

bash
workler apply feature-a                 # one workspace
workler apply --all                     # everything
workler apply --all --dry-run           # what would change anywhere?
workler apply feature-a --force         # take the main project's .env again
cd "$(workler path feature-a)" && workler apply   # refresh from inside

Released under the MIT License.