diff --git a/docs/users/features/commands.md b/docs/users/features/commands.md index dde507293..ce26c2962 100644 --- a/docs/users/features/commands.md +++ b/docs/users/features/commands.md @@ -34,6 +34,7 @@ Commands for adjusting interface appearance and work environment. | ------------ | ---------------------------------------- | ----------------------------- | | `/clear` | Clear terminal screen content | `/clear` (shortcut: `Ctrl+L`) | | `/context` | Show context window usage breakdown | `/context` | +| → `detail` | Show per-item context usage breakdown | `/context detail` | | `/theme` | Change Qwen Code visual theme | `/theme` | | `/vim` | Turn input area Vim editing mode on/off | `/vim` | | `/directory` | Manage multi-directory support workspace | `/dir add ./src,./tests` | diff --git a/packages/cli/src/i18n/locales/zh.js b/packages/cli/src/i18n/locales/zh.js index c3e8b627a..1c5e96f6e 100644 --- a/packages/cli/src/i18n/locales/zh.js +++ b/packages/cli/src/i18n/locales/zh.js @@ -1715,6 +1715,8 @@ export default { 'Show context window usage breakdown.': '显示上下文窗口使用情况分解。', 'Run /context detail for per-item breakdown.': '运行 /context detail 查看详细分解。', + 'Show context window usage breakdown. Use "/context detail" for per-item breakdown.': + '显示上下文窗口使用情况分解。输入 "/context detail" 查看详细分解。', 'body loaded': '内容已加载', memory: '记忆', '{{region}} configuration updated successfully.': '{{region}} 配置更新成功。', diff --git a/packages/cli/src/ui/commands/contextCommand.ts b/packages/cli/src/ui/commands/contextCommand.ts index c693606a9..540eb0941 100644 --- a/packages/cli/src/ui/commands/contextCommand.ts +++ b/packages/cli/src/ui/commands/contextCommand.ts @@ -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'); + }, + }, + ], };