From e0cfd37a4606bcfd2bcb49fb2a88e9f4d4e929c9 Mon Sep 17 00:00:00 2001 From: Tushar Date: Tue, 14 Apr 2026 19:16:54 +0530 Subject: [PATCH 1/2] fix(command-list): include custom commands in non-porcelain list output --- crates/forge_main/src/ui.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/forge_main/src/ui.rs b/crates/forge_main/src/ui.rs index aa68c7318e..8a5944813d 100644 --- a/crates/forge_main/src/ui.rs +++ b/crates/forge_main/src/ui.rs @@ -1388,7 +1388,11 @@ impl A + Send + Sync> UI self.writeln(porcelain)?; } else { // Non-porcelain: render in the same flat format as :help in the REPL. + // Fetch custom commands from the API (same as the porcelain path) so + // they appear alongside the built-in commands. let command_manager = ForgeCommandManager::default(); + let custom_commands = self.api.get_commands().await?; + command_manager.register_all(custom_commands); let info = Info::from(&command_manager); self.writeln(info)?; } From 512ad7c0bbc20b5bedd5427ef78518468ec222fe Mon Sep 17 00:00:00 2001 From: Tushar Date: Tue, 14 Apr 2026 19:18:17 +0530 Subject: [PATCH 2/2] refactor(command-list): hoist get_commands call to avoid duplicate api fetch --- crates/forge_main/src/ui.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/forge_main/src/ui.rs b/crates/forge_main/src/ui.rs index 8a5944813d..d03d1faaae 100644 --- a/crates/forge_main/src/ui.rs +++ b/crates/forge_main/src/ui.rs @@ -1320,6 +1320,9 @@ impl A + Send + Sync> UI /// Lists all the commands async fn on_show_commands(&mut self, porcelain: bool) -> anyhow::Result<()> { + // Fetch custom commands once — used by both the porcelain and plain paths. + let custom_commands = self.api.get_commands().await?; + if porcelain { // Build the full info with type/description columns for porcelain // (used by the shell plugin for tab completion). @@ -1364,7 +1367,6 @@ impl A + Send + Sync> UI .add_key_value("description", title); } - let custom_commands = self.api.get_commands().await?; for command in custom_commands { info = info .add_title(command.name.clone()) @@ -1388,10 +1390,7 @@ impl A + Send + Sync> UI self.writeln(porcelain)?; } else { // Non-porcelain: render in the same flat format as :help in the REPL. - // Fetch custom commands from the API (same as the porcelain path) so - // they appear alongside the built-in commands. let command_manager = ForgeCommandManager::default(); - let custom_commands = self.api.get_commands().await?; command_manager.register_all(custom_commands); let info = Info::from(&command_manager); self.writeln(info)?;