feat(CommandService): add command filtering configuration options #612
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.
TLDR
This commit adds a new configuration option
Settings
to theCommandService
, allowing command filtering based on core commands and excluded commands settings. Relevant tests and configuration patterns have also been updated.Dive Deeper
In some use cases, for example, as an SRE installing qwen-code on a server terminal as a cli-agent (not for coding purposes), it is expected that when developers use this agent, the command usage scope can be more focused and manageable. For instance, the /bug command is not applicable in this scenario. Through configuration, you can selectively assemble commands when the cli is launched (applicable to built-in/MCP/file instructions).
Reviewer Test Plan
Example 1: Load only specific commands
Example 2: Exclude specific commands
Example 3: Combination (coreCommands takes priority)
In this case, only
help
andclear
will be loaded sincequit
is excluded by thecoreCommands
filter.Testing Matrix
This PR does not involve changes here.