diff --git a/crates/forge_main/src/ui.rs b/crates/forge_main/src/ui.rs index 04450ca96b..a14c495183 100644 --- a/crates/forge_main/src/ui.rs +++ b/crates/forge_main/src/ui.rs @@ -1321,6 +1321,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). @@ -1365,7 +1368,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()) @@ -1390,6 +1392,7 @@ impl A + Send + Sync> UI } else { // Non-porcelain: render in the same flat format as :help in the REPL. let command_manager = ForgeCommandManager::default(); + command_manager.register_all(custom_commands); let info = Info::from(&command_manager); self.writeln(info)?; }