feat: add slash commands (/help, /files, /clear) to interactive Q&A mode#59
Merged
Merged
Conversation
Interactive mode (`bootcamp ask` and `--interactive`) previously only recognized `exit`/`quit`. It now supports slash commands: - /help (alias /?) โ command reference - /files โ list detected repository files - /clear โ clear the screen - /exit (/quit) โ end the session Unknown slash commands are reported instead of being silently sent to the assistant as a prompt. The core is a pure, exported `classifyInteractiveInput(raw)` returning a discriminated result (empty | exit | command | unknown-command | question), plus pure `renderInteractiveHelp()` and `renderFileList(scan)` renderers โ all unit-testable without an LLM session. The REPL loop dispatches on the result. Tests: 15 unit tests (classification of every input kind + alias + arg cases, help/file-list rendering incl. truncation and empty scan); 1 E2E test driving the real `ask` process through /help, /files, and an unknown command. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interactive Q&A mode โ
bootcamp ask <repo>andbootcamp <repo> --interactiveโ previously only recognizedexit/quit. It now supports a small set of slash commands that make the REPL more discoverable and useful:/help/?/files/clear/exit/quit,exit,quitUnknown slash commands (e.g.
/bogus) are reported with a hint rather than being silently sent to the assistant as a prompt.Implementation
The core is a pure, exported
classifyInteractiveInput(raw)that returns a discriminated union โempty | exit | command | unknown-command | questionโ plus purerenderInteractiveHelp()andrenderFileList(scan)renderers. All three are unit-testable without an LLM session. The REPL loop simply dispatches on the classification result, so the conversational path is unchanged for normal questions.Testing
askprocess through/help,/files, and an unknown command via stdin, asserting the rendered output and a clean exit.npm testโ 1119 passing; typecheck + lint + build clean.๐ค Generated with Claude Code