Skip to content
FunCoding

Search

Search docs, Skills and MCP

Deeplinks 分享

生成提示、命令和规则链接,保留 URL 编码与用户确认边界。

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

Deeplink 可将可复用提示、命令或规则交给其他 Cursor 用户。打开链接不会自动执行任务;提示与命令执行前须由接收者检查确认,规则添加前也须确认。

链接格式

类型原生基址参数
Promptcursor://anysphere.cursor-deeplink/prompttext
Commandcursor://anysphere.cursor-deeplink/commandname、text
Rulecursor://anysphere.cursor-deeplink/rulename、text

网页形式将前缀替换为 https://cursor.com/link/。命令对应 .cursor/commands,规则对应 .cursor/rules。接收者打开 command/rule 链接后仍需检查创建的内容。

使用 URL API 编码

function generatePromptDeeplink(promptText: string): string {
  const url = new URL('https://cursor.com/link/prompt');
  url.searchParams.set('text', promptText);
  return url.toString();
}

通过 URLSearchParams 或语言对应编码函数处理空格、换行与特殊字符,避免手工拼接破坏参数。最大 URL 长度为 10,000 字符,按编码后的完整地址检查。

分享前检查

正文会进入链接,分享前移除 API keys、密码和不应公开的代码。网页链接引导用户在 cursor.com 打开或复制到 Cursor,不能把跳转成功当作提示已执行的证明。