Add terminal command entrypoints for LSPRAG workflows#7
Open
Huang-Xuwei wants to merge 2 commits intoTHU-WingTecher:mainfrom
Open
Add terminal command entrypoints for LSPRAG workflows#7Huang-Xuwei wants to merge 2 commits intoTHU-WingTecher:mainfrom
Huang-Xuwei wants to merge 2 commits intoTHU-WingTecher:mainfrom
Conversation
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
This PR adds terminal-accessible entrypoints for core LSPRAG workflows, so they no longer depend on opening the Command Palette in VS Code.
Specifically, this change introduces CLI support for:
These CLI commands are designed to reuse the existing extension behavior as much as possible, instead of creating a separate implementation path.
Motivation
LSPRAG previously exposed its main workflows only through VS Code commands such as:
LSPRAG: Test LLMLSPRAG: Generate Unit TestLSPRAG: Show Current SettingsThat made scripting, automation, remote usage, and terminal-first debugging harder than necessary. This PR adds a terminal path for those workflows so they can be invoked directly from the workspace root.
Changes
New CLI commands
Added terminal commands for:
npm run test:llmnpm run generate:cli -- --file <path> --function <name>npm run show:settingsShared command logic
Refactored command implementations so the CLI path reuses existing extension logic where possible.
generate:clireuses the extension command path instead of introducing a separate generator implementationshow:settingsand the VS Code command now share the same settings summary formatterCLI host and VS Code test integration
For
generate:cli, the PR adds a VS Code test-host bridge so terminal execution can still use:WSL / Remote robustness improvements
The terminal generation path now handles several environment-specific issues that prevented the VS Code test instance from loading language extensions correctly:
VSCODE_*remote CLI state.obsoleteextension removal markersstableBetter CLI validation and errors
Improved terminal UX by failing earlier and with clearer messages:
Files added / updated
Main additions
src/cli/testLLM.tssrc/cli/generateUnitTest.tssrc/cli/showSettings.tssrc/llmHealthcheck.tssrc/currentSettings.tssrc/commands/generateUnitTestCommand.tssrc/test/generateCliHost.tsMain updates
src/extension.tssrc/invokeLLM.tssrc/config.tssrc/test/runTest.tssrc/test/runExperiment.tspackage.jsonREADME.mdUsage
Examples:
Validation
Validated locally:
TypeScript compilation passesterminal settings command worksterminal generate flow now reaches the extension/LSP pipeline correctlymissing LLM credentials are reported before generation startsNotes
Full end-to-end generation still requires a valid configured LLM provider, for example:
DEEPSEEK_API_KEYOPENAI_API_KEYor LOCAL_LLM_URL for local/Ollama usage