Skip to content

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

Improve config validation warnings with cross-config suggestions (#804)

Maximilian Roosb557372b3669
diff --git a/src/commands/config/mod.rs b/src/commands/config/mod.rs
index afefc4ed0..7c7c81877 100644
--- a/src/commands/config/mod.rs
+++ b/src/commands/config/mod.rs
@@ -18,8 +18,11 @@ pub use state::{
#[cfg(test)]
mod tests {
+ use std::collections::HashMap;
use std::path::PathBuf;
+ use worktrunk::config::{ProjectConfig, UserConfig};
+
use super::create::comment_out_config;
use super::show::{render_ci_tool_status, warn_unknown_keys};
use super::state::{get_user_config_path, require_user_config_path, resolve_user_config_path};
@@ -118,27 +121,68 @@ mod tests {
#[test]
fn test_warn_unknown_keys_empty() {
- let mut out = String::new();
- warn_unknown_keys(&mut out, &[]).unwrap();
+ let out = warn_unknown_keys::<UserConfig>(&HashMap::new());
assert!(out.is_empty());
}
#[test]
fn test_warn_unknown_keys_single() {
- let mut out = String::new();
- warn_unknown_keys(&mut out, &["unknown-key".to_string()]).unwrap();
+ let mut unknown = HashMap::new();
+ unknown.insert(
+ "unknown-key".to_string(),
+ toml::Value::String("value".to_string()),
+ );
+ let out = warn_unknown_keys::<UserConfig>(&unknown);
assert!(out.contains("unknown-key"));
- assert!(out.contains("Unknown key"));
+ assert!(out.contains("Unknown"));
}
#[test]
fn test_warn_unknown_keys_multiple() {
- let mut out = String::new();
- warn_unknown_keys(&mut out, &["key1".to_string(), "key2".to_string()]).unwrap();
+ let mut unknown = HashMap::new();
+ unknown.insert(
+ "key1".to_string(),
+ toml::Value::String("value1".to_string()),
+ );
+ unknown.insert(
+ "key2".to_string(),
+ toml::Value::String("value2".to_string()),
+ );
+ let out = warn_unknown_keys::<UserConfig>(&unknown);
assert!(out.contains("key1"));
assert!(out.contains("key2"));
- // Should have two separate warning lines
- assert_eq!(out.matches("Unknown key").count(), 2);
+ }
+
+ #[test]
+ fn test_warn_unknown_keys_suggests_other_config() {
+ // Test: commit-generation in project config should suggest user config
+ let mut unknown = HashMap::new();
+ // Build a commit-generation table value
+ let mut inner = toml::map::Map::new();
+ inner.insert(
+ "command".to_string(),
+ toml::Value::String("claude".to_string()),
+ );
+ unknown.insert("commit-generation".to_string(), toml::Value::Table(inner));
+ let out = warn_unknown_keys::<ProjectConfig>(&unknown);
+ assert!(
+ out.contains("user config"),
+ "Should suggest user config for commit-generation in project config: {out}"
+ );
+
+ // Test: ci in user config should suggest project config
+ let mut unknown = HashMap::new();
+ let mut inner = toml::map::Map::new();
+ inner.insert(
+ "platform".to_string(),
+ toml::Value::String("github".to_string()),
+ );
+ unknown.insert("ci".to_string(), toml::Value::Table(inner));
+ let out = warn_unknown_keys::<UserConfig>(&unknown);
+ assert!(
+ out.contains("project config"),
+ "Should suggest project config for ci in user config: {out}"
+ );
}
// ==================== render_ci_tool_status tests ====================
diff --git a/src/commands/config/show.rs b/src/commands/config/show.rs
index 9a1710044..b53049e96 100644
--- a/src/commands/config/show.rs
+++ b/src/commands/config/show.rs
@@ -340,7 +340,9 @@ fn render_user_config(out: &mut String) -> anyhow::Result<()> {
writeln!(out, "{}", format_with_gutter(&e.to_string(), None))?;
} else {
// Only check for unknown keys if config is valid
- warn_unknown_keys(out, &find_unknown_user_keys(&contents))?;
+ out.push_str(&warn_unknown_keys::<UserConfig>(&find_unknown_user_keys(
+ &contents,
+ )));
}
// Display TOML with syntax highlighting (gutter at column 0)
@@ -349,16 +351,31 @@ fn render_user_config(out: &mut String) -> anyhow::Result<()> {
Ok(())
}
-/// Write warnings for any unknown config keys
-pub(super) fn warn_unknown_keys(out: &mut String, unknown_keys: &[String]) -> anyhow::Result<()> {
- for key in unknown_keys {
- writeln!(
- out,
- "{}",
- warning_message(cformat!("Unknown key <bold>{key}</> will be ignored"))
- )?;
+/// Format warnings for any unknown config keys.
+///
+/// Generic over `C`, the config type where the keys were found. When an unknown
+/// key belongs in `C::Other`, the warning includes a hint about where to move it.
+pub(super) fn warn_unknown_keys<C: worktrunk::config::WorktrunkConfig>(
+ unknown_keys: &std::collections::HashMap<String, toml::Value>,
+) -> String {
+ use std::fmt::Write;
+ let mut out = String::new();
+
+ // Sort keys for deterministic output order
+ let mut keys: Vec<_> = unknown_keys.keys().collect();
+ keys.sort();
+
+ for key in keys {
+ let value = &unknown_keys[key];
+ let msg = match worktrunk::config::key_belongs_in::<C>(key, value) {
+ Some(location) => {
+ cformat!("Key <bold>{key}</> belongs in {location} (will be ignored)")
+ }
+ None => cformat!("Unknown key <bold>{key}</> will be ignored"),
+ };
+ let _ = writeln!(out, "{}", warning_message(msg));
}
- Ok(())
+ out
}
fn render_project_config(out: &mut String) -> anyhow::Result<()> {
@@ -409,7 +426,9 @@ fn render_project_config(out: &mut String) -> anyhow::Result<()> {
writeln!(out, "{}", format_with_gutter(&e.to_string(), None))?;
} else {
// Only check for unknown keys if config is valid
- warn_unknown_keys(out, &find_unknown_project_keys(&contents))?;
+ out.push_str(&warn_unknown_keys::<ProjectConfig>(
+ &find_unknown_project_keys(&contents),
+ ));
}
// Display TOML with syntax highlighting (gutter at column 0)
diff --git a/src/config/deprecation.rs b/src/config/deprecation.rs
index eb8168fe7..c5fc6c17d 100644
--- a/src/config/deprecation.rs
+++ b/src/config/deprecation.rs
@@ -11,12 +11,13 @@
//! To regenerate a project config migration file, run `wt config state hints clear deprecated-project-config`.
//! To regenerate a user config migration file, delete the existing `.new` file.
+use crate::config::WorktrunkConfig;
use crate::styling::{eprintln, hint_message, warning_message};
use color_print::cformat;
use minijinja::Environment;
use shell_escape::escape;
use std::borrow::Cow;
-use std::collections::HashSet;
+use std::collections::{HashMap, HashSet};
use std::io::Write;
use std::path::{Path, PathBuf};
use std::sync::{LazyLock, Mutex};
@@ -278,14 +279,32 @@ pub fn check_and_migrate(
Ok(true)
}
+/// Returns the config location where this key belongs, if it's in the wrong config.
+///
+/// Generic over `C`, the config type where the key was found. If the key would
+/// be valid in `C::Other`, returns that config's description.
+///
+/// For example, `key_belongs_in::<ProjectConfig>("commit-generation", value)` returns
+/// `Some("user config")`.
+/// Returns `None` if the key is truly unknown (not valid in either config).
+pub fn key_belongs_in<C: WorktrunkConfig>(key: &str, value: &toml::Value) -> Option<&'static str> {
+ C::Other::is_valid_key(key, value).then(C::Other::description)
+}
+
/// Warn about unknown fields in config file
///
-/// Emits a warning for each unknown field, deduplicated per path per process.
-/// Unlike deprecated vars, there's no migration file — the warning just repeats
-/// until the user removes or fixes the unknown field.
+/// Generic over `C`, the config type being loaded. Emits a warning for each
+/// unknown field, deduplicated per path per process.
+///
+/// When an unknown key belongs in the other config type (`C::Other`),
+/// the warning includes a hint about where to move it.
///
/// The `label` is used in the warning message (e.g., "User config" or "Project config").
-pub fn warn_unknown_fields(path: &Path, unknown_keys: &[String], label: &str) {
+pub fn warn_unknown_fields<C: WorktrunkConfig>(
+ path: &Path,
+ unknown_keys: &HashMap<String, toml::Value>,
+ label: &str,
+) {
if unknown_keys.is_empty() {
return;
}
@@ -300,23 +319,28 @@ pub fn warn_unknown_fields(path: &Path, unknown_keys: &[String], label: &str) {
guard.insert(canonical_path);
}
- // Build inline list of unknown keys
- let keys_display: Vec<String> = unknown_keys
- .iter()
- .map(|k| cformat!("<bold>{}</>", k))
- .collect();
+ // Sort keys for deterministic output order
+ let mut keys: Vec<_> = unknown_keys.keys().collect();
+ keys.sort();
- let warning = format!(
- "{} has unknown {}: {} (will be ignored)",
- label,
- if unknown_keys.len() == 1 {
- "field"
+ for key in keys {
+ let value = &unknown_keys[key];
+ if let Some(other_location) = key_belongs_in::<C>(key, value) {
+ eprintln!(
+ "{}",
+ warning_message(cformat!(
+ "{label} has key <bold>{key}</> which belongs in {other_location} (will be ignored)"
+ ))
+ );
} else {
- "fields"
- },
- keys_display.join(", ")
- );
- eprintln!("{}", warning_message(warning));
+ eprintln!(
+ "{}",
+ warning_message(cformat!(
+ "{label} has unknown field <bold>{key}</> (will be ignored)"
+ ))
+ );
+ }
+ }
// Flush stderr to ensure output appears before any subsequent messages
std::io::stderr().flush().ok();
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 1c7033cf3..4292eb999 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -24,11 +24,63 @@ mod project;
mod test;
mod user;
+use std::collections::HashMap;
+
+/// Trait for worktrunk config types (user and project config).
+///
+/// Both config types capture unrecognized fields during parsing, allowing
+/// validation to detect misplaced or misspelled keys. The `Other` associated
+/// type enables checking whether a key belongs in the other config.
+pub trait WorktrunkConfig: for<'de> serde::Deserialize<'de> + Sized {
+ /// The other config type (UserConfig ↔ ProjectConfig).
+ type Other: WorktrunkConfig;
+
+ /// Returns the map of unknown fields captured during deserialization.
+ fn unknown(&self) -> &HashMap<String, toml::Value>;
+
+ /// Human-readable description of where this config lives.
+ fn description() -> &'static str;
+
+ /// Check if a key+value would be valid in this config type.
+ fn is_valid_key(key: &str, value: &toml::Value) -> bool {
+ let mut table = toml::map::Map::new();
+ table.insert(key.to_string(), value.clone());
+ toml::Value::Table(table)
+ .try_into::<Self>()
+ .map(|c| !c.unknown().contains_key(key))
+ .unwrap_or(false)
+ }
+}
+
+impl WorktrunkConfig for UserConfig {
+ type Other = ProjectConfig;
+
+ fn unknown(&self) -> &HashMap<String, toml::Value> {
+ &self.unknown
+ }
+
+ fn description() -> &'static str {
+ "user config"
+ }
+}
+
+impl WorktrunkConfig for ProjectConfig {
+ type Other = UserConfig;
+
+ fn unknown(&self) -> &HashMap<String, toml::Value> {
+ &self.unknown
+ }
+
+ fn description() -> &'static str {
+ "project config"
+ }
+}
+
// Re-export public types
pub use commands::{Command, CommandConfig};
pub use deprecation::check_and_migrate as check_deprecated_vars;
pub use deprecation::normalize_template_vars;
-pub use deprecation::warn_unknown_fields;
+pub use deprecation::{key_belongs_in, warn_unknown_fields};
pub use expansion::{
DEPRECATED_TEMPLATE_VARS, TEMPLATE_VARS, expand_template, redact_credentials,
sanitize_branch_name, sanitize_db,
@@ -741,7 +793,8 @@ squash-template-file = "~/file.txt"
fn test_find_unknown_project_keys_with_typo() {
let toml_str = "[post-merge-command]\ndeploy = \"task deploy\"";
let unknown = find_unknown_project_keys(toml_str);
- assert_eq!(unknown, vec!["post-merge-command"]);
+ assert!(unknown.contains_key("post-merge-command"));
+ assert_eq!(unknown.len(), 1);
}
#[test]
@@ -757,15 +810,16 @@ squash-template-file = "~/file.txt"
let toml_str = "[post-merge-command]\ndeploy = \"task deploy\"\n\n[after-create]\nsetup = \"npm install\"";
let unknown = find_unknown_project_keys(toml_str);
assert_eq!(unknown.len(), 2);
- assert!(unknown.contains(&"post-merge-command".to_string()));
- assert!(unknown.contains(&"after-create".to_string()));
+ assert!(unknown.contains_key("post-merge-command"));
+ assert!(unknown.contains_key("after-create"));
}
#[test]
fn test_find_unknown_user_keys_with_typo() {
let toml_str = "worktree-path = \"../test\"\n\n[commit-gen]\ncommand = \"llm\"";
let unknown = find_unknown_user_keys(toml_str);
- assert_eq!(unknown, vec!["commit-gen"]);
+ assert!(unknown.contains_key("commit-gen"));
+ assert_eq!(unknown.len(), 1);
}
#[test]
@@ -849,4 +903,46 @@ test = "cargo test"
unknown
);
}
+
+ #[test]
+ fn test_user_config_key_in_project_config_is_detected() {
+ // commit-generation is a user-config-only key
+ let toml_str = r#"
+[commit-generation]
+command = "claude"
+"#;
+ let unknown = find_unknown_project_keys(toml_str);
+ assert!(
+ unknown.contains_key("commit-generation"),
+ "commit-generation should be unknown in project config"
+ );
+
+ // Verify it's valid in user config
+ let unknown_in_user = find_unknown_user_keys(toml_str);
+ assert!(
+ unknown_in_user.is_empty(),
+ "commit-generation should be valid in user config"
+ );
+ }
+
+ #[test]
+ fn test_project_config_key_in_user_config_is_detected() {
+ // ci is a project-config-only key
+ let toml_str = r#"
+[ci]
+platform = "github"
+"#;
+ let unknown = find_unknown_user_keys(toml_str);
+ assert!(
+ unknown.contains_key("ci"),
+ "ci should be unknown in user config"
+ );
+
+ // Verify it's valid in project config
+ let unknown_in_project = find_unknown_project_keys(toml_str);
+ assert!(
+ unknown_in_project.is_empty(),
+ "ci should be valid in project config"
+ );
+ }
}
diff --git a/src/config/project.rs b/src/config/project.rs
index 29aef62c2..02ddde4e1 100644
--- a/src/config/project.rs
+++ b/src/config/project.rs
@@ -110,7 +110,7 @@ pub struct ProjectConfig {
/// Captures unknown fields for validation warnings
#[serde(flatten, default, skip_serializing)]
- unknown: std::collections::HashMap<String, toml::Value>,
+ pub unknown: std::collections::HashMap<String, toml::Value>,
}
impl ProjectConfig {
@@ -152,7 +152,11 @@ impl ProjectConfig {
// Warn about unknown fields (only in main worktree where it's actionable)
if is_main_worktree {
let unknown_keys = find_unknown_keys(&contents);
- super::deprecation::warn_unknown_fields(&config_path, &unknown_keys, "Project config");
+ super::deprecation::warn_unknown_fields::<ProjectConfig>(
+ &config_path,
+ &unknown_keys,
+ "Project config",
+ );
}
let config: ProjectConfig = toml::from_str(&contents)
@@ -164,15 +168,16 @@ impl ProjectConfig {
/// Find unknown keys in project config TOML content
///
-/// Returns a list of unrecognized top-level keys that will be silently ignored.
+/// Returns a map of unrecognized top-level keys (with their values) that will be ignored.
/// Uses serde deserialization with flatten to automatically detect unknown fields.
-pub fn find_unknown_keys(contents: &str) -> Vec<String> {
+/// The values are included to allow checking if keys belong in the other config type.
+pub fn find_unknown_keys(contents: &str) -> std::collections::HashMap<String, toml::Value> {
// Deserialize into ProjectConfig - unknown fields are captured in the `unknown` map
let Ok(config) = toml::from_str::<ProjectConfig>(contents) else {
- return vec![];
+ return std::collections::HashMap::new();
};
- config.unknown.into_keys().collect()
+ config.unknown
}
#[cfg(test)]
@@ -389,7 +394,7 @@ unknown-key = "value"
"#;
let keys = find_unknown_keys(contents);
assert_eq!(keys.len(), 1);
- assert!(keys.contains(&"unknown-key".to_string()));
+ assert!(keys.contains_key("unknown-key"));
}
#[test]
@@ -401,8 +406,8 @@ post-create = "npm install"
"#;
let keys = find_unknown_keys(contents);
assert_eq!(keys.len(), 2);
- assert!(keys.contains(&"foo".to_string()));
- assert!(keys.contains(&"baz".to_string()));
+ assert!(keys.contains_key("foo"));
+ assert!(keys.contains_key("baz"));
}
// ============================================================================
diff --git a/src/config/user.rs b/src/config/user.rs
index 239217679..6e822fb77 100644
--- a/src/config/user.rs
+++ b/src/config/user.rs
@@ -225,7 +225,7 @@ pub struct UserConfig {
/// Captures unknown fields for validation warnings
#[serde(flatten, default, skip_serializing)]
- pub(crate) unknown: std::collections::HashMap<String, toml::Value>,
+ pub unknown: std::collections::HashMap<String, toml::Value>,
}
/// Configuration for commit message generation
@@ -609,7 +609,11 @@ impl UserConfig {
// (must check file content directly, not config.unknown, because
// config.unknown includes env vars which shouldn't trigger warnings)
let unknown_keys = find_unknown_keys(&content);
- super::deprecation::warn_unknown_fields(config_path, &unknown_keys, "User config");
+ super::deprecation::warn_unknown_fields::<UserConfig>(
+ config_path,
+ &unknown_keys,
+ "User config",
+ );
}
builder = builder.add_source(File::from(config_path.clone()));
@@ -1203,15 +1207,16 @@ pub fn get_config_path() -> Option<PathBuf> {
/// Find unknown keys in user config TOML content
///
-/// Returns a list of unrecognized top-level keys that will be silently ignored.
+/// Returns a map of unrecognized top-level keys (with their values) that will be ignored.
/// Uses serde deserialization with flatten to automatically detect unknown fields.
-pub fn find_unknown_keys(contents: &str) -> Vec<String> {
+/// The values are included to allow checking if keys belong in the other config type.
+pub fn find_unknown_keys(contents: &str) -> std::collections::HashMap<String, toml::Value> {
// Deserialize into UserConfig - unknown fields are captured in the `unknown` map
let Ok(config) = toml::from_str::<UserConfig>(contents) else {
- return vec![];
+ return std::collections::HashMap::new();
};
- config.unknown.into_keys().collect()
+ config.unknown
}
#[cfg(test)]
@@ -1261,8 +1266,8 @@ unknown-key = "value"
another-unknown = 42
"#;
let keys = find_unknown_keys(content);
- assert!(keys.contains(&"unknown-key".to_string()));
- assert!(keys.contains(&"another-unknown".to_string()));
+ assert!(keys.contains_key("unknown-key"));
+ assert!(keys.contains_key("another-unknown"));
}
#[test]
diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rs
index 088c76197..8029e000f 100644
--- a/tests/integration_tests/config_show.rs
+++ b/tests/integration_tests/config_show.rs
@@ -365,6 +365,104 @@ fn test_config_show_warns_unknown_user_keys(mut repo: TestRepo, temp_home: TempD
});
}
+/// Tests that loading a config with a truly unknown key (not valid in either config type)
+/// emits a warning during config loading (not just config show).
+#[rstest]
+fn test_unknown_project_key_warning_during_load(repo: TestRepo, temp_home: TempDir) {
+ // Create project config with truly unknown key (not valid in either config type)
+ let config_dir = repo.root_path().join(".config");
+ fs::create_dir_all(&config_dir).unwrap();
+ fs::write(
+ config_dir.join("wt.toml"),
+ "[invalid-section-name]\nkey = \"value\"",
+ )
+ .unwrap();
+
+ // Run `wt list` which loads project config via ProjectConfig::load()
+ // This triggers warn_unknown_fields (different from warn_unknown_keys used by config show)
+ let mut cmd = repo.wt_command();
+ cmd.arg("list").current_dir(repo.root_path());
+ set_temp_home_env(&mut cmd, temp_home.path());
+
+ let output = cmd.output().unwrap();
+ assert!(
+ output.status.success(),
+ "Command should succeed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ stderr.contains("has unknown field"),
+ "Expected unknown field warning during config load, got: {stderr}"
+ );
+}
+
+/// Tests that when a user-config-only key (commit-generation) appears in project config,
+/// the warning suggests moving it to user config.
+#[rstest]
+fn test_config_show_suggests_user_config_for_commit_generation(
+ mut repo: TestRepo,
+ temp_home: TempDir,
+) {
+ repo.setup_mock_ci_tools_unauthenticated();
+
+ // Create empty global config
+ 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"),
+ "worktree-path = \"../{{ repo }}.{{ branch }}\"",
+ )
+ .unwrap();
+
+ // Create project config with commit-generation (which belongs in user config)
+ let config_dir = repo.root_path().join(".config");
+ fs::create_dir_all(&config_dir).unwrap();
+ fs::write(
+ config_dir.join("wt.toml"),
+ "[commit-generation]\ncommand = \"claude\"",
+ )
+ .unwrap();
+
+ let settings = setup_snapshot_settings_with_home(&repo, &temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ repo.configure_wt_cmd(&mut cmd);
+ repo.configure_mock_commands(&mut cmd);
+ cmd.arg("config").arg("show").current_dir(repo.root_path());
+ set_temp_home_env(&mut cmd, temp_home.path());
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
+
+/// Tests that when a project-config-only key (ci) appears in user config,
+/// the warning suggests moving it to project config.
+#[rstest]
+fn test_config_show_suggests_project_config_for_ci(mut repo: TestRepo, temp_home: TempDir) {
+ repo.setup_mock_ci_tools_unauthenticated();
+
+ // Create global config with ci section (which belongs in project config)
+ 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"),
+ "worktree-path = \"../{{ repo }}.{{ branch }}\"\n\n[ci]\nplatform = \"github\"",
+ )
+ .unwrap();
+
+ let settings = setup_snapshot_settings_with_home(&repo, &temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ repo.configure_wt_cmd(&mut cmd);
+ repo.configure_mock_commands(&mut cmd);
+ cmd.arg("config").arg("show").current_dir(repo.root_path());
+ set_temp_home_env(&mut cmd, temp_home.path());
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
+
#[rstest]
fn test_config_show_invalid_user_toml(mut repo: TestRepo, temp_home: TempDir) {
repo.setup_mock_ci_tools_unauthenticated();
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
new file mode 100644
index 000000000..f013784eb
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_project_config_for_ci.snap
@@ -0,0 +1,60 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - show
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ GIT_TERMINAL_PROMPT: "0"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ PATH: "[PATH]"
+ RUST_LOG: warn
+ SHELL: ""
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_EPOCH: "1735776000"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+USER CONFIG ~/.config/worktrunk/config.toml
+▲ Key ci belongs in project config (will be ignored)
+  worktree-path = "../{{ repo }}.{{ branch }}"
+ 
+  [ci]
+  platform = "github"
+
+PROJECT CONFIG _REPO_/.config/wt.toml
+↳ Not found
+
+SHELL INTEGRATION
+▲ Shell integration not active
+  Invoked as: [PROJECT_ROOT]/target/debug/wt
+
+○ Skipped bash; ~/.bashrc not found
+○ Skipped zsh; ~/.zshrc not found
+○ Skipped fish; ~/.config/fish/functions not found
+
+OTHER
+○ wt: [VERSION]
+○ git: [VERSION]
+↳ Claude Code plugin not installed (claude not found)
+○ Hyperlinks: inactive
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
new file mode 100644
index 000000000..3a36037ee
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_suggests_user_config_for_commit_generation.snap
@@ -0,0 +1,58 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - show
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ GIT_TERMINAL_PROMPT: "0"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
+ PATH: "[PATH]"
+ RUST_LOG: warn
+ SHELL: ""
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WT_TEST_DELAYED_STREAM_MS: "-1"
+ WT_TEST_EPOCH: "1735776000"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+USER CONFIG ~/.config/worktrunk/config.toml
+  worktree-path = "../{{ repo }}.{{ branch }}"
+
+PROJECT CONFIG _REPO_/.config/wt.toml
+▲ Key commit-generation belongs in user config (will be ignored)
+  [commit-generation]
+  command = "claude"
+
+SHELL INTEGRATION
+▲ Shell integration not active
+  Invoked as: [PROJECT_ROOT]/target/debug/wt
+
+○ Skipped bash; ~/.bashrc not found
+○ Skipped zsh; ~/.zshrc not found
+○ Skipped fish; ~/.config/fish/functions not found
+
+OTHER
+○ wt: [VERSION]
+○ git: [VERSION]
+↳ Claude Code plugin not installed (claude not found)
+○ Hyperlinks: inactive