Skip to content
FunCoding

Search

Search docs, Skills and MCP

应用 Deep links

生成 ghapp 链接,预填会话和自动化,并区分 GitHub task 与本地 session ID。

This page has not been translated into English yet. The original Chinese version is shown below.

Deep links 让浏览器、文档或其他工具直接打开 Copilot app 的目标页面。公开链接使用官方 ghapp:// scheme;github-app:// 与 gh:// 仅作为兼容形式接受。

编码两层 URL

浏览器使用托管 launcher:

https://github.com/copilot/app/launch?open=ENCODED_APP_LINK

先编码 app link 内各查询参数的值,再对完整 app link 使用 encodeURIComponent 或等价函数,放进 open。例如:

ghapp://session/new?repo=OWNER%2FREPO&mode=interactive&prompt=Investigate%20failing%20tests
https://github.com/copilot/app/launch?open=ghapp%3A%2F%2Fsession%2Fnew%3Frepo%3DOWNER%252FREPO%26mode%3Dinteractive%26prompt%3DInvestigate%2520failing%2520tests

launcher 尝试交给应用,不能交接时显示后备页面。不要在 URL 提示中加入密钥或敏感用户资料。

页面与工作项

App link目标
ghapp://New
ghapp://chats、ghapp://mywork、ghapp://recentChats、My work、Recent Workspaces
ghapp://github.com/OWNER/REPO打开或克隆仓库
ghapp://github.com/OWNER/REPO/issues/NUMBER已添加项目中的 Issue
ghapp://github.com/OWNER/REPO/pull/NUMBER已添加项目中的 PR,保留可选尾部路径
ghapp://github.com/OWNER/REPO/tasks/TASK_ID继续 GitHub agent task
ghapp://sessions/SESSION_ID打开应用本地工作区或会话
ghapp://clone/OWNER/REPO、ghapp://repo/OWNER/REPO确认后克隆或进入仓库设置

TASK_ID 必须是 GitHub task ID,不能使用 runtime session ID 或应用本地 session ID。查询串和 hash 在打开时保留。

新会话参数

ghapp://session/new 和 ghapp://session/new/OWNER/REPO 都会在创建前显示确认。

参数规则
repoOWNER/REPO;无路径仓库形式必填,有路径形式可省略
pr正整数 PR 编号,不能与 branch 同用
branch新会话 base branch,不能与 pr 同用
prompt可选初始提示
modeplan、interactive 或 autopilot

自动化链接

ghapp://automations 打开列表;ghapp://automations/AUTOMATION_ID 打开任务,追加 /RUN_ID 打开某次运行。这两种默认指向 local;云端需加 ?mode=cloud,也可显式使用 mode=local。

ghapp://automations/new 只预填创建对话框,用户确认后才创建,支持:

参数规则
name、prompt任务名称与提示
triggermanual、hourly、daily、weekly;interval 是参数别名
timedaily/weekly 的本地 24 小时 HH:mm;daily 可逗号分隔或重复,但所有时间分钟必须相同
dayweekly 的 0–6 或星期名称,0 为周日;别名 schedule_day,可逗号分隔或重复

无效 trigger、time、day 值会被忽略。应用 UI 支持的 CRON、Issue、PR 触发器并未出现在此 deep link 参数清单中,不能据 UI 能力自行构造 URL 参数。

插件表单

ghapp://plugins/install?source=... 的 source 必填,格式为 PLUGIN@MARKETPLACE。ghapp://plugins/marketplace/add?source=... 的 source 必填,为 OWNER/REPO 或 Git URL;都需编码参数值。

这些链接经过确认后打开 Customize → Plugins 的预填表单,仍需在应用中确认才会安装插件或添加 marketplace,不是静默执行入口。