@agy-daddy/plugin-cli 1.1.0 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -5
- package/agy-plugin.json +31 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,87 @@
|
|
|
1
1
|
# @agy-daddy/plugin-cli
|
|
2
2
|
|
|
3
|
-
Agy-Daddy Layer
|
|
3
|
+
Agy-Daddy 官方 Layer 1 终端与多路复用器启动插件:顶栏 CLI 胶囊与多平台终端一键唤起。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
5
|
+
- **npm 包名**:`@agy-daddy/plugin-cli`
|
|
6
|
+
- **Layer 层级**:Layer 1(接入与工作区层)
|
|
7
|
+
- **信任等级**:官方 `T0`(声明 `dom:write`、`bridge:route`、`process:spawn`、`fs:brain-read`、`rpc:read` 权限)
|
|
8
|
+
- **适用场景**:一键从当前会话工作区启动独立终端 CLI(Terminal、iTerm2、Ghostty、Warp、Rex、WezTerm、tmux、Windows Terminal、PowerShell 等)。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 核心功能与安全默认值
|
|
13
|
+
|
|
14
|
+
- **跨平台终端集成**:智能探测并支持 macOS、Linux 与 Windows 下的主流终端与复用器(Terminal、iTerm2、Alacritty、Kitty、Ghostty、Warp、Rex、WezTerm、tmux、Windows Terminal、PowerShell)。
|
|
15
|
+
- **工作区上下文与环境继承**:自动识别当前 Antigravity 会话的工作区绝对路径,并软消费可选 `proxy.getCliEnv()` 自动继承代理环境变量(`127.0.0.1:18766`)与真彩色支持。
|
|
16
|
+
- **参数安全转义**:严格转义 `muxHost`、自定义启动参数与工作路径,拦截命令注入。
|
|
17
|
+
- **安全默认值**:
|
|
18
|
+
- `cliPermissionMode: "default"`:默认保持标准权限模式,不默认开启免审核高危模式;
|
|
19
|
+
- `cliMuxHost: ""`:默认本地启动,不预连未受信任远程主机。
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 安装与启用方式
|
|
24
|
+
|
|
25
|
+
### 1. 随官方全量安装
|
|
26
|
+
```sh
|
|
27
|
+
agy-daddy plugin install --official
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. 单独安装
|
|
31
|
+
```sh
|
|
32
|
+
agy-daddy plugin install npm:@agy-daddy/plugin-cli
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 3. 宿主设置中心与顶栏交互
|
|
36
|
+
安装后自动激活(`onStartup`)。插件在顶栏右侧集群挂载 CLI 启动胶囊(order: 40)。点击即可在新终端窗口中进入当前工作区并启动 CLI,亦可在设置中心「CLI 终端启动器」中配置常用命令与终端路径。
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 配置项说明表
|
|
41
|
+
|
|
42
|
+
对照 `settings.schema.json`:
|
|
43
|
+
|
|
44
|
+
| Key | 类型 | 默认值 | 说明 |
|
|
45
|
+
|---|---|---|---|
|
|
46
|
+
| `terminalApp` | `enum` | `"auto"` | 目标终端 / 多路复用器:从顶栏点击 CLI 胶囊时优先唤起的终端或会话复用器(可选 auto, Terminal, iTerm2, Alacritty, Kitty, Ghostty, Warp, Rex, WezTerm, tmux, Windows Terminal, PowerShell) |
|
|
47
|
+
| `customTerminalPath` | `string` | `""` | 终端程序路径:切换终端后自动检测并回显路径;检测失败时请手动输入或点击「浏览选择」 |
|
|
48
|
+
| `cliMuxHost` | `string` | `""` | SSH 多路复用主机:支持下拉选择 ~/.ssh/config 主机或直接输入 user@host;留空则在本地启动 |
|
|
49
|
+
| `cliLabel` | `string` | `"CLI"` | 默认按钮显示名称:自定义顶栏默认 CLI 启动按钮与菜单标题的显示名称 |
|
|
50
|
+
| `cliDefaultModel` | `string` | `""` | 默认 CLI 模型:支持下拉选择可用模型或直接输入自定义模型标识,留空沿用 CLI 默认配置 |
|
|
51
|
+
| `cliPermissionMode` | `enum` | `"default"` | 启动权限模式:设置启动 agy 时的工具执行权限策略;可选 `default`(标准)或 `bypass`(免审核,仅建议在受信任工作区使用) |
|
|
52
|
+
| `cliDefaultCommand` | `string` | `""` | 默认启动命令:根据模型与权限选项自动拼接生成,支持直接编辑或追加参数 |
|
|
53
|
+
| `quickCommands` | `list` | `[]` | 自定义快捷启动命令:添加任意终端命令用于顶栏快速启动(如 claude、codex、npm run dev 等),可选择固定在顶栏或收纳进 CLI 菜单 |
|
|
54
|
+
|
|
55
|
+
### 声明式操作(Actions)
|
|
56
|
+
- **在新终端启动 CLI (`launch`)**:触发命令 `cli.launch`。
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 提供的服务 / 事件 / 命令 / 扩展位
|
|
61
|
+
|
|
62
|
+
严格依据 `agy-plugin.json` 声明:
|
|
63
|
+
|
|
64
|
+
- **Permissions**:`dom:write`、`bridge:route`、`process:spawn`、`fs:brain-read`、`rpc:read`
|
|
65
|
+
- **Requires Anchors**:
|
|
66
|
+
- `topbar.rightCluster`:顶栏右侧集群锚点(用于挂载 CLI 启动胶囊)
|
|
67
|
+
- **Services (provides)**:
|
|
68
|
+
- `cli`(版本 `1.0.0`,realm: `node`)
|
|
69
|
+
- **Consumes Services**:
|
|
70
|
+
- `proxy`(版本 `^1.0.0`,optional: `true`)
|
|
71
|
+
- **Commands (contributes)**:
|
|
72
|
+
- `cli.launch`:在新终端启动 CLI
|
|
73
|
+
- **Topbar Units (contributes)**:
|
|
74
|
+
- `cli`(order: `40`)
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 使用示例与本地测试
|
|
79
|
+
|
|
80
|
+
### 使用示例
|
|
81
|
+
在 Antigravity 中打开一个项目后,直接点击顶栏的「CLI」胶囊,即可自动在系统默认终端(或配置的 iTerm2 / tmux)中唤起命令行会话,且工作目录自动定位到当前项目路径。
|
|
82
|
+
|
|
83
|
+
### 本地测试
|
|
84
|
+
在插件目录下执行自动化单元测试:
|
|
85
|
+
```sh
|
|
86
|
+
npm test
|
|
87
|
+
```
|
package/agy-plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"id": "agy-daddy.cli",
|
|
4
4
|
"publisher": "agy-daddy",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"displayName": {
|
|
8
8
|
"zh-CN": "CLI 终端启动器",
|
|
@@ -19,17 +19,27 @@
|
|
|
19
19
|
"main": "./src/node.js",
|
|
20
20
|
"renderer": "./src/renderer.js",
|
|
21
21
|
"world": "isolated",
|
|
22
|
-
"activationEvents": [
|
|
22
|
+
"activationEvents": [
|
|
23
|
+
"onStartup"
|
|
24
|
+
],
|
|
23
25
|
"requires": {
|
|
24
|
-
"anchors": [
|
|
26
|
+
"anchors": [
|
|
27
|
+
"topbar.rightCluster"
|
|
28
|
+
]
|
|
25
29
|
},
|
|
26
30
|
"provides": {
|
|
27
31
|
"services": {
|
|
28
|
-
"cli": {
|
|
32
|
+
"cli": {
|
|
33
|
+
"version": "1.0.0",
|
|
34
|
+
"realm": "node"
|
|
35
|
+
}
|
|
29
36
|
}
|
|
30
37
|
},
|
|
31
38
|
"consumes": {
|
|
32
|
-
"proxy": {
|
|
39
|
+
"proxy": {
|
|
40
|
+
"version": "^1.0.0",
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
33
43
|
},
|
|
34
44
|
"permissions": [
|
|
35
45
|
"dom:write",
|
|
@@ -39,10 +49,23 @@
|
|
|
39
49
|
"rpc:read"
|
|
40
50
|
],
|
|
41
51
|
"contributes": {
|
|
42
|
-
"topbar.units": [
|
|
43
|
-
|
|
52
|
+
"topbar.units": [
|
|
53
|
+
{
|
|
54
|
+
"id": "cli",
|
|
55
|
+
"order": 40
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"settings": {
|
|
59
|
+
"schema": "./settings.schema.json"
|
|
60
|
+
},
|
|
44
61
|
"commands": [
|
|
45
|
-
{
|
|
62
|
+
{
|
|
63
|
+
"id": "cli.launch",
|
|
64
|
+
"title": {
|
|
65
|
+
"zh-CN": "在新终端启动 CLI",
|
|
66
|
+
"en": "Launch CLI in terminal"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
46
69
|
],
|
|
47
70
|
"locales": "./locales"
|
|
48
71
|
}
|