fix(cli): add 'detail' subcommand to /context command

The /context command was missing the subcommand autocomplete feature
that other commands like /stats have. Now users can type '/context '
and see 'detail' as a suggestion in the dropdown.

- Added 'detail' subCommand to contextCommand with its own description
- Subcommand delegates to main action with 'detail' arg
- Added missing translation key for full description in zh.js
- Updated commands.md documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
YuchenLiang00 2026-04-09 10:15:10 +08:00
parent e0aeee5414
commit 84f80201c7
3 changed files with 16 additions and 0 deletions

View file

@ -373,4 +373,17 @@ export const contextCommand: SlashCommand = {
context.ui.addItem(contextUsageItem, Date.now());
},
subCommands: [
{
name: 'detail',
get description() {
return t('Show per-item context usage breakdown.');
},
kind: CommandKind.BUILT_IN,
action: async (context: CommandContext) => {
// Delegate to main action with 'detail' arg to show detailed view
await contextCommand.action!(context, 'detail');
},
},
],
};