Skip to content

feat: add slash commands (/help, /files, /clear) to interactive Q&A mode#59

Merged
Arthur742Ramos merged 1 commit into
mainfrom
arthur742ramos/interactive-slash-commands
Jun 11, 2026
Merged

feat: add slash commands (/help, /files, /clear) to interactive Q&A mode#59
Arthur742Ramos merged 1 commit into
mainfrom
arthur742ramos/interactive-slash-commands

Conversation

@Arthur742Ramos

Copy link
Copy Markdown
Owner

Summary

Interactive Q&A mode โ€” bootcamp ask <repo> and bootcamp <repo> --interactive โ€” previously only recognized exit/quit. It now supports a small set of slash commands that make the REPL more discoverable and useful:

Command Aliases Action
/help /? Show the command reference
/files List the detected repository files
/clear Clear the screen
/exit /quit, exit, quit End the session

Unknown 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 pure renderInteractiveHelp() and renderFileList(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

  • 15 unit tests: every input kind, command aliases, case-insensitivity, trailing-arg capture, "question containing a slash is not a command", and the help/file-list renderers (including truncation and empty-scan cases).
  • 1 E2E test: drives the real ask process through /help, /files, and an unknown command via stdin, asserting the rendered output and a clean exit.
  • Full suite green: npm test โ†’ 1119 passing; typecheck + lint + build clean.

๐Ÿค– Generated with Claude Code

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>
@Arthur742Ramos Arthur742Ramos merged commit 6d69092 into main Jun 11, 2026
13 checks passed
@Arthur742Ramos Arthur742Ramos deleted the arthur742ramos/interactive-slash-commands branch June 11, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

โšก