fix(cli): add 'detail' subcommand to /context command#3042
Conversation
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>
|
@YuchenLiang00 Thanks for your contribution!It is recommended to add |
|
Thanks for the review! I looked into how The behavior for
This way, users who just want the summary can simply press Enter after |
|
@YuchenLiang00 Yeah, |
|
Thanks for the suggestion! I agree that making and modal dialogs (like ) would be a better UX — it keeps the context clean and avoids consuming tokens for these diagnostic views. This PR was intended as a small fix for the missing autocomplete, but I'm happy to close it if you'd prefer to address this in a larger modal-dialog PR instead. Just let me know what works best — either way, I'm glad to help! |
|
@YuchenLiang00 This PR is a minor change that follows our previous approach, so I'm happy to merge it. Thank you once again for your contribution. Additionally, I've just created an issue to track the follow-up work, and you're welcome to submit a PR for it. |
…-detail-missing fix(cli): add 'detail' subcommand to /context command
Summary
Fixes #3040
The
/contextcommand was missing thedetailsubcommand in the autocomplete dropdown. When users type/context(with a trailing space), no suggestions appeared — unlike/statswhich correctly showsmodelandtools.Changes
packages/cli/src/ui/commands/contextCommand.tssubCommandsarray withdetailentry (+13 lines)packages/cli/src/i18n/locales/zh.jsdocs/users/features/commands.md/context detailusage (+1 line)How it works
The
detailsubcommand delegates to the main action with"detail"as the argument, reusing existing logic — no code duplication.Before / After
Before: Typing
/contextshows no suggestions.After: Typing
/contextshowsdetailwith description "Show per-item context usage breakdown."Checklist
useSlashCompletion.test.tscovers subcommand completion)docs/users/features/commands.md)