xiantong 文档

深入链接

使用 xiantong:// URL 方案从任何地方启动 xiantong

深度链接

使用 xiantong:// URL 方案从任何地方启动 xiantong

xiantong:// URL 方案可让您直接从浏览器、脚本、文档或其他应用启动 xiantong。

新建会话#

创建新的会话,可选地预填输入内容:

xiantong://action/new-chat
xiantong://action/new-chat?input=Hello%20world
xiantong://action/new-chat?input=Hello%20world&send=true
xiantong://action/new-chat?input=Hello%20world&name=My%20Chat

参数:

参数描述
input在输入字段中预填的文本
send设置为 true 可立即发送消息
name会话的自定义名称

工作区定位#

通过将工作区 ID 添加到路径来定位特定工作区:

xiantong://workspace/{workspaceId}/action/new-chat
xiantong://workspace/{workspaceId}/action/new-chat?input=Hello&send=true
xiantong://workspace/{workspaceId}/allSessions

如果未指定工作区定位,深度链接将使用当前聚焦的窗口。

查看路由#

直接导航到特定视图:会话:

xiantong://allSessions
xiantong://allSessions/session/{sessionId}
xiantong://flagged
xiantong://flagged/session/{sessionId}
xiantong://state/{statusId}
xiantong://state/{statusId}/session/{sessionId}

来源:

xiantong://sources
xiantong://sources/source/{sourceSlug}

技能:

xiantong://skills
xiantong://skills/skill/{skillSlug}

设置:

xiantong://settings
xiantong://settings/workspace
xiantong://settings/permissions
xiantong://settings/shortcuts
xiantong://settings/preferences

会话操作#

通过深度链接管理会话:

xiantong://action/flag-session/{sessionId}
xiantong://action/unflag-session/{sessionId}
xiantong://action/delete-session/{sessionId}
xiantong://action/rename-session/{sessionId}?name=New%20Name

窗口模式#

在新窗口中打开链接,而不是当前窗口:

xiantong://action/new-chat?window=focused
xiantong://allSessions?window=full
模式描述
focused新的聚焦窗口
full全屏新窗口

使用场景#

浏览器书签

创建可启动特定工作流的书签:

  • 早晨简报:xiantong://action/new-chat?input=Give%20me%20my%20morning%20briefing&send=true
  • 快速任务检查:xiantong://action/new-chat?input=What%20are%20my%20top%203%20priorities%3F&send=true

文档链接

在团队文档中添加打开 xiantong 会话的链接:

[Ask the assistant](xiantong://action/new-chat?input=How%20does%20the%20auth%20system%20work%3F)

Shell 别名

为常用任务创建 Shell 别名:

alias morning="open 'xiantong://action/new-chat?input=Morning%20briefing&send=true'"
alias standup="open 'xiantong://action/new-chat?input=Prepare%20my%20standup%20notes&send=true'"

Raycast / Alfred 快捷方式

配置启动器应用,通过键盘快捷键触发工作流,使用深度链接 URL。

iOS 快捷指令

在 iOS 上,创建快捷指令来打开深度链接:

  1. 创建新的快捷指令
  2. 添加“打开 URL”操作
  3. 输入 xiantong:// 深度链接
  4. 通过快捷指令部件或 Siri 运行

提示#

对输入进行 URL 编码

在创建带有输入文本的深度链接时,对特殊字符进行 URL 编码:

  • 空格 → %20
  • 问号 → %3F
  • 与号 → %26
  • 换行 → %0A

在终端测试深度链接

在分享前测试深度链接:

open "xiantong://action/new-chat?input=Hello%20world"

自动发送以加快工作流

添加 &send=true 可在不手动确认的情况下立即执行提示——非常适合自动化工作流。