argument-hint doesn't show for skills

未关闭 适合新手
#5,567 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript, nodejs
领域
cli

调研方向

从报告中提到的 skill 转命令环节 cliSlashSkillMetadata 开始:它接收到了正确的 argumentHint,但返回的命令元数据中没有 args 字段。对比 /model 等内置命令如何填充 args 以显示提示,然后在那里将该 skill 的 argumentHint 设置为字面量参数。验证时,按照复现步骤创建 .github/skills/hint-repro/SKILL.md,在该项目中启动 CLI 会话并输入 /hint-repro。当建议列表和输入行中都显示 [target] [--help](无论末尾是否有空格)时即完成。

由索引模型根据 Issue 内容生成。

描述

area:plugins
Describe the bug

A skill's description appears when typing its slash command, but its argument hint doesn't. The installed SKILL.md has a quoted, top-level argument-hint field in its YAML frontmatter

Affected version

1.0.115-8

Steps to reproduce the behavior
  1. In a local test project, create .github/skills/hint-repro/SKILL.md with this content:
---
name: hint-repro
description: Test whether skill argument hints are displayed.
argument-hint: "[target] [--help]"
---

If invoked, reply with "Hint test." Do not use tools.
  1. Start a fresh Copilot CLI session in that project
  2. Type /hint-repro without pressing Enter. Check the command suggestion and input line for [target] [--help]
  3. Add a trailing space and check again

The configured argument hint should be displayed. There is no need to submit the command or execute the skill

Expected behavior

The configured argument hint should appear when selecting or typing the skill's slash command, as described under “Skill frontmatter fields”:

https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#skill-frontmatter-fields

Additional context

Reproduced on macOS ARM64

Built-in commands such as /model show their argument hints in the same terminal

While investigating, I found that cliSlashSkillMetadata receives the correct argumentHint, but the returned command metadata has no args field. In a temporary test process, adding this to the returned command made the full hint appear:

command.args = [{ type: "literal", text: skill.argumentHint }];

Removing that change made the hint disappear again

That seems to narrow it down to the skill-to-command conversion

I only tested the display behaviour, so the snippet above isn't intended as a complete fix

主要语言
Python
星标
11.5k
派生
2k
平均合并
6 小时 34 分钟
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。