worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

Error when using [pre-start] - Unknown key pre-start will be ignored

Open timjstacey opened this issue 8 months ago • 4 comments

Summary

The documentation shows [pre-start] as an option yet the configuration is ignored https://worktrunk.dev/hook/#pre-start

This it the output of wt config show

wt config show           
USER CONFIG @ ~/.config/worktrunk/config.toml
  [post-start]
  deps = "wt step copy-ignored"
  
↳ Optional system config not found @ '/Library/Application Support/worktrunk/config.toml'

PROJECT CONFIG @ ~/{PATH_TO_PROJECT}/.config/wt.toml
▲ Unknown key pre-start will be ignored
  [pre-start]
  install = "npm ci"

SHELL INTEGRATION
○ Shell integration active

○ bash: Already configured shell extension & completions @ ~/.bashrc:118
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init bash)"; fi
○ zsh: Already configured shell extension & completions @ ~/.zshrc:89
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi
○ fish: Skipped; ~/.config/fish/functions not found
○ nu: Skipped; ~/.config/nushell/vendor/autoload not found

CLAUDE CODE
↳ Plugin not installed. To install, run:
  claude plugin marketplace add max-sixty/worktrunk
  claude plugin install worktrunk@worktrunk
↳ Statusline not configured. See https://worktrunk.dev/claude-code/#statusline

OTHER
○ wt: 0.31.0
○ git: 2.53.0
○ Hyperlinks: active

Steps to reproduce:

  • add the following config to PROJECT CONFIG or USER CONFIG:
[pre-start]
install = "npm ci"
  • run wt switch --create feature/test-wt

Expected behaviour

  • pre-start runs npm ci

Actual behaviour:

  • pre-start is ignored
wt switch --create feature/test-wt
▲ Project config has unknown field pre-start (will be ignored)
✓ Created branch feature/test-wt from develop and worktree @ ~/Repositories/bitbucket/repeat-system-tests-wt.feature-test-wt
◎ Running post-start: user:deps

timjstacey avatar Mar 25 '26 07:03 timjstacey

yes, sorry, the docs are from main and the most recently released version doesn't have that yet.

I'll release now; I was hoping to do another change on hooks, but no reason to wait

max-sixty avatar Mar 25 '26 07:03 max-sixty

I was about to reply to say [post-create] is still working but you beat me to it.

All good, merge when you're ready.

timjstacey avatar Mar 25 '26 07:03 timjstacey

Thanks for reporting this! I looked into this and pre-start is a new hook name that was introduced in #1679 (the hooks rationalization), which landed on main after the v0.31.0 release. The docs site at worktrunk.dev is built from main, so it shows pre-start as available even though the latest published release (v0.31.0) doesn't recognize it yet.

On v0.31.0, the equivalent hook is called post-create:

[post-create]
install = "npm ci"

This will run as a blocking step before post-start, which is the same behavior that pre-start provides in the next release. When the next version is released, both names will be accepted (with post-create showing a deprecation notice pointing to pre-start).

A maintainer will confirm and can decide whether to expedite a release.

worktrunk-bot avatar Mar 25 '26 07:03 worktrunk-bot

release done! sorry for the out-of-sync-ness @timjstacey !

max-sixty avatar Mar 25 '26 17:03 max-sixty