@@ -47,7 +47,7 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
4747 *
4848 * @param command - Command name.
4949 * @param state - Help-relevant application state.
50- * @returns Human-readable command description.
50+ * @returns Markdown-ready command description.
5151 */
5252 function getHelpCommandDescription(
5353 command: (typeof COMMANDS)[number],
@@ -55,72 +55,86 @@ function getHelpCommandDescription(
5555 ): string {
5656 const description = COMMAND_DESCRIPTIONS[command] ?? "";
5757 if (command === "reasoning") {
58- return `${description} (currently ${state.showReasoning ? "on" : "off"})`;
58+ return `${description} _(currently ${state.showReasoning ? "on" : "off"})_`;
5959 }
6060 if (command === "verbose") {
61- return `${description} (currently ${state.verbose ? "on" : "off"})`;
61+ return `${description} _(currently ${state.verbose ? "on" : "off"})_`;
6262 }
6363 return description;
6464 }
6565
66+function formatInlineCode(text: string): string {
67+ return `\`${text}\``;
68+}
69+
70+function formatInlineCodeList(items: readonly string[]): string {
71+ return items.map((item) => formatInlineCode(item)).join(", ");
72+}
73+
6674 /**
6775 * Build the `/help` text shown in the conversation log.
6876 *
6977 * @param state - Help-relevant application state.
70- * @returns Multi-line help text for display.
78+ * @returns Multi-line markdown help text for display.
7179 */
7280 export function buildHelpText(state: HelpRenderState): string {
73- const lines: string[] = [];
81+ const lines: string[] = ["# Help", "", "## Commands", ""];
7482
75- lines.push("Commands:");
7683 for (const command of COMMANDS) {
77- lines.push(` /${command} ${getHelpCommandDescription(command, state)}`);
84+ lines.push(
85+ `- ${formatInlineCode(`/${command}`)} — ${getHelpCommandDescription(command, state)}`,
86+ );
7887 }
7988
8089 const providerNames = Array.from(state.providers.keys());
81- lines.push("");
82- lines.push("Note:");
83- lines.push(
84- " Escape closes the current overlay and returns focus to the input.",
85- );
86- lines.push(" With no overlay open, Escape interrupts the current turn.");
87- lines.push(" Otherwise Escape does nothing.");
88-
89- lines.push("");
9090 lines.push(
91+ "",
92+ "## Keyboard",
93+ "",
94+ "- `Enter` submits the current draft.",
95+ "- `Shift+Enter` inserts a newline.",
96+ "- `Tab` opens command autocomplete when the draft starts with `/`.",
97+ "- Otherwise, `Tab` autocompletes file paths and can open a path picker when there are multiple matches.",
98+ "- `Ctrl+R` opens global input history search.",
99+ "- `Escape` closes the current overlay and returns focus to the input.",
100+ "- With no overlay open, `Escape` interrupts the current turn.",
101+ "- Otherwise, `Escape` does nothing.",
102+ "- `Ctrl+C` exits gracefully.",
103+ "- `Ctrl+D` exits when the input is empty.",
104+ "- `Ctrl+Z` suspends the app to the background.",
105+ "",
106+ "## Current state",
107+ "",
91108 providerNames.length > 0
92- ? `Providers: ${providerNames.join(", ")}`
93- : "Providers: none (use /login)",
94- );
95-
96- lines.push(
109+ ? `- Providers: ${formatInlineCodeList(providerNames)}`
110+ : "- Providers: none — use `/login`",
97111 state.model
98- ? `Model: ${state.model.provider}/${state.model.id}`
99- : "Model: none (use /model)",
112+ ? `- Model: ${formatInlineCode(`${state.model.provider}/${state.model.id}`)}`
113+ : "- Model: none — use `/model`",
100114 );
101115
102116 if (state.agentsMd.length > 0) {
103- lines.push("");
104- lines.push("AGENTS.md files:");
117+ lines.push("", "## Loaded `AGENTS.md` files", "");
105118 for (const agentFile of state.agentsMd) {
106- lines.push(` ${abbreviatePath(agentFile.path)}`);
119+ lines.push(`- ${formatInlineCode(abbreviatePath(agentFile.path))}`);
107120 }
108121 }
109122
110123 if (state.skills.length > 0) {
111- lines.push("");
112- lines.push("Skills:");
124+ lines.push("", "## Skills", "");
113125 for (const skill of state.skills) {
114- const description = skill.description ? ` ${skill.description}` : "";
115- lines.push(` ${skill.name}${description}`);
126+ lines.push(
127+ skill.description
128+ ? `- ${formatInlineCode(skill.name)} — ${skill.description}`
129+ : `- ${formatInlineCode(skill.name)}`,
130+ );
116131 }
117132 }
118133
119134 if (state.plugins.length > 0) {
120- lines.push("");
121- lines.push("Plugins:");
135+ lines.push("", "## Plugins", "");
122136 for (const plugin of state.plugins) {
123- lines.push(` ${plugin.entry.name}`);
137+ lines.push(`- ${formatInlineCode(plugin.entry.name)}`);
124138 }
125139 }