Document hooks in user config (#1845)

The user config (`~/.config/worktrunk/config.toml`) supports hooks via
`OverridableConfig.hooks`, but the user config documentation didn't
mention them. The project config docs had a hooks section with the full
TOML format reference — this adds a comparable section to user config
and deduplicates the project config side.

- Added `### Hooks` section to user config docs with the three formats
(string, named table, pipeline) and user-vs-project differentiation
- Replaced the duplicate TOML block in project config hooks with a
cross-reference to the user config section

> _This was written by Claude Code on behalf of @max-sixty_

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Maximilian Roos
2026-03-31 18:33:45 -07:00
committed by GitHub
co-authored by Claude
parent 0d7fe83130
commit 491108a782
7 changed files with 120 additions and 126 deletions
+18
View File
@@ -131,6 +131,24 @@
#
# Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
#
# ### Hooks
#
# See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks (https://worktrunk.dev/config/#project-configuration) apply only to that repository.
#
# # Single command
# pre-start = "npm ci"
#
# # Multiple named commands (concurrent for post-*, sequential for pre-*)
# [pre-merge]
# test = "npm test"
# build = "npm run build"
#
# # Pipeline — list of maps, run in order (each map concurrent)
# post-start = [
# { install = "npm ci" },
# { build = "npm run build", server = "npm run dev" }
# ]
#
# ### User project-specific settings
#
# For context:
+1 -18
View File
@@ -6,24 +6,7 @@
#
# ## Hooks
#
# See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
#
# Single command:
#
# pre-start = "npm ci"
#
# Multiple named commands (concurrent for post-*, sequential for pre-*):
#
# [pre-merge]
# test = "npm test"
# build = "npm run build"
#
# Pipeline — list of maps, run in order (each map concurrent):
#
# post-start = [
# { install = "npm ci" },
# { build = "npm run build", server = "npm run dev" }
# ]
# Project hooks apply to this repository only. Format is the same as user hooks (https://worktrunk.dev/config/#hooks); see `wt hook --help` for hook types, execution order, and examples.
#
# ## Dev server URL
#
+21 -24
View File
@@ -223,6 +223,26 @@ url = "echo http://localhost:{{ branch | hash_port }}"
Aliases defined here apply to all projects. For project-specific aliases, use the [project config](@/config.md#project-configuration) `[aliases]` section instead.
### Hooks
See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; [project hooks](@/config.md#project-configuration) apply only to that repository.
```toml
# Single command
pre-start = "npm ci"
# Multiple named commands (concurrent for post-*, sequential for pre-*)
[pre-merge]
test = "npm test"
build = "npm run build"
# Pipeline — list of maps, run in order (each map concurrent)
post-start = [
{ install = "npm ci" },
{ build = "npm run build", server = "npm run dev" }
]
```
### User project-specific settings
For context:
@@ -346,30 +366,7 @@ Location: `.config/wt.toml` (checked into version control and shared with the te
## Hooks
See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
Single command:
```toml
pre-start = "npm ci"
```
Multiple named commands (concurrent for post-*, sequential for pre-*):
```toml
[pre-merge]
test = "npm test"
build = "npm run build"
```
Pipeline — list of maps, run in order (each map concurrent):
```toml
post-start = [
{ install = "npm ci" },
{ build = "npm run build", server = "npm run dev" }
]
```
Project hooks apply to this repository only. Format is the same as [user hooks](@/config.md#hooks); see `wt hook --help` for hook types, execution order, and examples.
## Dev server URL
+21 -24
View File
@@ -222,6 +222,26 @@ url = "echo http://localhost:{{ branch | hash_port }}"
Aliases defined here apply to all projects. For project-specific aliases, use the [project config](https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
### Hooks
See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; [project hooks](https://worktrunk.dev/config/#project-configuration) apply only to that repository.
```toml
# Single command
pre-start = "npm ci"
# Multiple named commands (concurrent for post-*, sequential for pre-*)
[pre-merge]
test = "npm test"
build = "npm run build"
# Pipeline — list of maps, run in order (each map concurrent)
post-start = [
{ install = "npm ci" },
{ build = "npm run build", server = "npm run dev" }
]
```
### User project-specific settings
For context:
@@ -345,30 +365,7 @@ Location: `.config/wt.toml` (checked into version control and shared with the te
## Hooks
See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
Single command:
```toml
pre-start = "npm ci"
```
Multiple named commands (concurrent for post-*, sequential for pre-*):
```toml
[pre-merge]
test = "npm test"
build = "npm run build"
```
Pipeline — list of maps, run in order (each map concurrent):
```toml
post-start = [
{ install = "npm ci" },
{ build = "npm run build", server = "npm run dev" }
]
```
Project hooks apply to this repository only. Format is the same as [user hooks](https://worktrunk.dev/config/#hooks); see `wt hook --help` for hook types, execution order, and examples.
## Dev server URL
+21 -24
View File
@@ -1799,6 +1799,26 @@ url = "echo http://localhost:{{ branch | hash_port }}"
Aliases defined here apply to all projects. For project-specific aliases, use the [project config](@/config.md#project-configuration) `[aliases]` section instead.
### Hooks
See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; [project hooks](@/config.md#project-configuration) apply only to that repository.
```toml
# Single command
pre-start = "npm ci"
# Multiple named commands (concurrent for post-*, sequential for pre-*)
[pre-merge]
test = "npm test"
build = "npm run build"
# Pipeline — list of maps, run in order (each map concurrent)
post-start = [
{ install = "npm ci" },
{ build = "npm run build", server = "npm run dev" }
]
```
### User project-specific settings
For context:
@@ -1922,30 +1942,7 @@ Location: `.config/wt.toml` (checked into version control and shared with the te
## Hooks
See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
Single command:
```toml
pre-start = "npm ci"
```
Multiple named commands (concurrent for post-*, sequential for pre-*):
```toml
[pre-merge]
test = "npm test"
build = "npm run build"
```
Pipeline — list of maps, run in order (each map concurrent):
```toml
post-start = [
{ install = "npm ci" },
{ build = "npm run build", server = "npm run dev" }
]
```
Project hooks apply to this repository only. Format is the same as [user hooks](@/config.md#hooks); see `wt hook --help` for hook types, execution order, and examples.
## Dev server URL
@@ -190,6 +190,24 @@ Creates ~/.config/worktrunk/config.toml with the following content:
  #
  # Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-configuration) `[aliases]` section instead.
  #
  # ### Hooks
  #
  # See `wt hook --help` for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks (https://worktrunk.dev/config/#project-configuration) apply only to that repository.
  #
  # # Single command
  # pre-start = "npm ci"
  #
  # # Multiple named commands (concurrent for post-*, sequential for pre-*)
  # [pre-merge]
  # test = "npm test"
  # build = "npm run build"
  #
  # # Pipeline — list of maps, run in order (each map concurrent)
  # post-start = [
  # { install = "npm ci" },
  # { build = "npm run build", server = "npm run dev" }
  # ]
  #
  # ### User project-specific settings
  #
  # For context:
@@ -310,24 +328,7 @@ With --project, creates .config/wt.toml in the current repositor
  #
  # ## Hooks
  #
  # See `wt hook --help` for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
  #
  # Single command:
  #
  # pre-start = "npm ci"
  #
  # Multiple named commands (concurrent for post-*, sequential for pre-*):
  #
  # [pre-merge]
  # test = "npm test"
  # build = "npm run build"
  #
  # Pipeline — list of maps, run in order (each map concurrent):
  #
  # post-start = [
  # { install = "npm ci" },
  # { build = "npm run build", server = "npm run dev" }
  # ]
  # Project hooks apply to this repository only. Format is the same as user hooks (https://worktrunk.dev/config/#hooks); see `wt hook --help` for hook types, execution order, and examples.
  #
  # ## Dev server URL
  #
@@ -236,6 +236,24 @@ Command templates that run with wt step <name>. See wt step alia
Aliases defined here apply to all projects. For project-specific aliases, use the project config [aliases] section instead.
Hooks
See wt hook --help for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks apply only to that repository.
  # Single command
  pre-start = "npm ci"
 
  # Multiple named commands (concurrent for post-*, sequential for pre-*)
  [pre-merge]
  test = "npm test"
  build = "npm run build"
 
  # Pipeline — list of maps, run in order (each map concurrent)
  post-start = [
   { install = "npm ci" },
   { build = "npm run build", server = "npm run dev" }
  ]
User project-specific settings
For context:
@@ -347,24 +365,7 @@ Location: .config/wt.toml (checked into version control and shared with
Hooks
See wt hook --help for hook types, execution order, template variables, and examples. Both project and user configs support hooks in the same format.
Single command:
  pre-start = "npm ci"
Multiple named commands (concurrent for post-*, sequential for pre-*):
  [pre-merge]
  test = "npm test"
  build = "npm run build"
Pipeline — list of maps, run in order (each map concurrent):
  post-start = [
   { install = "npm ci" },
   { build = "npm run build", server = "npm run dev" }
  ]
Project hooks apply to this repository only. Format is the same as user hooks; see wt hook --help for hook types, execution order, and examples.
Dev server URL