playcanvas-agent-bridge-cli 0.2.0 → 0.2.2

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 CHANGED
@@ -6,14 +6,14 @@ The core interface is the `pcbridge` command plus a local daemon and a Chrome Ma
6
6
 
7
7
  ## Install
8
8
 
9
- When published to npm:
9
+ From npm:
10
10
 
11
11
  ```bash
12
12
  npm install -g playcanvas-agent-bridge-cli
13
13
  pcbridge install-skill --agent all
14
14
  ```
15
15
 
16
- From this GitHub repository before npm publishing:
16
+ From this GitHub repository for unreleased changes:
17
17
 
18
18
  ```bash
19
19
  npm install -g github:Q-My99/playcanvas-agent-bridge-cli
@@ -23,8 +23,8 @@ pcbridge install-skill --agent all
23
23
  One-shot with npx:
24
24
 
25
25
  ```bash
26
- npx github:Q-My99/playcanvas-agent-bridge-cli doctor
27
- npx github:Q-My99/playcanvas-agent-bridge-cli install-skill --agent all
26
+ npx playcanvas-agent-bridge-cli doctor
27
+ npx playcanvas-agent-bridge-cli install-skill --agent all
28
28
  ```
29
29
 
30
30
  ## Install the Chrome extension
@@ -68,29 +68,70 @@ pcbridge targets
68
68
  pcbridge eval --target current --code "return { href: location.href, hasEditor: !!editor }"
69
69
  ```
70
70
 
71
+ ## Progressive help
72
+
73
+ The CLI exposes layered help so agents can load only the command surface they need:
74
+
75
+ ```bash
76
+ pcbridge help
77
+ pcbridge help entity
78
+ pcbridge help asset
79
+ pcbridge help material
80
+ pcbridge help template
81
+ pcbridge help script
82
+ pcbridge help scene
83
+ pcbridge help store
84
+ pcbridge help viewport
85
+ pcbridge help eval
86
+ ```
87
+
88
+ Use structured commands for small, known operations that map cleanly to one Editor action. Use
89
+ `pcbridge eval` for exploratory work, custom Editor/Engine API workflows, and large multi-step
90
+ scene edits where one script is clearer and faster than many CLI calls.
91
+
71
92
  ## Common commands
72
93
 
73
94
  ```bash
74
95
  pcbridge entity list --target current --limit 50
96
+ pcbridge entity list --target current --tag enemy --component render
75
97
  pcbridge entity create --target current --json ./entity.json
98
+ pcbridge entity create-many --target current --json ./entities.json
76
99
  pcbridge entity patch --target current --id <resource_id> --set position='[0,1,0]'
100
+ pcbridge entity patch-many --target current --json ./edits.json
101
+ pcbridge entity duplicate --target current --id <resource_id>
102
+ pcbridge entity reparent --target current --id <resource_id> --parent <parent_resource_id>
77
103
  pcbridge entity set-material --target current --id <resource_id> --material-id <material_asset_id>
78
104
  pcbridge entity add-script --target current --id <resource_id> --asset-id <script_asset_id> --attributes '{"speed":2.5}'
79
105
  pcbridge entity delete --target current --id <resource_id>
80
106
 
81
107
  pcbridge asset list --target current --type script
108
+ pcbridge asset list --target current --tag generated
82
109
  pcbridge asset get --target current --id <asset_id>
110
+ pcbridge asset create --target current --json ./assets.json
83
111
  pcbridge asset folder ensure --target current --path "AI Agent Bridge/Demo/Textures"
84
112
  pcbridge asset upload --target current --file ./texture.png --name DemoTexture --folder "AI Agent Bridge/Demo/Textures"
113
+ pcbridge asset instantiate --target current --id <template_asset_id>
85
114
  pcbridge asset delete --target current --id <asset_id>
86
115
 
87
116
  pcbridge material create --target current --name DemoMaterial --folder "AI Agent Bridge/Demo/Materials" --diffuse-map <texture_asset_id>
117
+ pcbridge material patch --target current --asset-id <asset_id> --set diffuse='[1,0,0]'
118
+
119
+ pcbridge template create --target current --entity-id <resource_id> --name DemoTemplate --folder "AI Agent Bridge/Demo/Templates"
120
+ pcbridge template instantiate --target current --id <template_asset_id>
88
121
 
89
122
  pcbridge script create --target current --filename controller.js --file ./controller.js --folder "AI Agent Bridge/Demo/Scripts"
90
123
  pcbridge script set-text --target current --asset-id <asset_id> --file ./controller.js
91
124
  pcbridge script parse --target current --asset-id <asset_id>
92
125
 
126
+ pcbridge scene settings get --target current
127
+ pcbridge scene settings patch --target current --set physics.gravity='[0,-9.8,0]'
128
+
129
+ pcbridge store search --target current --search vehicle --limit 20
130
+ pcbridge store get --target current --id <store_asset_id>
131
+ pcbridge store download --target current --id <store_asset_id> --name Vehicle --license-json ./license.json
132
+
93
133
  pcbridge viewport capture --target current --out ./tmp/playcanvas-viewport.png
134
+ pcbridge viewport focus --target current --id <resource_id> --view perspective
94
135
  ```
95
136
 
96
137
  ## Texture + material + script workflow
package/README.zh-CN.md CHANGED
@@ -6,14 +6,14 @@
6
6
 
7
7
  ## 安装
8
8
 
9
- 发布到 npm 后:
9
+ 从 npm 安装:
10
10
 
11
11
  ```bash
12
12
  npm install -g playcanvas-agent-bridge-cli
13
13
  pcbridge install-skill --agent all
14
14
  ```
15
15
 
16
- 在 npm 发布前,也可以直接从这个 GitHub 仓库安装:
16
+ 如果要测试尚未发布的改动,也可以直接从这个 GitHub 仓库安装:
17
17
 
18
18
  ```bash
19
19
  npm install -g github:Q-My99/playcanvas-agent-bridge-cli
@@ -23,8 +23,8 @@ pcbridge install-skill --agent all
23
23
  用 npx 一次性运行:
24
24
 
25
25
  ```bash
26
- npx github:Q-My99/playcanvas-agent-bridge-cli doctor
27
- npx github:Q-My99/playcanvas-agent-bridge-cli install-skill --agent all
26
+ npx playcanvas-agent-bridge-cli doctor
27
+ npx playcanvas-agent-bridge-cli install-skill --agent all
28
28
  ```
29
29
 
30
30
  ## 安装 Chrome 插件
@@ -68,29 +68,69 @@ pcbridge targets
68
68
  pcbridge eval --target current --code "return { href: location.href, hasEditor: !!editor }"
69
69
  ```
70
70
 
71
+ ## 渐进式 help
72
+
73
+ CLI 提供分层 help,方便 agent 只加载当前需要的命令面:
74
+
75
+ ```bash
76
+ pcbridge help
77
+ pcbridge help entity
78
+ pcbridge help asset
79
+ pcbridge help material
80
+ pcbridge help template
81
+ pcbridge help script
82
+ pcbridge help scene
83
+ pcbridge help store
84
+ pcbridge help viewport
85
+ pcbridge help eval
86
+ ```
87
+
88
+ 小而明确、能对应到单个 Editor 操作的任务优先用结构化命令。探索 API、自定义
89
+ Editor/Engine 工作流、大量多步骤场景修改,则优先用 `pcbridge eval`,一段脚本通常更清楚也更快。
90
+
71
91
  ## 常用命令
72
92
 
73
93
  ```bash
74
94
  pcbridge entity list --target current --limit 50
95
+ pcbridge entity list --target current --tag enemy --component render
75
96
  pcbridge entity create --target current --json ./entity.json
97
+ pcbridge entity create-many --target current --json ./entities.json
76
98
  pcbridge entity patch --target current --id <resource_id> --set position='[0,1,0]'
99
+ pcbridge entity patch-many --target current --json ./edits.json
100
+ pcbridge entity duplicate --target current --id <resource_id>
101
+ pcbridge entity reparent --target current --id <resource_id> --parent <parent_resource_id>
77
102
  pcbridge entity set-material --target current --id <resource_id> --material-id <material_asset_id>
78
103
  pcbridge entity add-script --target current --id <resource_id> --asset-id <script_asset_id> --attributes '{"speed":2.5}'
79
104
  pcbridge entity delete --target current --id <resource_id>
80
105
 
81
106
  pcbridge asset list --target current --type script
107
+ pcbridge asset list --target current --tag generated
82
108
  pcbridge asset get --target current --id <asset_id>
109
+ pcbridge asset create --target current --json ./assets.json
83
110
  pcbridge asset folder ensure --target current --path "AI Agent Bridge/Demo/Textures"
84
111
  pcbridge asset upload --target current --file ./texture.png --name DemoTexture --folder "AI Agent Bridge/Demo/Textures"
112
+ pcbridge asset instantiate --target current --id <template_asset_id>
85
113
  pcbridge asset delete --target current --id <asset_id>
86
114
 
87
115
  pcbridge material create --target current --name DemoMaterial --folder "AI Agent Bridge/Demo/Materials" --diffuse-map <texture_asset_id>
116
+ pcbridge material patch --target current --asset-id <asset_id> --set diffuse='[1,0,0]'
117
+
118
+ pcbridge template create --target current --entity-id <resource_id> --name DemoTemplate --folder "AI Agent Bridge/Demo/Templates"
119
+ pcbridge template instantiate --target current --id <template_asset_id>
88
120
 
89
121
  pcbridge script create --target current --filename controller.js --file ./controller.js --folder "AI Agent Bridge/Demo/Scripts"
90
122
  pcbridge script set-text --target current --asset-id <asset_id> --file ./controller.js
91
123
  pcbridge script parse --target current --asset-id <asset_id>
92
124
 
125
+ pcbridge scene settings get --target current
126
+ pcbridge scene settings patch --target current --set physics.gravity='[0,-9.8,0]'
127
+
128
+ pcbridge store search --target current --search vehicle --limit 20
129
+ pcbridge store get --target current --id <store_asset_id>
130
+ pcbridge store download --target current --id <store_asset_id> --name Vehicle --license-json ./license.json
131
+
93
132
  pcbridge viewport capture --target current --out ./tmp/playcanvas-viewport.png
133
+ pcbridge viewport focus --target current --id <resource_id> --view perspective
94
134
  ```
95
135
 
96
136
  ## 贴图 + 材质 + 脚本工作流