Skip to content

Zed

Zed 是一款极简代码编辑器,专为速度和人机协作而设计。Protocol Launcher 允许你生成深度链接,用于在 Zed 中打开并配置资源。。

使用

提供两种使用方式:

  • 按需加载(通过子路径导入),支持 Tree Shaking,体积更小。
  • 全量导入(从根包导入),使用简单,但会包含所有应用模块。

生产环境建议使用按需加载以减小体积;快速脚本或演示可选择全量导入。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

打开文件

On-Demand
ts
import { openFile } from 'protocol-launcher/zed'

const url = openFile({
  path: '/etc/hosts',
  line: 1,
  column: 2,
})

打开文件夹

On-Demand
ts
import { openFolder } from 'protocol-launcher/zed'

const url = openFolder({
  path: '/etc',
})

远程开发

On-Demand
ts
import { openRemote } from 'protocol-launcher/zed'

const url = openRemote({
  host: 'root@172.18.105.209:22',
  path: '/code/my-project',
})

克隆项目

On-Demand
ts
import { cloneProject } from 'protocol-launcher/zed'

const url = cloneProject({
  repo: 'https://github.com/zhensherlock/protocol-launcher',
})

打开 Git 提交

On-Demand
ts
import { openGitCommit } from 'protocol-launcher/zed'

const url = openGitCommit({
  sha: '739420c',
  path: '/Users/dev/Documents/protocol-launcher',
})

打开扩展

On-Demand
ts
import { openExtension } from 'protocol-launcher/zed'

const url = openExtension({
  id: 'html',
})

打开智能体

On-Demand
ts
import { openAgent } from 'protocol-launcher/zed'

const url = openAgent({
  prompt: 'Hello World',
})

加入智能体

On-Demand
ts
import { joinAgent } from 'protocol-launcher/zed'

const url = joinAgent({
  id: '12345',
})

打开设置

On-Demand
ts
import { openSettings } from 'protocol-launcher/zed'

const url = openSettings({
  path: 'autosave',
})