Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

docs: cross-link vars references to dedicated docs (#2034)

Maximilian Roosd0bee7b26064
diff --git a/docs/content/config.md b/docs/content/config.md
index 45e477895..4e740bf50 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -579,7 +579,7 @@ State is stored in `.git/` (config entries and log files), separate from configu
- **previous-branch**: Previous branch for `wt switch -`
- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, no-ci, error)
- **marker**: Custom status marker for a branch (shown in `wt list`)
-- **vars**: <span class="badge-experimental"></span> Custom variables per branch
+- **vars**: <span class="badge-experimental"></span> [Custom variables per branch](@/config.md#wt-config-state-vars)
- **logs**: Operation and debug logs
### Examples
@@ -834,7 +834,7 @@ Operate on a different branch:
### Template access
-Variables are available in hook templates as `{{ vars.<key> }}`. Use the `default` filter for keys that may not be set:
+Variables are available in [hook templates](@/hook.md#template-variables) as `{{ vars.<key> }}`. Use the `default` filter for keys that may not be set:
```toml
[post-start]
diff --git a/docs/content/hook.md b/docs/content/hook.md
index eff045218..1b6eb4477 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -118,7 +118,7 @@ Hooks can use template variables that expand at runtime:
| `{{ remote_url }}` | Remote URL |
| `{{ hook_type }}` | Hook type being run (e.g. `pre-start`, `pre-merge`) |
| `{{ hook_name }}` | Hook command name (if named) |
-| `{{ vars.<key> }}` | Per-branch variables from `wt config state vars` |
+| `{{ vars.<key> }}` | Per-branch variables from [`wt config state vars`](@/config.md#wt-config-state-vars) |
Bare variables (`branch`, `worktree_path`, `commit`) refer to the branch the operation acts on: the destination for switch/create, the source for merge/remove. `base` and `target` give the other side:
diff --git a/docs/content/list.md b/docs/content/list.md
index 17c594428..58a47b153 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -162,7 +162,7 @@ Query structured data with `--format=json`:
| `summary` | string | LLM-generated branch summary; absent when not configured or no summary |
| `statusline` | string | Pre-formatted status with ANSI colors |
| `symbols` | string | Raw status symbols without colors (e.g., `"!?↓"`) |
-| `vars` | object | Per-branch variables from `wt config state vars` (absent when empty) |
+| `vars` | object | Per-branch variables from [`wt config state vars`](@/config.md#wt-config-state-vars) (absent when empty) |
### Commit object
diff --git a/docs/content/tips-patterns.md b/docs/content/tips-patterns.md
index d153a2c1c..539bf9de0 100644
--- a/docs/content/tips-patterns.md
+++ b/docs/content/tips-patterns.md
@@ -65,7 +65,7 @@ Ports are deterministic — `fix-auth` always gets port 16460, regardless of whi
## Database per worktree
-Each worktree can have its own isolated database. A pipeline sets up names and ports as vars, then later steps and hooks reference them:
+Each worktree can have its own isolated database. A pipeline sets up names and ports as [vars](@/config.md#wt-config-state-vars), then later steps and hooks reference them:
```toml
post-start = [
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index 3d1f4d980..151d98f6c 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -584,7 +584,7 @@ State is stored in `.git/` (config entries and log files), separate from configu
- **previous-branch**: Previous branch for `wt switch -`
- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, no-ci, error)
- **marker**: Custom status marker for a branch (shown in `wt list`)
-- **vars**: [experimental] Custom variables per branch
+- **vars**: [experimental] [Custom variables per branch](https://worktrunk.dev/config/#wt-config-state-vars)
- **logs**: Operation and debug logs
### Examples
@@ -857,7 +857,7 @@ $ wt config state vars set env=production --branch=main
### Template access
-Variables are available in hook templates as `{{ vars.<key> }}`. Use the `default` filter for keys that may not be set:
+Variables are available in [hook templates](https://worktrunk.dev/hook/#template-variables) as `{{ vars.<key> }}`. Use the `default` filter for keys that may not be set:
```toml
[post-start]
diff --git a/skills/worktrunk/reference/hook.md b/skills/worktrunk/reference/hook.md
index db75fba5b..43d05c6d2 100644
--- a/skills/worktrunk/reference/hook.md
+++ b/skills/worktrunk/reference/hook.md
@@ -109,7 +109,7 @@ Hooks can use template variables that expand at runtime:
| `{{ remote_url }}` | Remote URL |
| `{{ hook_type }}` | Hook type being run (e.g. `pre-start`, `pre-merge`) |
| `{{ hook_name }}` | Hook command name (if named) |
-| `{{ vars.<key> }}` | Per-branch variables from `wt config state vars` |
+| `{{ vars.<key> }}` | Per-branch variables from [`wt config state vars`](https://worktrunk.dev/config/#wt-config-state-vars) |
Bare variables (`branch`, `worktree_path`, `commit`) refer to the branch the operation acts on: the destination for switch/create, the source for merge/remove. `base` and `target` give the other side:
diff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.md
index d6e1cc228..4bae1dbfe 100644
--- a/skills/worktrunk/reference/list.md
+++ b/skills/worktrunk/reference/list.md
@@ -176,7 +176,7 @@ $ wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
| `summary` | string | LLM-generated branch summary; absent when not configured or no summary |
| `statusline` | string | Pre-formatted status with ANSI colors |
| `symbols` | string | Raw status symbols without colors (e.g., `"!?↓"`) |
-| `vars` | object | Per-branch variables from `wt config state vars` (absent when empty) |
+| `vars` | object | Per-branch variables from [`wt config state vars`](https://worktrunk.dev/config/#wt-config-state-vars) (absent when empty) |
### Commit object
diff --git a/skills/worktrunk/reference/tips-patterns.md b/skills/worktrunk/reference/tips-patterns.md
index 2a73ecf20..98900e207 100644
--- a/skills/worktrunk/reference/tips-patterns.md
+++ b/skills/worktrunk/reference/tips-patterns.md
@@ -58,7 +58,7 @@ Ports are deterministic — `fix-auth` always gets port 16460, regardless of whi
## Database per worktree
-Each worktree can have its own isolated database. A pipeline sets up names and ports as vars, then later steps and hooks reference them:
+Each worktree can have its own isolated database. A pipeline sets up names and ports as [vars](https://worktrunk.dev/config/#wt-config-state-vars), then later steps and hooks reference them:
```toml
post-start = [
diff --git a/src/cli/config.rs b/src/cli/config.rs
index 94dc2381f..9613a6335 100644
--- a/src/cli/config.rs
+++ b/src/cli/config.rs
@@ -437,7 +437,7 @@ $ wt config plugins opencode install
- **previous-branch**: Previous branch for `wt switch -`
- **ci-status**: CI/PR status for a branch (passed, running, failed, conflicts, no-ci, error)
- **marker**: Custom status marker for a branch (shown in `wt list`)
-- **vars**: [experimental] Custom variables per branch
+- **vars**: [experimental] [Custom variables per branch](@/config.md#wt-config-state-vars)
- **logs**: Operation and debug logs
## Examples
@@ -730,7 +730,7 @@ $ wt config state vars set env=production --branch=main
## Template access
-Variables are available in hook templates as `{{ vars.<key> }}`. Use the `default` filter for keys that may not be set:
+Variables are available in [hook templates](@/hook.md#template-variables) as `{{ vars.<key> }}`. Use the `default` filter for keys that may not be set:
```toml
[post-start]
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index fd1cbc4cc..b00195f1e 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -825,7 +825,7 @@ $ wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
| `summary` | string | LLM-generated branch summary; absent when not configured or no summary |
| `statusline` | string | Pre-formatted status with ANSI colors |
| `symbols` | string | Raw status symbols without colors (e.g., `"!?↓"`) |
-| `vars` | object | Per-branch variables from `wt config state vars` (absent when empty) |
+| `vars` | object | Per-branch variables from [`wt config state vars`](@/config.md#wt-config-state-vars) (absent when empty) |
### Commit object
@@ -1276,7 +1276,7 @@ Hooks can use template variables that expand at runtime:
| `{{ remote_url }}` | Remote URL |
| `{{ hook_type }}` | Hook type being run (e.g. `pre-start`, `pre-merge`) |
| `{{ hook_name }}` | Hook command name (if named) |
-| `{{ vars.<key> }}` | Per-branch variables from `wt config state vars` |
+| `{{ vars.<key> }}` | Per-branch variables from [`wt config state vars`](@/config.md#wt-config-state-vars) |
Bare variables (`branch`, `worktree_path`, `commit`) refer to the branch the operation acts on: the destination for switch/create, the source for merge/remove. `base` and `target` give the other side: