xonecas.io
64875
Mc

mini-coder / commit 6104776

feat: add /help command, complete Phase 4c

/help renders commands, providers, model, AGENTS.md files, skills,
and plugins as a display-only info message in the conversation log.

All 11 spec commands implemented. Phase 4c complete.
Update TODO.md notes with /help and autocomplete details.

xonecas2026-04-05 610477662997e7eb2aa9e34f08e941c2335d10c1 parent 33f8da7

2 files changed

TODO.md+4−1
@@ -119,7 +119,7 @@
119119 - [x] `/verbose` — toggle `verbose`
120120 - [x] Info messages separated from `state.messages` — display-only `infoMessages` array, not sent to LLM, cleared on session switch
121121 - [x] `/` + Tab — command autocomplete overlay (all 11 commands with descriptions)
122-- [ ] `/help` — list commands, AGENTS.md files, skills, plugins
122+- [x] `/help` — list commands, providers, model, AGENTS.md files, skills, plugins
123123
124124 ### Notes from Phase 4c
125125
@@ -139,6 +139,9 @@
139139 - `handleInput()` routes through `parseInput()` → `handleCommand()` for commands, `submitMessage()` for text. Skill and image cases are stubs for Phase 4d.
140140 - `Theme` gained `overlayBg: Color` (default `"color08"`).
141141 - `appendInfoMessage()` helper for display-only status messages. Uses separate `infoMessages` array (not `state.messages`) so info text is never sent to the LLM. Cleared on `/new`, `/session` resume, `/fork`.
142+- `/help` renders commands (with descriptions), providers, model, AGENTS.md paths, skills, plugins as a multi-line info message.
143+- `/` + Tab in TextInput triggers `showCommandAutocomplete()` — overlay Select with all 11 commands from `COMMANDS` + `COMMAND_DESCRIPTIONS`. Selection executes the command via `handleInput`. Tab without `/` falls through (file autocomplete deferred to Phase 4d).
144+- All 11 spec commands implemented. Phase 4c complete.
142145 - 162 tests across 9 files (session: 24, tools: 36, git: 10, skills: 14, prompt: 21, agent: 12, plugins: 10, input: 30, theme: 5).
143146
144147 ### Spec review findings (Phase 4c checkpoint)
src/ui.ts+62−1
@@ -779,7 +779,7 @@ function openInBrowser(url: string): void {
779779 function appendInfoMessage(text: string, _state: AppState): void {
780780 const msg: Message = {
781781 role: "user",
782- content: `[${text}]`,
782+ content: `${text}`,
783783 timestamp: Date.now(),
784784 };
785785 infoMessages.push(msg);
@@ -974,6 +974,64 @@ function handleLogoutCommand(state: AppState): void {
974974 cel.render();
975975 }
976976
977+/** Handle the /help command: show commands, providers, agents, skills, plugins. */
978+function handleHelpCommand(state: AppState): void {
979+ const lines: string[] = [];
980+
981+ // Commands
982+ lines.push("Commands:");
983+ for (const cmd of COMMANDS) {
984+ const desc = COMMAND_DESCRIPTIONS[cmd] ?? "";
985+ lines.push(` /${cmd} ${desc}`);
986+ }
987+
988+ // Providers
989+ const providerNames = Array.from(state.providers.keys());
990+ lines.push("");
991+ lines.push(
992+ providerNames.length > 0
993+ ? `Providers: ${providerNames.join(", ")}`
994+ : "Providers: none (use /login)",
995+ );
996+
997+ // Model
998+ lines.push(
999+ state.model
1000+ ? `Model: ${state.model.provider}/${state.model.id}`
1001+ : "Model: none (use /model)",
1002+ );
1003+
1004+ // AGENTS.md files
1005+ if (state.agentsMd.length > 0) {
1006+ lines.push("");
1007+ lines.push("AGENTS.md files:");
1008+ for (const a of state.agentsMd) {
1009+ lines.push(` ${abbreviatePath(a.path)}`);
1010+ }
1011+ }
1012+
1013+ // Skills
1014+ if (state.skills.length > 0) {
1015+ lines.push("");
1016+ lines.push("Skills:");
1017+ for (const s of state.skills) {
1018+ const desc = s.description ? ` ${s.description}` : "";
1019+ lines.push(` ${s.name}${desc}`);
1020+ }
1021+ }
1022+
1023+ // Plugins
1024+ if (state.plugins.length > 0) {
1025+ lines.push("");
1026+ lines.push("Plugins:");
1027+ for (const p of state.plugins) {
1028+ lines.push(` ${p.entry.name}`);
1029+ }
1030+ }
1031+
1032+ appendInfoMessage(lines.join("\n"), state);
1033+}
1034+
9771035 /** Command descriptions for the autocomplete overlay. */
9781036 const COMMAND_DESCRIPTIONS: Record<string, string> = {
9791037 model: "Select a model",
@@ -1049,6 +1107,9 @@ function handleCommand(command: string, state: AppState): boolean {
10491107 case "verbose":
10501108 handleVerboseCommand(state);
10511109 return true;
1110+ case "help":
1111+ handleHelpCommand(state);
1112+ return true;
10521113 default:
10531114 return false;
10541115 }