Support autocomplete/ghost text for extension slash command arguments
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript, typescript
- 领域
- api, cli, developer-experience
调研方向
从 generated/types 中关于 CommandDefinition 的文档,以及通过 joinSession({ commands: [...] }) 展示的扩展注册开始。跟踪 Copilot CLI 如何处理项目范围的扩展命令。Done 应提供一个有文档说明的 SDK 接口,用于静态使用或结构化建议,以及动态参数补全,并在支持的情况下提供描述。
由索引模型根据 Issue 内容生成。
描述
Summary
Please add an SDK/API surface that lets Copilot CLI extensions provide autocomplete, ghost text, or structured argument suggestions for extension slash commands.
Scenario
I am building a Copilot CLI extension that registers a deterministic /cost command via joinSession({ commands: [...] }). The command has useful subcommands/options such as:
/cost
/cost help
/cost panel on|off|refresh
/cost session <session-id>
/cost live-session <session-id>
/cost --plan pro|pro-plus|business|enterprise
/cost --billing-model usage-based|premium-requests
/cost --currency USD
Built-in slash commands appear to show ghost text / inline hints for supported arguments as the user types. For extension commands, I only see the command name/description; after typing /cost there does not appear to be a way to suggest supported subcommands/options.
Current SDK surface
The generated/types docs I found for CommandDefinition only expose:
export interface CommandDefinition {
name: string;
description?: string;
handler: CommandHandler;
}
That is enough to register /cost, but not enough to provide argument completions, examples, or dynamic suggestions.
Requested capability
It would be useful if extension commands could declare one or more of the following:
- static usage text/examples for ghost text after the command name
- structured subcommands/options/enum values
- dynamic completion callback based on the current argument prefix and session context
- optional descriptions for each subcommand/option
For example, something like:
commands: [
{
name: 'cost',
description: 'Show Copilot session cost.',
usage: 'panel on|off|refresh | session <session-id> | --plan <plan>',
completions: async ({ args, cursor, sessionId }) => [
{ value: 'panel', description: 'Open or manage the cost panel' },
{ value: 'session', description: 'Show cost for a completed session' },
{ value: '--plan', description: 'Compare against a subscription plan' }
],
handler
}
]
Why this matters
Extension slash commands can be deterministic command surfaces rather than model-routed prompts. Without argument hints, users have to remember command syntax or run a separate help command. Built-in-command-quality discoverability would make SDK extensions feel native and easier to learn.
Workaround today
The extension can implement /cost help, but that is less discoverable and does not help while typing.
Environment
Observed with Copilot CLI / SDK builds around 1.0.41-0 / 1.0.43 on Windows while authoring a project-scoped extension under .github/extensions/<name>/extension.mjs.
- 主要语言
- Java
- 星标
- 10.5k
- 派生
- 1.5k
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 130
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-sdk 的其他 Issue
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2760 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2759 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 68/100
github/copilot-sdk#2709 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 78/100
github/copilot-sdk#2673 ·
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/rocketmq-dashboard#5064 ·