清单参考

agentty-plugin.json 的所有字段 —— 标识信息、运行方式、权限、面板、命令与图标。

agentty-plugin.json 位于插件文件夹的根目录,告诉 Agentty 这个插件是什么、如何启动、能做什么,以及为界面添加了什么。

json
{
  "id": "hello",
  "name": "Hello",
  "version": "0.1.0",
  "main": "main.mjs",
  "runtime": "node",
  "apiVersion": 1,
  "description": "Turns the current folder into a prompt.",
  "publisher": "you",
  "homepage": "https://example.com/hello",
  "permissions": ["prompt.inject"],
  "contributes": {
    "panel": { "title": "Hello", "icon": "sparkles" },
    "commands": [
      { "id": "hello.explain", "title": "Hello: Explain this folder", "icon": "bot", "paneBar": true }
    ]
  }
}

标识信息#

字段必填说明
ida-z0-9- 组成的 2–40 个字符。必须与文件夹名相同。
name显示在商店和面板按钮上
versionmajor.minor.patch
description商店卡片上的一行说明
publisher作者
homepage必须是 https://
keywords用于商店搜索
links最多 6 个 { "label", "url" },作为按钮显示在卡片上(项目主页、文档、源码)
icon下方列表中的图标名

运行#

字段默认值说明
main必填相对于插件文件夹的入口点
runtimenodenode(登录 shell PATH 中的 Node.js 18+)、pythonpython3 <main>)或 executable(直接运行 <main>
apiVersion1编写时依据的插件 API 版本
activationEvents[]["onStartup"] 表示随 Agentty 一起启动,否则在首次使用时启动

Agentty 以插件文件夹作为工作目录启动程序。

与其他应用的集成#

字段说明
requires{ "name", "url", "note" } —— 该插件面向的应用或服务。卡片会显示是否检测到,未检测到时提供链接
detect集成目标应用的路径(可用 ~)。检测到则卡片标记为推荐

权限#

json
"permissions": ["prompt.inject", "terminal.write", "session.read", "workspace.read"]
权限允许的事
prompt.inject发送提示词
terminal.write向已打开的窗格输入
session.read读取 AI 对话
workspace.read列出工作区,查看上下文中的文件夹与标题字段

只申请你会用到的。清单会在安装前展示给用户,没有权限的调用会失败。参见插件权限

插件添加的内容#

面板#

json
"contributes": { "panel": { "title": "Hello", "icon": "sparkles" } }

会在标签栏添加按钮,并在终端右侧停靠一个面板(宽 360px,纵向滚动)。插件用 UI 树填充它 —— 参见 SDK

命令#

json
"contributes": {
  "commands": [
    {
      "id": "hello.explain",
      "title": "Hello: Explain this folder",
      "description": "Sends a tour request to the focused agent",
      "icon": "bot",
      "paneBar": true,
      "when": "agent",
      "palette": true
    }
  ]
}
字段说明
id插件内唯一;SDK 以此 id 注册处理器
title显示在命令面板中,前面加上插件名便于归类
description可选的第二行
icon窗格栏按钮的图标名
paneBartrue 时在 Claude Code / Codex 窗格上方的状态栏和分屏窗格标题中添加图标按钮
when把窗格栏按钮限定为 agent 窗格、shell 窗格或 always
palettefalse 时从命令面板中隐藏

窗格栏命令收到的是按下按钮的那个窗格的上下文,而不是当前聚焦窗格的。

图标#

icon 字段请使用下列名称,其他值会显示为拼图块。

text
app-window arrow-down arrow-left arrow-right arrow-up arrow-up-right at-sign bell bell-dot
blocks book-open bookmark bot brain bug calendar chart-column check chevron-down chevron-right
chevron-up circle-check circle-dot circle-pause circle-x clipboard clipboard-paste clock cloud
code columns-2 command container copy database download ellipsis external-link eye file-input
file-plus file-text folder folder-open folder-plus git-branch git-commit-horizontal
git-pull-request globe grip-vertical hammer hash history house image info key-round
layout-panel-left lightbulb link list list-tree loader-circle mail maximize-2 message-circle-question
message-square minimize-2 minus network notebook notebook-pen package panel-left-close
panel-left-open pencil picture-in-picture-2 play plug plus power puzzle refresh-cw rocket rotate-cw
rows-2 save scroll-text search send settings shield-alert sparkles square square-plus
square-terminal star sticky-note tag terminal trash-2 undo-2 unlink upload users wand-sparkles
workflow wrench x zap git-fork file lock graduation-cap

环境变量#

插件程序会收到以下环境变量:

变量含义
AGENTTY_PLUGIN_ID插件的 id
AGENTTY_PLUGIN_DIR插件文件夹
AGENTTY_PLUGIN_DATA存放设置与缓存的私有文件夹
AGENTTY_VERSIONAgentty 版本
AGENTTY_LANGUAGE用户语言(enkojazh
AGENTTY_BINagentty 命令行工具的路径

需要持久化的内容都请放在 AGENTTY_PLUGIN_DATA 里。