Skip to content

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

feat: Simplify shell template logic

Maximilian Roosfda5cae56927
diff --git a/templates/bash.sh b/templates/bash.sh
index 4fbcce299..7bade8837 100644
--- a/templates/bash.sh
+++ b/templates/bash.sh
@@ -52,7 +52,7 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
return $exit_code
}
- # Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge
+ # Override {{ cmd_prefix }} command to add --internal flag
{{ cmd_prefix }}() {
local use_source=false
local args=()
@@ -76,32 +76,8 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
_WORKTRUNK_CMD="./target/debug/wt"
fi
- # Dispatch based on subcommand
- if [[ ${{ '{' }}#args[@]} -gt 0 ]]; then
- local subcommand="${args[0]}"
-
- case "$subcommand" in
- switch|remove|merge)
- # Commands that need --internal for directory change support
- _wt_exec --internal "${args[@]}"
- ;;
- beta)
- # Check if beta subcommand is select
- if [[ ${{ '{' }}#args[@]} -gt 1 ]] && [[ "${args[1]}" == "select" ]]; then
- _wt_exec --internal "${args[@]}"
- else
- command "$_WORKTRUNK_CMD" "${args[@]}"
- fi
- ;;
- *)
- # All other commands pass through directly
- command "$_WORKTRUNK_CMD" "${args[@]}"
- ;;
- esac
- else
- # No arguments, just run the command
- command "$_WORKTRUNK_CMD"
- fi
+ # Always use --internal mode for directive support
+ _wt_exec --internal "${args[@]}"
# Restore original command
local result=$?
diff --git a/templates/elvish.elv b/templates/elvish.elv
index c169d332c..74ad3eb5f 100644
--- a/templates/elvish.elv
+++ b/templates/elvish.elv
@@ -53,7 +53,7 @@ if (or (has-external wt) (has-env WORKTRUNK_BIN)) {
}
}
- # Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge
+ # Override {{ cmd_prefix }} command to add --internal flag
fn {{ cmd_prefix }} {|@args|
var use-source = $false
var filtered-args = []
@@ -79,30 +79,8 @@ if (or (has-external wt) (has-env WORKTRUNK_BIN)) {
set _WORKTRUNK_CMD = ./target/debug/wt
}
- # Dispatch based on subcommand
- if (== (count $filtered-args) 0) {
- e:$_WORKTRUNK_CMD
- set _WORKTRUNK_CMD = $saved-cmd
- return
- }
-
- var subcommand = $filtered-args[0]
-
- if (or (eq $subcommand "switch") (eq $subcommand "remove") (eq $subcommand "merge")) {
- # Commands that need --internal for directory change support
- var rest-args = $filtered-args[1..]
- _wt_exec --internal $subcommand $@rest-args
- } elif (eq $subcommand ​"beta") {
- # Check if beta subcommand is select
- if (and (> (count $filtered-args) 1) (eq $filtered-args[1] "select")) {
- _wt_exec --internal $@filtered-args
- } else {
- e:$_WORKTRUNK_CMD $@filtered-args
- }
- } else {
- # All other commands pass through directly
- e:$_WORKTRUNK_CMD $@filtered-args
- }
+ # Always use --internal mode for directive support
+ _wt_exec --internal $@filtered-args
# Restore original command
set _WORKTRUNK_CMD = $saved-cmd
diff --git a/templates/fish.fish b/templates/fish.fish
index 71ff4d84c..fedf7ecaf 100644
--- a/templates/fish.fish
+++ b/templates/fish.fish
@@ -88,7 +88,7 @@ if type -q {{ cmd_prefix }}; or set -q WORKTRUNK_BIN
return $exit_code
end
- # Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge
+ # Override {{ cmd_prefix }} command to add --internal flag
function {{ cmd_prefix }}
set -l use_source false
set -l args
@@ -112,29 +112,8 @@ if type -q {{ cmd_prefix }}; or set -q WORKTRUNK_BIN
set _WORKTRUNK_CMD ./target/debug/wt
end
- # Dispatch based on subcommand
- if test (count $args) -gt 0
- set -l subcommand $args[1]
-
- switch $subcommand
- case switch remove merge
- # Commands that need --internal for directory change support
- _wt_exec --internal $args
- case beta
- # Check if beta subcommand is select
- if test (count $args) -gt 1; and test "$args[2]" = "select"
- _wt_exec --internal $args
- else
- command $_WORKTRUNK_CMD $args
- end
- case '*'
- # All other commands pass through directly
- command $_WORKTRUNK_CMD $args
- end
- else
- # No arguments, just run the command
- command $_WORKTRUNK_CMD
- end
+ # Always use --internal mode for directive support
+ _wt_exec --internal $args
# Restore original command
set -l result $status
diff --git a/templates/nushell.nu b/templates/nushell.nu
index f183d26ea..c53d1541a 100644
--- a/templates/nushell.nu
+++ b/templates/nushell.nu
@@ -39,7 +39,7 @@ if (which wt | is-not-empty) or ($env.WORKTRUNK_BIN? | is-not-empty) {
return $result.exit_code
}
- # Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge
+ # Override {{ cmd_prefix }} command to add --internal flag
# Use --wrapped to pass through all flags without parsing them
export def --env --wrapped {{ cmd_prefix }} [...rest] {
mut use_source = false
@@ -66,30 +66,9 @@ if (which wt | is-not-empty) or ($env.WORKTRUNK_BIN? | is-not-empty) {
$_WORKTRUNK_CMD
}
- let subcommand = ($filtered_args | get 0? | default "")
-
- match $subcommand {
- "switch" | "remove" | "merge" => {
- # Commands that need --internal for directory change support
- let rest_args = ($filtered_args | skip 1)
- let internal_args = (["--internal", $subcommand] | append $rest_args)
- let exit_code = (_wt_exec $cmd ...$internal_args)
- return $exit_code
- }
- ​"beta" => {
- # Check if beta subcommand is select
- let dev_subcommand = ($filtered_args | get 1? | default "")
- if $dev_subcommand == "select" {
- let exit_code = (_wt_exec $cmd --internal ...$filtered_args)
- return $exit_code
- } else {
- ^$cmd ...$filtered_args
- }
- }
- _ => {
- # All other commands pass through directly
- ^$cmd ...$filtered_args
- }
- }
+ # Always use --internal mode for directive support
+ let internal_args = (["--internal"] | append $filtered_args)
+ let exit_code = (_wt_exec $cmd ...$internal_args)
+ return $exit_code
}
}
diff --git a/templates/powershell.ps1 b/templates/powershell.ps1
index 2109898a1..0233bee0d 100644
--- a/templates/powershell.ps1
+++ b/templates/powershell.ps1
@@ -49,7 +49,7 @@ if ((Get-Command wt -ErrorAction SilentlyContinue) -or $env:WORKTRUNK_BIN) {
return $exitCode
}
- # Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge
+ # Override {{ cmd_prefix }} command to add --internal flag
function {{ cmd_prefix }} {
param(
[Parameter(ValueFromRemainingArguments=$true)]
@@ -81,35 +81,8 @@ if ((Get-Command wt -ErrorAction SilentlyContinue) -or $env:WORKTRUNK_BIN) {
$cmd = $script:_WORKTRUNK_CMD
}
- if ($filteredArgs.Count -eq 0) {
- & $cmd
- return $LASTEXITCODE
- }
-
- $subcommand = $filteredArgs[0]
-
- switch ($subcommand) {
- { $_ -in @("switch", "remove", "merge") } {
- # Commands that need --internal for directory change support
- $restArgs = $filteredArgs[1..($filteredArgs.Count-1)]
- $exitCode = _wt_exec -Command $cmd --internal $subcommand @restArgs
- return $exitCode
- }
- "beta" {
- # Check if beta subcommand is select
- if ($filteredArgs.Count -gt 1 -and $filteredArgs[1] -eq "select") {
- $exitCode = _wt_exec -Command $cmd --internal @filteredArgs
- return $exitCode
- } else {
- & $cmd @filteredArgs
- return $LASTEXITCODE
- }
- }
- default {
- # All other commands pass through directly
- & $cmd @filteredArgs
- return $LASTEXITCODE
- }
- }
+ # Always use --internal mode for directive support
+ $exitCode = _wt_exec -Command $cmd --internal @filteredArgs
+ return $exitCode
}
}
diff --git a/templates/xonsh.xsh b/templates/xonsh.xsh
index 351ce58f2..e3ff86a72 100644
--- a/templates/xonsh.xsh
+++ b/templates/xonsh.xsh
@@ -43,7 +43,7 @@ if shutil.which("wt") is not None or os.environ.get('WORKTRUNK_BIN'):
return result.returncode
def _{{ cmd_prefix }}_wrapper(args):
- """Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge"""
+ """Override {{ cmd_prefix }} command to add --internal flag"""
use_source = False
filtered_args = []
@@ -65,28 +65,8 @@ if shutil.which("wt") is not None or os.environ.get('WORKTRUNK_BIN'):
else:
cmd = _WORKTRUNK_CMD
- if not filtered_args:
- # No arguments, just run the command
- ![@(cmd)]
- return
-
- subcommand = filtered_args[0]
-
- if subcommand in ["switch", "remove", "merge"]:
- # Commands that need --internal for directory change support
- rest_args = filtered_args[1:]
- return _wt_exec(["--internal", subcommand] + rest_args, cmd=cmd)
- elif subcommand == "beta":
- # Check if beta subcommand is select
- if len(filtered_args) > 1 and filtered_args[1] == "select":
- return _wt_exec(["--internal"] + filtered_args, cmd=cmd)
- else:
- result = ![@(cmd) @(filtered_args)]
- return result.returncode
- else:
- # All other commands pass through directly
- result = ![@(cmd) @(filtered_args)]
- return result.returncode
+ # Always use --internal mode for directive support
+ return _wt_exec(["--internal"] + filtered_args, cmd=cmd)
# Register the alias
aliases['{{ cmd_prefix }}'] = _{{ cmd_prefix }}_wrapper
diff --git a/templates/zsh.zsh b/templates/zsh.zsh
index c1ee35607..48a194136 100644
--- a/templates/zsh.zsh
+++ b/templates/zsh.zsh
@@ -57,7 +57,7 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
return $exit_code
}
- # Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge
+ # Override {{ cmd_prefix }} command to add --internal flag
{{ cmd_prefix }}() {
local use_source=false
local -a args
@@ -81,32 +81,8 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
_WORKTRUNK_CMD="./target/debug/wt"
fi
- # Dispatch based on subcommand (zsh arrays are 1-indexed)
- if [[ ${{ '{' }}#args[@]} -gt 0 ]]; then
- local subcommand="${args[1]}"
-
- case "$subcommand" in
- switch|remove|merge)
- # Commands that need --internal for directory change support
- _wt_exec --internal "${args[@]}"
- ;;
- beta)
- # Check if beta subcommand is select
- if [[ ${{ '{' }}#args[@]} -gt 1 ]] && [[ "${args[2]}" == "select" ]]; then
- _wt_exec --internal "${args[@]}"
- else
- command "$_WORKTRUNK_CMD" "${args[@]}"
- fi
- ;;
- *)
- # All other commands pass through directly
- command "$_WORKTRUNK_CMD" "${args[@]}"
- ;;
- esac
- else
- # No arguments, just run the command
- command "$_WORKTRUNK_CMD"
- fi
+ # Always use --internal mode for directive support
+ _wt_exec --internal "${args[@]}"
# Restore original command
local result=$?
diff --git a/tests/integration_tests/internal_flag.rs b/tests/integration_tests/internal_flag.rs
new file mode 100644
index 000000000..a3da805b5
--- /dev/null
+++ b/tests/integration_tests/internal_flag.rs
@@ -0,0 +1,106 @@
+//! Tests for --internal flag behavior
+//!
+//! Verifies that:
+//! 1. Commands that emit directives work correctly with --internal (already tested in directives.rs)
+//! 2. Commands that DON'T emit directives work correctly with --internal
+//! 3. The --internal flag can be safely passed to all commands
+
+use crate::common::TestRepo;
+use insta::Settings;
+use insta_cmd::{assert_cmd_snapshot, get_cargo_bin};
+use std::fs;
+use std::process::Command;
+use tempfile::TempDir;
+
+/// Test that `list` command works with --internal flag
+///
+/// The list command doesn't emit directives, so output remains newline-terminated.
+/// The --internal flag can be safely passed without changing behavior.
+#[test]
+fn test_list_with_internal_flag() {
+ let repo = TestRepo::new();
+ repo.commit("Initial commit");
+
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+ // Normalize temp directory paths
+ settings.add_filter(r"/private/var/folders/[^\s]+/test-repo", "[REPO]");
+ settings.add_filter(r"/tmp/\.tmp[^\s]+/test-repo", "[REPO]");
+
+ settings.bind(|| {
+ let mut cmd = Command::new(get_cargo_bin("wt"));
+ repo.clean_cli_env(&mut cmd);
+ cmd.arg("--internal")
+ .arg("list")
+ .current_dir(repo.root_path());
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
+
+/// Test that `config list` command works with --internal flag
+///
+/// Config list doesn't emit directives, but should work fine with --internal.
+#[test]
+fn test_config_list_with_internal_flag() {
+ let repo = TestRepo::new();
+ repo.commit("Initial commit");
+ let temp_home = TempDir::new().unwrap();
+
+ // Create fake global config at XDG path
+ let global_config_dir = temp_home.path().join(".config").join("worktrunk");
+ fs::create_dir_all(&global_config_dir).unwrap();
+ fs::write(
+ global_config_dir.join("config.toml"),
+ r#"worktree-path = "../{main-worktree}.{branch}"
+"#,
+ )
+ .unwrap();
+
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+ // Filter out the actual config paths to use placeholders
+ settings.add_filter(repo.root_path().to_str().unwrap(), "[REPO]");
+ settings.add_filter(&temp_home.path().to_string_lossy(), "[TEMP_HOME]");
+ settings.add_filter(r"\\", "/");
+
+ settings.bind(|| {
+ let mut cmd = Command::new(get_cargo_bin("wt"));
+ repo.clean_cli_env(&mut cmd);
+ cmd.arg("--internal")
+ .arg("config")
+ .arg("list")
+ .env("HOME", temp_home.path())
+ .env("XDG_CONFIG_HOME", temp_home.path().join(".config"))
+ .current_dir(repo.root_path());
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
+
+/// Test that `complete` command works with --internal flag
+///
+/// Complete doesn't emit directives, but should work fine with --internal.
+/// This verifies that completion output is properly handled in directive mode.
+#[test]
+fn test_complete_with_internal_flag() {
+ let mut repo = TestRepo::new();
+ repo.commit("Initial commit");
+ // Add a worktree so we have branch names to complete
+ repo.add_worktree("feature", "feature");
+
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+
+ settings.bind(|| {
+ let mut cmd = Command::new(get_cargo_bin("wt"));
+ repo.clean_cli_env(&mut cmd);
+ cmd.arg("--internal")
+ .arg("complete")
+ .arg("wt")
+ .arg("switch")
+ .current_dir(repo.root_path());
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
diff --git a/tests/integration_tests/mod.rs b/tests/integration_tests/mod.rs
index 51c1cb1df..1833e4fc9 100644
--- a/tests/integration_tests/mod.rs
+++ b/tests/integration_tests/mod.rs
@@ -16,6 +16,7 @@ pub mod directives;
pub mod e2e_shell;
pub mod e2e_shell_post_start;
pub mod init;
+pub mod internal_flag;
pub mod list;
pub mod merge;
pub mod post_start_commands;
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index 2b543d652..e9d7c6df0 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCRPK4I/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmptXkzWb/test-config.toml
---
success: true
exit_code: 0
@@ -75,7 +75,7 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
return $exit_code
}
- # Override wt command to add --internal flag for switch, remove, and merge
+ # Override wt command to add --internal flag
wt() {
local use_source=false
local args=()
@@ -99,32 +99,8 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
_WORKTRUNK_CMD="./target/debug/wt"
fi
- # Dispatch based on subcommand
- if [[ ${#args[@]} -gt 0 ]]; then
- local subcommand="${args[0]}"
-
- case "$subcommand" in
- switch|remove|merge)
- # Commands that need --internal for directory change support
- _wt_exec --internal "${args[@]}"
- ;;
- beta)
- # Check if beta subcommand is select
- if [[ ${#args[@]} -gt 1 ]] && [[ "${args[1]}" == "select" ]]; then
- _wt_exec --internal "${args[@]}"
- else
- command "$_WORKTRUNK_CMD" "${args[@]}"
- fi
- ;;
- *)
- # All other commands pass through directly
- command "$_WORKTRUNK_CMD" "${args[@]}"
- ;;
- esac
- else
- # No arguments, just run the command
- command "$_WORKTRUNK_CMD"
- fi
+ # Always use --internal mode for directive support
+ _wt_exec --internal "${args[@]}"
# Restore original command
local result=$?
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index e74551bc5..58f2d735a 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQ1zKBh/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpgOUHEq/test-config.toml
---
success: true
exit_code: 0
@@ -111,7 +111,7 @@ if type -q wt; or set -q WORKTRUNK_BIN
return $exit_code
end
- # Override wt command to add --internal flag for switch, remove, and merge
+ # Override wt command to add --internal flag
function wt
set -l use_source false
set -l args
@@ -135,29 +135,8 @@ if type -q wt; or set -q WORKTRUNK_BIN
set _WORKTRUNK_CMD ./target/debug/wt
end
- # Dispatch based on subcommand
- if test (count $args) -gt 0
- set -l subcommand $args[1]
-
- switch $subcommand
- case switch remove merge
- # Commands that need --internal for directory change support
- _wt_exec --internal $args
- case beta
- # Check if beta subcommand is select
- if test (count $args) -gt 1; and test "$args[2]" = "select"
- _wt_exec --internal $args
- else
- command $_WORKTRUNK_CMD $args
- end
- case '*'
- # All other commands pass through directly
- command $_WORKTRUNK_CMD $args
- end
- else
- # No arguments, just run the command
- command $_WORKTRUNK_CMD
- end
+ # Always use --internal mode for directive support
+ _wt_exec --internal $args
# Restore original command
set -l result $status
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index 33a95645f..8728bded9 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpGm8Bss/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyaWw3x/test-config.toml
---
success: true
exit_code: 0
@@ -80,7 +80,7 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
return $exit_code
}
- # Override wt command to add --internal flag for switch, remove, and merge
+ # Override wt command to add --internal flag
wt() {
local use_source=false
local -a args
@@ -104,32 +104,8 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then
_WORKTRUNK_CMD="./target/debug/wt"
fi
- # Dispatch based on subcommand (zsh arrays are 1-indexed)
- if [[ ${#args[@]} -gt 0 ]]; then
- local subcommand="${args[1]}"
-
- case "$subcommand" in
- switch|remove|merge)
- # Commands that need --internal for directory change support
- _wt_exec --internal "${args[@]}"
- ;;
- beta)
- # Check if beta subcommand is select
- if [[ ${#args[@]} -gt 1 ]] && [[ "${args[2]}" == "select" ]]; then
- _wt_exec --internal "${args[@]}"
- else
- command "$_WORKTRUNK_CMD" "${args[@]}"
- fi
- ;;
- *)
- # All other commands pass through directly
- command "$_WORKTRUNK_CMD" "${args[@]}"
- ;;
- esac
- else
- # No arguments, just run the command
- command "$_WORKTRUNK_CMD"
- fi
+ # Always use --internal mode for directive support
+ _wt_exec --internal "${args[@]}"
# Restore original command
local result=$?
diff --git a/tests/snapshots/integration__integration_tests__internal_flag__complete_with_internal_flag.snap b/tests/snapshots/integration__integration_tests__internal_flag__complete_with_internal_flag.snap
new file mode 100644
index 000000000..1a10f471e
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__internal_flag__complete_with_internal_flag.snap
@@ -0,0 +1,29 @@
+---
+source: tests/integration_tests/internal_flag.rs
+info:
+ program: wt
+ args:
+ - "--internal"
+ - complete
+ - wt
+ - switch
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpOXsiBo/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+feature
+main
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__internal_flag__config_list_with_internal_flag.snap b/tests/snapshots/integration__integration_tests__internal_flag__config_list_with_internal_flag.snap
new file mode 100644
index 000000000..79acf758b
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__internal_flag__config_list_with_internal_flag.snap
@@ -0,0 +1,33 @@
+---
+source: tests/integration_tests/internal_flag.rs
+info:
+ program: wt
+ args:
+ - "--internal"
+ - config
+ - list
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpskwBN8
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpy2lPIB/test-config.toml
+ XDG_CONFIG_HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpskwBN8/.config
+---
+success: true
+exit_code: 0
+----- stdout -----
+⚪ Global Config: [TEMP_HOME]/.config/worktrunk/config.toml
+  worktree-path = "../{main-worktree}.{branch}"
+
+⚪ Project Config: [REPO]/.config/wt.toml
+💡 Not found
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__internal_flag__list_with_internal_flag.snap b/tests/snapshots/integration__integration_tests__internal_flag__list_with_internal_flag.snap
new file mode 100644
index 000000000..e94c5ec1c
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__internal_flag__list_with_internal_flag.snap
@@ -0,0 +1,29 @@
+---
+source: tests/integration_tests/internal_flag.rs
+info:
+ program: wt
+ args:
+ - "--internal"
+ - list
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpboPt5P/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+Branch Status HEAD± main↕ Path Remote↕ Commit  Age  Message
+main  .  b834638e 10 months ago Initial commit
+
+⚪ Showing 1 worktree
+
+----- stderr -----