Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
---
source: tests/integration_tests/help.rs
info:
program: wt
args:
- config
- create
- "--help"
env:
CLICOLOR_FORCE: "1"
COLUMNS: "500"
GIT_ALLOW_PROTOCOL: file
GIT_CONFIG_COUNT: "2"
GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
GIT_CONFIG_KEY_0: user.useConfigOnly
GIT_CONFIG_KEY_1: rerere.enabled
GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
GIT_CONFIG_VALUE_0: "true"
GIT_CONFIG_VALUE_1: "false"
LANG: C
LC_ALL: C
LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
TERM: alacritty
WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
WORKTRUNK_TEST_CODEX_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
WORKTRUNK_TEST_FISH_INSTALLED: "0"
WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_PARENT_SHELL: ""
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
WORKTRUNK_TEST_ZSH_INSTALLED: "0"
---
success: true
exit_code: 0
----- stdout -----
wt config create - Create configuration file
Usage: [1m[36mwt config create[0m [36m[OPTIONS][0m
[1m[32mOptions:[0m
[1m[36m--project[0m
Create project config ([1m.config/wt.toml[0m) instead of user config
[1m[36m-h[0m, [1m[36m--help[0m
Print help (see a summary with '-h')
[1m[32mGlobal Options:[0m
[1m[36m-C[0m[36m [0m[36m<path>[0m
Working directory for this command
[1m[36m--config[0m[36m [0m[36m<path>[0m
User config file path
[1m[36m--config-set[0m[36m [0m[36m<toml>[0m
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
[1m[36m-v[0m, [1m[36m--verbose[0m[36m...[0m
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
[1m[36m-y[0m, [1m[36m--yes[0m
Skip approval prompts
[1m[32mUser config[0m
Creates [2m~/.config/worktrunk/config.toml[0m with the following content:
[107m [0m [2m# # User Configuration[0m
[107m [0m [2m#[0m
[107m [0m [2m# Create with `wt config create`. Values shown are defaults unless noted otherwise.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Location:[0m
[107m [0m [2m#[0m
[107m [0m [2m# - macOS/Linux: `~/.config/worktrunk/config.toml` (or `$XDG_CONFIG_HOME` if set)[0m
[107m [0m [2m# - Windows: `%APPDATA%\worktrunk\config.toml`[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Worktree path template[0m
[107m [0m [2m#[0m
[107m [0m [2m# Controls where new worktrees are created.[0m
[107m [0m [2m#[0m
[107m [0m [2m# **Available template variables:**[0m
[107m [0m [2m#[0m
[107m [0m [2m# - `{{ repo_path }}` — absolute path to the repository root (e.g., `/Users/me/code/myproject`. Or for bare repos, the bare directory itself)[0m
[107m [0m [2m# - `{{ repo }}` — repository directory name (e.g., `myproject`)[0m
[107m [0m [2m# - `{{ owner }}` — primary remote owner path (may include subgroups like `group/subgroup`)[0m
[107m [0m [2m# - `{{ remote_repo }}` — repository name in the primary remote URL, without `.git` (e.g., `myproject`); differs from `{{ repo }}`, the directory on disk, when a clone was renamed[0m
[107m [0m [2m# - `{{ branch }}` — raw branch name (e.g., `feature/auth`)[0m
[107m [0m [2m# - `{{ branch | sanitize }}` — filesystem-safe: `/` and `\` become `-` (e.g., `feature-auth`)[0m
[107m [0m [2m# - `{{ branch | sanitize_db }}` — database-safe: lowercase, underscores, hash suffix (e.g., `feature_auth_x7k`)[0m
[107m [0m [2m# - `{{ branch | codename(2) }}` — deterministic friendly name from a ~1.26M-combo pool (e.g., `malleable-opah`)[0m
[107m [0m [2m#[0m
[107m [0m [2m# This is a smaller set than the variables hooks and aliases get (https://worktrunk.dev/hook/#template-variables).[0m
[107m [0m [2m#[0m
[107m [0m [2m# **Examples** for repo at `~/code/myproject`, branch `feature/auth`:[0m
[107m [0m [2m#[0m
[107m [0m [2m# Default — sibling directory (`~/code/myproject.feature-auth`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "{{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Inside the repository (`~/code/myproject/.worktrees/feature-auth`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "{{ repo_path }}/.worktrees/{{ branch | sanitize }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Friendly branch-derived names (`~/code/myproject.malleable-opah`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "{{ repo_path }}/../{{ repo }}.{{ branch | codename(2) }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Friendly names with branch identity in a parent directory (`~/code/worktrees/feature-auth/malleable-opah`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "{{ repo_path }}/../worktrees/{{ branch | sanitize }}/{{ branch | codename(2) }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Centralized worktrees directory (`~/worktrees/myproject/feature-auth`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "~/worktrees/{{ repo }}/{{ branch | sanitize }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# By remote owner path (`~/development/max-sixty/myproject/feature/auth`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "~/development/{{ owner }}/{{ repo }}/{{ branch }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Bare repository cloned to `~/code/myproject/.git` (`~/code/myproject/feature-auth`):[0m
[107m [0m [2m#[0m
[107m [0m [2m# worktree-path = "{{ repo_path }}/../{{ branch | sanitize }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# `~` expands to the home directory. Relative paths resolve from `repo_path`.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## LLM commit messages[0m
[107m [0m [2m#[0m
[107m [0m [2m# Generate commit messages automatically during merge. Requires an external CLI tool.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Claude Code[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# command = "MAX_THINKING_TOKENS=0 claude -p --no-session-persistence --model=haiku --tools='' --safe-mode --setting-sources='user' --system-prompt=''"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Codex[0m
[107m [0m [2m#[0m
[107m [0m [2m# Create `~/.codex/worktrunk-commit-instructions.txt` containing just `.` (no newline). Accepting Worktrunk's first-run Codex setup creates the file for you.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# command = "codex exec -m gpt-6-luna -c model_reasoning_effort='none' -c project_doc_max_bytes=0 -c skills.max_context_tokens=1 -c agents.enabled=false -c features.goals=false -c web_search=disabled -c 'model_instructions_file=\"~/.codex/worktrunk-commit-instructions.txt\"' -c features.shell_tool=false -c features.unified_exec=false -c features.apps=false -c features.plugins=false --ephemeral --sandbox=read-only --json - | jq -sr '[.[] | select(.item.type? == \"agent_message\")] |
[107m [0m last.item.text'"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### OpenCode[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# command = "opencode run -m anthropic/claude-haiku-5-5 --variant fast"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### llm[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# command = "llm -m claude-haiku-4.5"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### aichat[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# command = "aichat -m claude:claude-haiku-4.5 --code"[0m
[107m [0m [2m#[0m
[107m [0m [2m# See LLM commits docs (https://worktrunk.dev/llm-commits/) for setup and Custom prompt templates (#custom-prompt-templates) for template customization.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Command config[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### List[0m
[107m [0m [2m#[0m
[107m [0m [2m# Persistent flag values for `wt list`. Override on command line as needed.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [list][0m
[107m [0m [2m# summary = false # Enable LLM branch summaries (requires [commit.generation])[0m
[107m [0m [2m#[0m
[107m [0m [2m# full = false # Show CI status and LLM summaries (--full)[0m
[107m [0m [2m# branches = false # Include branches without worktrees (--branches)[0m
[107m [0m [2m# remotes = false # Include remote-only branches (--remotes)[0m
[107m [0m [2m#[0m
[107m [0m [2m# json-schema = 2 # JSON output schema: 2 (envelope, default) or 1 (bare array)[0m
[107m [0m [2m#[0m
[107m [0m [2m# columns = ["branch", "status", "ci", "path"] # Columns to show, in order — built-ins or custom headers (omit for the default set)[0m
[107m [0m [2m#[0m
[107m [0m [2m# timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables[0m
[107m [0m [2m#[0m
[107m [0m [2m# `columns` selects and orders the columns the `wt list` table and the `wt switch`[0m
[107m [0m [2m# picker render; `--format json` ignores it and always emits every field. Omit it[0m
[107m [0m [2m# for the default set. It is meant to drive a per-invocation[0m
[107m [0m [2m# alias (https://worktrunk.dev/extending/#aliases) (`wt --config-set 'list.columns=[…]' list`),[0m
[107m [0m [2m# giving a named view without disturbing the default `wt list`. A static setting[0m
[107m [0m [2m# works but pins one layout over a table that otherwise adapts to `--full` and[0m
[107m [0m [2m# terminal width.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Valid built-in names:[0m
[107m [0m [2m#[0m
[107m [0m [2m# - `branch` — The branch name[0m
[107m [0m [2m# - `status` — Git status symbols, plus any user-defined status[0m
[107m [0m [2m# - `working-diff` — Uncommitted line changes against `HEAD`, including untracked files (header `HEAD±`)[0m
[107m [0m [2m# - `ahead-behind` — Commits ahead of and behind the default branch (header `main↕`)[0m
[107m [0m [2m# - `branch-diff` — Line changes against the default branch (header `main…±`)[0m
[107m [0m [2m# - `summary` — An LLM-generated summary of the branch[0m
[107m [0m [2m# - `upstream` — Commits ahead of and behind the upstream tracking branch (header `Remote⇅`)[0m
[107m [0m [2m# - `ci` — CI status of the head commit[0m
[107m [0m [2m# - `path` — The worktree's path[0m
[107m [0m [2m# - `url` — Dev-server URL from the `[list] url` template[0m
[107m [0m [2m# - `commit` — The head commit's short hash[0m
[107m [0m [2m# - `age` — Time since the last commit[0m
[107m [0m [2m# - `message` — The head commit's subject[0m
[107m [0m [2m#[0m
[107m [0m [2m# A selection mixes built-ins with custom columns (#custom-columns), each named[0m
[107m [0m [2m# by its `[list.custom-columns]` header (`columns = ["branch", "Ticket", "ci"]`),[0m
[107m [0m [2m# and is exhaustive: only the listed columns render. Omit `columns` to keep the[0m
[107m [0m [2m# default set, where custom columns append automatically.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Listing a column forces it on, space permitting: `ci` shows without `--full`. A[0m
[107m [0m [2m# column whose data source is missing still stays hidden — `summary` needs an LLM[0m
[107m [0m [2m# command (`[commit.generation]`), `url` needs a `[list] url` template.[0m
[107m [0m [2m#[0m
[107m [0m [2m# #### Custom columns [experimental][0m
[107m [0m [2m#[0m
[107m [0m [2m# Custom columns add per-branch context to the `wt list` table. Each[0m
[107m [0m [2m# `[list.custom-columns]` entry is a column: the key is the header, the template[0m
[107m [0m [2m# renders each row's cell.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [list.custom-columns.Ticket][0m
[107m [0m [2m# template = "{{ vars.ticket }}" # Required; the result is the cell text[0m
[107m [0m [2m# width = 20 # Optional max display width (default: 40)[0m
[107m [0m [2m# priority = 9 # Optional drop order when the terminal narrows;[0m
[107m [0m [2m# # lower = kept longer (default: 9, the URL band)[0m
[107m [0m [2m#[0m
[107m [0m [2m# Templates may reference `{{ branch }}`, `{{ worktree_path }}`,[0m
[107m [0m [2m# `{{ worktree_name }}` (empty for branch-only rows), and two per-branch[0m
[107m [0m [2m# namespaces:[0m
[107m [0m [2m#[0m
[107m [0m [2m# - `{{ vars.* }}` — values stored with[0m
[107m [0m [2m# `wt config state vars set` (https://worktrunk.dev/config/#wt-config-state-vars).[0m
[107m [0m [2m# - `{{ git.branch.* }}` — the branch's own git config under `branch.<name>.*`,[0m
[107m [0m [2m# read straight from `git config` (e.g. `{{ git.branch.jira }}` for a key you[0m
[107m [0m [2m# set yourself, or the git-native `description`). Git lowercases config variable[0m
[107m [0m [2m# names, so `branch.<name>.nvciShelf` reads as `{{ git.branch.nvcishelf }}`.[0m
[107m [0m [2m#[0m
[107m [0m [2m# All standard filters work (`sanitize`, `hash_port`, `codename`, …). A row[0m
[107m [0m [2m# where the template renders empty (e.g. a branch without the key) shows an[0m
[107m [0m [2m# empty cell; a column that is empty for every row is dropped from the table.[0m
[107m [0m [2m# `wt list --format json` includes the rendered values under[0m
[107m [0m [2m# `items[].display.columns` in schema 2, or under `columns` in schema 1.[0m
[107m [0m [2m#[0m
[107m [0m [2m# A `Jira` column reading a key kept in git config, and a `Summary` column[0m
[107m [0m [2m# showing just the first line of the git-native branch description:[0m
[107m [0m [2m#[0m
[107m [0m [2m# [list.custom-columns.Jira][0m
[107m [0m [2m# template = "{{ git.branch.jira }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# [list.custom-columns.Summary][0m
[107m [0m [2m# template = "{{ git.branch.description | lines | first }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Commit[0m
[107m [0m [2m#[0m
[107m [0m [2m# Shared by `wt step commit`, `wt step squash`, and `wt merge`.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit][0m
[107m [0m [2m# stage = "all" # What to stage before commit: "all", "tracked", or "none"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Merge[0m
[107m [0m [2m#[0m
[107m [0m [2m# Most flags are on by default. Set to false to change default behavior.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [merge][0m
[107m [0m [2m# squash = true # Squash commits into one (--no-squash to preserve history)[0m
[107m [0m [2m# commit = true # Commit uncommitted changes first (--no-commit to skip)[0m
[107m [0m [2m# rebase = true # Rebase onto target before merge (--no-rebase to skip)[0m
[107m [0m [2m# remove = true # Remove worktree after merge (--no-remove to keep)[0m
[107m [0m [2m# verify = true # Run project hooks (--no-hooks to skip)[0m
[107m [0m [2m# ff = true # Fast-forward merge (--no-ff to create a merge commit instead)[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Remove[0m
[107m [0m [2m#[0m
[107m [0m [2m# Persistent flag values for `wt remove`. Override on command line as needed.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [remove][0m
[107m [0m [2m# delete-branch = true # Delete branch after removal (--no-delete-branch to keep)[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Switch[0m
[107m [0m [2m#[0m
[107m [0m [2m# [switch][0m
[107m [0m [2m# cd = true # Change directory after switching (--no-cd to skip)[0m
[107m [0m [2m#[0m
[107m [0m [2m# [switch.picker][0m
[107m [0m [2m# pager = "delta --paging=never" # Example: override git's core.pager for diff preview[0m
[107m [0m [2m# preview = true # Show the preview panel on open (Alt-p toggles)[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Step[0m
[107m [0m [2m#[0m
[107m [0m [2m# [step.copy-ignored][0m
[107m [0m [2m# exclude = [] # Additional excludes (e.g., [".cache/", ".turbo/"])[0m
[107m [0m [2m#[0m
[107m [0m [2m# Built-in excludes (VCS metadata and tool-state directories) always apply; the `wt step copy-ignored` docs (https://worktrunk.dev/step/#wt-step-copy-ignored) list them. User config and project config exclusions are combined.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### User aliases[0m
[107m [0m [2m#[0m
[107m [0m [2m# Command templates that run as `wt <name>`. See the Extending Worktrunk guide (https://worktrunk.dev/extending/#aliases) for usage and flags.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [aliases][0m
[107m [0m [2m# greet = "echo Hello from {{ branch }}"[0m
[107m [0m [2m# url = "echo http://localhost:{{ branch | hash_port }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Aliases defined here apply to all projects. For project-specific aliases, use the project config (https://worktrunk.dev/config/#project-aliases) `[aliases]` section instead.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### User project-specific settings[0m
[107m [0m [2m#[0m
[107m [0m [2m# User config can include a `[projects]` table for project-specific settings — worktree layout, setting overrides, anything else — separate from the project config (https://worktrunk.dev/config/#project-configuration) shared with teammates.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Entries are keyed by project identifier — `<host>/<owner>/<repo>` derived from the primary remote URL (no `.git` suffix; an explicit port other than SSH's default 22 stays with the host, as in `gitlab.example.com:2222/team/project`), or the canonical repo path when there is no remote. Run `wt config show` inside the repo to see the identifier for the current project; it appears in the `PROJECT CONFIG` section as `Identifier: …`.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Scalar values (like `worktree-path`) replace the global value; everything else (hooks, aliases, etc.) appends, global first. See how the layers rank (https://worktrunk.dev/config/#precedence).[0m
[107m [0m [2m#[0m
[107m [0m [2m# [projects."github.com/user/repo"][0m
[107m [0m [2m# worktree-path = ".worktrees/{{ branch | sanitize }}"[0m
[107m [0m [2m# list.full = true[0m
[107m [0m [2m# merge.squash = false[0m
[107m [0m [2m# remove.delete-branch = false[0m
[107m [0m [2m# pre-start.env = "cp .env.example .env"[0m
[107m [0m [2m# step.copy-ignored.exclude = [".repo-local-cache/"][0m
[107m [0m [2m# aliases.deploy = "make deploy BRANCH={{ branch }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# #### Matching several repositories with one entry[0m
[107m [0m [2m#[0m
[107m [0m [2m# A key containing `*` matches any run of characters, `/` included, so one entry covers a whole host or namespace — including nested groups. `*` is the only wildcard; every other character, `.` among them, is literal.[0m
[107m [0m [2m#[0m
[107m [0m [2m# # Every repository on a self-hosted forge whose hostname carries no brand[0m
[107m [0m [2m# [projects."git.company.example/*"][0m
[107m [0m [2m# forge.platform = "gitlab"[0m
[107m [0m [2m#[0m
[107m [0m [2m# # Everything under one namespace shares a layout[0m
[107m [0m [2m# [projects."git.company.example/platform/*"][0m
[107m [0m [2m# worktree-path = ".worktrees/{{ branch | sanitize }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Every matching entry applies, least- to most-specific, following the rule above: a more specific entry — `git.company.example/platform/*` over `git.company.example/*` — wins where both set the same setting, while hooks and aliases from every matching entry all run, least-specific first. A literal key is the most specific of all; specificity is the count of non-`*` characters in the key. End a host-wide key with `/*` — a bare `git.company.example*` also covers hosts whose names merely start
[107m [0m with that string. A remote on a non-default SSH port carries the port in its identifier, so its host-wide key is `git.company.example:2222/*`.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Entries in `approvals.toml` match the same way, so a hand-written pattern entry approves its commands for every repository it covers.[0m
[107m [0m [2m#[0m
[107m [0m [2m# #### Forge platform and hostname[0m
[107m [0m [2m#[0m
[107m [0m [2m# `forge` names the forge for the matched repositories — the user-level counterpart of the project config's forge platform (https://worktrunk.dev/config/#forge-platform) block, for a self-hosted host whose name carries no `github`, `gitlab`, or `gitea` for detection to read.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [projects."git.company.example/*"][0m
[107m [0m [2m# forge.platform = "gitlab" # or "github", "gitea" (experimental), "azure-devops" (experimental)[0m
[107m [0m [2m# forge.hostname = "api.git.company.example" # API host, when the remote's own host isn't it[0m
[107m [0m [2m#[0m
[107m [0m [2m# A repository's own `[forge]` block still wins over any entry here, field by field.[0m
[107m [0m [2m#[0m
[107m [0m [2m# Hooks support all three hook forms (https://worktrunk.dev/hook/#hook-forms). A table runs multiple commands concurrently; an array-of-tables pipeline runs steps in sequence:[0m
[107m [0m [2m#[0m
[107m [0m [2m# # Single command[0m
[107m [0m [2m# [projects."github.com/user/repo"][0m
[107m [0m [2m# post-start = "mise trust"[0m
[107m [0m [2m#[0m
[107m [0m [2m# # Multiple commands, running concurrently[0m
[107m [0m [2m# [projects."github.com/user/repo".post-start][0m
[107m [0m [2m# mise = "mise trust"[0m
[107m [0m [2m# server = "npm run dev"[0m
[107m [0m [2m#[0m
[107m [0m [2m# # Pipeline: steps run in sequence[0m
[107m [0m [2m# [[projects."github.com/user/repo".post-start]][0m
[107m [0m [2m# install = "npm ci"[0m
[107m [0m [2m#[0m
[107m [0m [2m# [[projects."github.com/user/repo".post-start]][0m
[107m [0m [2m# build = "npm run build"[0m
[107m [0m [2m# server = "npm run dev"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ### Custom prompt templates[0m
[107m [0m [2m#[0m
[107m [0m [2m# Templates use minijinja (https://docs.rs/minijinja/) syntax.[0m
[107m [0m [2m#[0m
[107m [0m [2m# #### Commit template[0m
[107m [0m [2m#[0m
[107m [0m [2m# Available variables:[0m
[107m [0m [2m#[0m
[107m [0m [2m# - `{{ git_diff }}`, `{{ git_diff_stat }}` — diff content[0m
[107m [0m [2m# - `{{ branch }}`, `{{ repo }}` — context[0m
[107m [0m [2m# - `{{ recent_commits }}` — recent commit messages[0m
[107m [0m [2m# - `{{ user_guidance }}`, `{{ project_guidance }}` — rendered append fragments (see Appending to the prompt (https://worktrunk.dev/config/#appending-to-the-prompt))[0m
[107m [0m [2m#[0m
[107m [0m [2m# Default template:[0m
[107m [0m [2m#[0m
[107m [0m [2m# <!-- DEFAULT_TEMPLATE_START -->[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# template = """[0m
[107m [0m [2m# <task>Write a commit message for the staged changes below.</task>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <format>[0m
[107m [0m [2m# - Subject line under 50 chars[0m
[107m [0m [2m# - For material changes, add a blank line then a body paragraph explaining the change[0m
[107m [0m [2m# - Output only the commit message, no quotes or code blocks[0m
[107m [0m [2m# </format>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <style>[0m
[107m [0m [2m# - Imperative mood: "Add feature" not "Added feature"[0m
[107m [0m [2m# - Match recent commit style (conventional commits if used)[0m
[107m [0m [2m# - Describe the change, not the intent or benefit[0m
[107m [0m [2m# </style>[0m
[107m [0m [2m# {% if user_guidance %}[0m
[107m [0m [2m# <user-guidance>[0m
[107m [0m [2m# {{ user_guidance }}[0m
[107m [0m [2m# </user-guidance>[0m
[107m [0m [2m# {% endif %}{% if project_guidance %}[0m
[107m [0m [2m# <project-guidance>[0m
[107m [0m [2m# {{ project_guidance }}[0m
[107m [0m [2m# </project-guidance>[0m
[107m [0m [2m# {% endif %}[0m
[107m [0m [2m# <diffstat>[0m
[107m [0m [2m# {{ git_diff_stat }}[0m
[107m [0m [2m# </diffstat>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <diff>[0m
[107m [0m [2m# {{ git_diff }}[0m
[107m [0m [2m# </diff>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <context>[0m
[107m [0m [2m# Branch: {{ branch }}[0m
[107m [0m [2m# {% if recent_commits %}<recent_commits>[0m
[107m [0m [2m# {% for commit in recent_commits %}- {{ commit }}[0m
[107m [0m [2m# {% endfor %}</recent_commits>{% endif %}[0m
[107m [0m [2m# </context>[0m
[107m [0m [2m#[0m
[107m [0m [2m# """[0m
[107m [0m [2m# <!-- DEFAULT_TEMPLATE_END -->[0m
[107m [0m [2m#[0m
[107m [0m [2m# #### Squash template[0m
[107m [0m [2m#[0m
[107m [0m [2m# Available variables (in addition to commit template variables):[0m
[107m [0m [2m#[0m
[107m [0m [2m# - `{{ commit_details }}` — list of commits being squashed; each renders as its subject and exposes `.subject` / `.body`[0m
[107m [0m [2m# - `{{ target_branch }}` — merge target branch[0m
[107m [0m [2m#[0m
[107m [0m [2m# Default template:[0m
[107m [0m [2m#[0m
[107m [0m [2m# <!-- DEFAULT_SQUASH_TEMPLATE_START -->[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# squash-template = """[0m
[107m [0m [2m# <task>Write a commit message for the change in <diff>, which is everything the squash will record. <commits> lists what it folds in.</task>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <format>[0m
[107m [0m [2m# - Subject line under 50 chars[0m
[107m [0m [2m# - For material changes, add a blank line then a body paragraph explaining the change[0m
[107m [0m [2m# - Output only the commit message, no quotes or code blocks[0m
[107m [0m [2m# </format>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <style>[0m
[107m [0m [2m# - Imperative mood: "Add feature" not "Added feature"[0m
[107m [0m [2m# - Match the style of commits being squashed (conventional commits if used)[0m
[107m [0m [2m# - Describe the change, not the intent or benefit[0m
[107m [0m [2m# </style>[0m
[107m [0m [2m# {% if user_guidance %}[0m
[107m [0m [2m# <user-guidance>[0m
[107m [0m [2m# {{ user_guidance }}[0m
[107m [0m [2m# </user-guidance>[0m
[107m [0m [2m# {% endif %}{% if project_guidance %}[0m
[107m [0m [2m# <project-guidance>[0m
[107m [0m [2m# {{ project_guidance }}[0m
[107m [0m [2m# </project-guidance>[0m
[107m [0m [2m# {% endif %}[0m
[107m [0m [2m# <commits branch="{{ branch }}" target="{{ target_branch }}">[0m
[107m [0m [2m# {% for detail in commit_details %}- {{ detail.subject }}[0m
[107m [0m [2m# {% endfor %}</commits>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <diffstat>[0m
[107m [0m [2m# {{ git_diff_stat }}[0m
[107m [0m [2m# </diffstat>[0m
[107m [0m [2m#[0m
[107m [0m [2m# <diff>[0m
[107m [0m [2m# {{ git_diff }}[0m
[107m [0m [2m# </diff>[0m
[107m [0m [2m#[0m
[107m [0m [2m# """[0m
[107m [0m [2m# <!-- DEFAULT_SQUASH_TEMPLATE_END -->[0m
[107m [0m [2m#[0m
[107m [0m [2m# #### Appending to the prompt[0m
[107m [0m [2m#[0m
[107m [0m [2m# `template-append` adds personal conventions to the commit and squash prompts without restating the whole template:[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# template-append = """[0m
[107m [0m [2m# - Explain the rationale in the body, not just the change[0m
[107m [0m [2m# """[0m
[107m [0m [2m#[0m
[107m [0m [2m# See the LLM commits guide (https://worktrunk.dev/llm-commits/#appending-to-the-prompt) for how the fragment renders and its project-config counterpart.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## User hooks[0m
[107m [0m [2m#[0m
[107m [0m [2m# See `wt hook` (https://worktrunk.dev/hook/) for hook types, execution order, template variables, and examples. User hooks apply to all projects; project hooks (https://worktrunk.dev/config/#project-hooks) apply only to that repository.[0m
[1m[32mProject config[0m
With [2m--project[0m, creates [2m.config/wt.toml[0m in the current repository:
[107m [0m [2m# # Project Configuration[0m
[107m [0m [2m#[0m
[107m [0m [2m# Project configuration lets teams share repository-specific settings — hooks, dev server URLs, and other defaults. The file lives in `.config/wt.toml` and is typically checked into version control.[0m
[107m [0m [2m#[0m
[107m [0m [2m# To create a starter file with commented-out examples, run `wt config create --project`.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Project hooks[0m
[107m [0m [2m#[0m
[107m [0m [2m# Project hooks apply to this repository only. See `wt hook` (https://worktrunk.dev/hook/) for hook types, execution order, and examples.[0m
[107m [0m [2m#[0m
[107m [0m [2m# pre-start = "npm ci"[0m
[107m [0m [2m# post-start = "npm run dev"[0m
[107m [0m [2m# pre-merge = "npm test"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Dev server URL[0m
[107m [0m [2m#[0m
[107m [0m [2m# URL column in `wt list` (dimmed when port not listening):[0m
[107m [0m [2m#[0m
[107m [0m [2m# [list][0m
[107m [0m [2m# url = "http://localhost:{{ branch | hash_port }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Forge platform[0m
[107m [0m [2m#[0m
[107m [0m [2m# The forge is read from the remote's hostname: any host carrying `github`, `gitlab`, or `gitea` anywhere in it, plus the Azure DevOps service domains. Name the forge explicitly for a host carrying none of those, such as a Forgejo instance at `forge.example.com`:[0m
[107m [0m [2m#[0m
[107m [0m [2m# [forge][0m
[107m [0m [2m# platform = "github" # or "gitlab", "gitea" (experimental), "azure-devops" (experimental)[0m
[107m [0m [2m# hostname = "github.example.com" # Example: API host (GHE / self-hosted GitLab)[0m
[107m [0m [2m#[0m
[107m [0m [2m# When many repositories share one self-hosted host, name it once in user config with a pattern-keyed `[projects]` entry (https://worktrunk.dev/config/#user-project-specific-settings) instead of repeating this block in each repo. A repository's own `[forge]` still wins, field by field.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Commit-message append[0m
[107m [0m [2m#[0m
[107m [0m [2m# `template-append` adds project-wide conventions to the LLM commit and squash prompts, shared so every teammate's LLM sees the same style guide:[0m
[107m [0m [2m#[0m
[107m [0m [2m# [commit.generation][0m
[107m [0m [2m# template-append = """[0m
[107m [0m [2m# - Use conventional commits (feat:, fix:, docs:, …)[0m
[107m [0m [2m# - Reference the relevant issue ID in the body[0m
[107m [0m [2m# """[0m
[107m [0m [2m#[0m
[107m [0m [2m# The first time the fragment is used (and whenever it changes), `wt` prompts the user to approve it — the same one-shot gate as project-defined hooks. Only `template-append` is honored from the project file; the LLM command and the main prompt template stay in user config (https://worktrunk.dev/config/). See the LLM commits guide (https://worktrunk.dev/llm-commits/#appending-to-the-prompt) for how the fragment renders.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Copy-ignored excludes[0m
[107m [0m [2m#[0m
[107m [0m [2m# Additional excludes for `wt step copy-ignored`:[0m
[107m [0m [2m#[0m
[107m [0m [2m# [step.copy-ignored][0m
[107m [0m [2m# exclude = [".cache/", ".turbo/"][0m
[107m [0m [2m#[0m
[107m [0m [2m# Built-in excludes (VCS metadata and tool-state directories) always apply; the `wt step copy-ignored` docs (https://worktrunk.dev/step/#wt-step-copy-ignored) list them. User config and project config exclusions are combined.[0m
[107m [0m [2m#[0m
[107m [0m [2m# ## Project aliases[0m
[107m [0m [2m#[0m
[107m [0m [2m# Command templates that run as `wt <name>`. See the Extending Worktrunk guide (https://worktrunk.dev/extending/#aliases) for usage and flags.[0m
[107m [0m [2m#[0m
[107m [0m [2m# [aliases][0m
[107m [0m [2m# deploy = "make deploy BRANCH={{ branch }}"[0m
[107m [0m [2m# url = "echo http://localhost:{{ branch | hash_port }}"[0m
[107m [0m [2m#[0m
[107m [0m [2m# Aliases defined here are shared with teammates. For personal aliases, use the user config (https://worktrunk.dev/config/#user-aliases) `[aliases]` section instead.[0m
----- stderr -----