@amaster.ai/runtime-cli 1.1.0-beta.71 → 1.1.0-beta.73
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/dist/skill/SKILL.md +286 -0
- package/package.json +3 -2
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: amaster-runtime-cli
|
|
3
|
+
description: Use this skill when you need to operate or integrate the `@amaster.ai/runtime-cli` (`amaster`) CLI in this repository, especially for non-interactive app initialization, authentication, entity CRUD, BPM, workflow execution, S3 listing/upload, and OpenClaw bootstrap. Prefer the current source code over the README when they differ.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Amaster Runtime CLI
|
|
7
|
+
|
|
8
|
+
This skill is for AI agents that need to run or explain the `amaster` CLI from `packages/runtime-cli`.
|
|
9
|
+
|
|
10
|
+
## Source Of Truth
|
|
11
|
+
|
|
12
|
+
- Primary source: `packages/runtime-cli/src/cli.ts`
|
|
13
|
+
- Supporting behavior: `packages/runtime-cli/src/commands/*.ts` and `packages/runtime-cli/src/config.ts`
|
|
14
|
+
- The README documents the product intent, but it is currently ahead of the registered CLI surface in several places. When the README and source disagree, follow the source.
|
|
15
|
+
|
|
16
|
+
## Preferred Invocation
|
|
17
|
+
|
|
18
|
+
Inside this monorepo, prefer a built local binary instead of assuming a global install:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm --filter @amaster.ai/runtime-cli run build
|
|
22
|
+
node packages/runtime-cli/dist/cli.js <command> [options]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If the package is already installed globally, `amaster ...` is fine. For one-off usage outside the repo, `npx @amaster.ai/runtime-cli ...` is acceptable.
|
|
26
|
+
|
|
27
|
+
## Non-Interactive Rules
|
|
28
|
+
|
|
29
|
+
- Always prefer explicit flags over prompts.
|
|
30
|
+
- Pass `--app <app-code>` on commands that support it, unless you have already set a default app with `amaster use <app-code>`.
|
|
31
|
+
- For `login`, always pass `--email` and `--password` in automation.
|
|
32
|
+
- For `entity create`, `entity update`, `bpm start`, `bpm complete`, and `workflow execute`, always pass valid JSON strings with shell-safe quoting.
|
|
33
|
+
- For machine-oriented usage, disable color if needed:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
FORCE_COLOR=0 node packages/runtime-cli/dist/cli.js ...
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Expect non-zero exit codes on validation or API failures; several commands call `process.exit(1)` directly.
|
|
40
|
+
|
|
41
|
+
## Actual Registered Commands
|
|
42
|
+
|
|
43
|
+
These commands are registered in `src/cli.ts` today.
|
|
44
|
+
|
|
45
|
+
### App Selection And Bootstrap
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
amaster apps
|
|
49
|
+
amaster use <app-code>
|
|
50
|
+
amaster init --app-code <code> --url <url> [--api-key <key>] [--oss-endpoint <endpoint>]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Command semantics:
|
|
54
|
+
|
|
55
|
+
- `apps`: list locally configured apps from `~/.amaster/config.json`, mark the current app, and show whether each app has a valid auth session.
|
|
56
|
+
- `use <app-code>`: set the default app for later commands that omit `--app`.
|
|
57
|
+
- `init`: bootstrap one app into local config and OpenClaw.
|
|
58
|
+
|
|
59
|
+
Important details:
|
|
60
|
+
|
|
61
|
+
- `init` requires both `--app-code` and `--url`.
|
|
62
|
+
- `--url` is the app base URL used for all later API calls.
|
|
63
|
+
- `init` checks for `~/.openclaw`. If OpenClaw is not installed, initialization fails.
|
|
64
|
+
- `init` saves app config, downloads app-specific skills, and merges MCP servers into OpenClaw config.
|
|
65
|
+
- `init` is not just metadata setup. It mutates `~/.amaster` and `~/.openclaw`.
|
|
66
|
+
|
|
67
|
+
Minimal examples:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
node packages/runtime-cli/dist/cli.js apps
|
|
71
|
+
node packages/runtime-cli/dist/cli.js init --app-code myapp --url https://myapp.example.com
|
|
72
|
+
node packages/runtime-cli/dist/cli.js use myapp
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Authentication
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
amaster login [--app <app-code>] [--email <email>] [--password <password>]
|
|
79
|
+
amaster logout [--app <app-code>]
|
|
80
|
+
amaster whoami [--app <app-code>]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Command semantics:
|
|
84
|
+
|
|
85
|
+
- `login`: authenticate against the selected app and write `~/.amaster/auth-<appCode>.json`.
|
|
86
|
+
- `logout`: clear the local auth session and best-effort notify the remote auth service.
|
|
87
|
+
- `whoami`: fetch the current authenticated user profile through the SDK client.
|
|
88
|
+
|
|
89
|
+
Important details:
|
|
90
|
+
|
|
91
|
+
- If `--app` is omitted, the CLI resolves the current app from local config.
|
|
92
|
+
- `login` will prompt interactively if `--email` or `--password` is missing. Avoid that in automation.
|
|
93
|
+
- `whoami` requires both a configured app and a valid access token.
|
|
94
|
+
|
|
95
|
+
Minimal examples:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
node packages/runtime-cli/dist/cli.js login --app myapp --email user@example.com --password 'secret'
|
|
99
|
+
node packages/runtime-cli/dist/cli.js whoami --app myapp
|
|
100
|
+
node packages/runtime-cli/dist/cli.js logout --app myapp
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Entity
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
amaster entity list <namespace> <entity> [--app <app-code>] [--page <n>] [--page-size <n>]
|
|
107
|
+
amaster entity get <namespace> <entity> <id> [--app <app-code>]
|
|
108
|
+
amaster entity create <namespace> <entity> [--app <app-code>] --data '<json>'
|
|
109
|
+
amaster entity update <namespace> <entity> <id> [--app <app-code>] --data '<json>'
|
|
110
|
+
amaster entity delete <namespace> <entity> <id> [--app <app-code>]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Note:
|
|
114
|
+
|
|
115
|
+
- The first positional argument is `namespace`, not `app-code`. Select the app with `--app <app-code>` or `amaster use <app-code>`.
|
|
116
|
+
|
|
117
|
+
Command semantics:
|
|
118
|
+
|
|
119
|
+
- `list`: paginated list query for one entity type under one namespace.
|
|
120
|
+
- `get`: fetch one entity record by ID.
|
|
121
|
+
- `create`: create one entity record from a JSON object.
|
|
122
|
+
- `update`: update one entity record by ID with a JSON object.
|
|
123
|
+
- `delete`: delete one entity record by ID.
|
|
124
|
+
|
|
125
|
+
Important details:
|
|
126
|
+
|
|
127
|
+
- `namespace` is a logical data namespace such as `default`; it is not the same as app selection.
|
|
128
|
+
- `entity` is the entity code or collection name.
|
|
129
|
+
- `--data` must be valid JSON. Invalid JSON throws before the API call completes.
|
|
130
|
+
- `list` output is human-oriented and truncated to a subset of fields. Use `get` or the SDK if you need full structured output.
|
|
131
|
+
|
|
132
|
+
Minimal examples:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
node packages/runtime-cli/dist/cli.js entity list default users --app myapp --page 1 --page-size 20
|
|
136
|
+
node packages/runtime-cli/dist/cli.js entity get default users 123 --app myapp
|
|
137
|
+
node packages/runtime-cli/dist/cli.js entity create default users --app myapp --data '{"name":"Ada","email":"ada@example.com"}'
|
|
138
|
+
node packages/runtime-cli/dist/cli.js entity update default users 123 --app myapp --data '{"name":"Ada Lovelace"}'
|
|
139
|
+
node packages/runtime-cli/dist/cli.js entity delete default users 123 --app myapp
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### BPM
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
amaster bpm processes [--app <app-code>]
|
|
146
|
+
amaster bpm start <key> [--app <app-code>] [--variables '<json>']
|
|
147
|
+
amaster bpm tasks [--app <app-code>] [--assignee <uid>]
|
|
148
|
+
amaster bpm complete <id> [--app <app-code>] [--variables '<json>']
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Command semantics:
|
|
152
|
+
|
|
153
|
+
- `processes`: list process definitions available in the selected app.
|
|
154
|
+
- `start <key>`: start one process instance by process definition key.
|
|
155
|
+
- `tasks`: list current tasks, optionally filtered by assignee.
|
|
156
|
+
- `complete <id>`: complete one task with optional process variables.
|
|
157
|
+
|
|
158
|
+
Important details:
|
|
159
|
+
|
|
160
|
+
- `start` expects `key` to be the BPM process definition key, not an instance ID.
|
|
161
|
+
- `complete` expects a task ID, not a process instance ID.
|
|
162
|
+
- `--variables` must be a JSON object.
|
|
163
|
+
|
|
164
|
+
Minimal examples:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
node packages/runtime-cli/dist/cli.js bpm processes --app myapp
|
|
168
|
+
node packages/runtime-cli/dist/cli.js bpm start order-approval --app myapp --variables '{"orderId":"123"}'
|
|
169
|
+
node packages/runtime-cli/dist/cli.js bpm tasks --app myapp --assignee u_001
|
|
170
|
+
node packages/runtime-cli/dist/cli.js bpm complete task_123 --app myapp --variables '{"approved":true}'
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Workflow
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
amaster workflow list [--app <app-code>]
|
|
177
|
+
amaster workflow execute <id> [--app <app-code>] [--input '<json>']
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Command semantics:
|
|
181
|
+
|
|
182
|
+
- `list`: list workflow definitions visible to the selected app.
|
|
183
|
+
- `execute <id>`: run one workflow by workflow ID and print the execution result.
|
|
184
|
+
|
|
185
|
+
Important details:
|
|
186
|
+
|
|
187
|
+
- `execute` expects a workflow ID as wired by the backend client.
|
|
188
|
+
- `--input` must be valid JSON and defaults to `{}` when omitted.
|
|
189
|
+
|
|
190
|
+
Minimal examples:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
node packages/runtime-cli/dist/cli.js workflow list --app myapp
|
|
194
|
+
node packages/runtime-cli/dist/cli.js workflow execute wf_123 --app myapp --input '{"documentId":"abc"}'
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### S3
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
amaster s3 list [--app <app-code>] [--bucket <bucket>]
|
|
201
|
+
amaster s3 upload <file> [--app <app-code>] [--bucket <bucket>] [--key <object-key>]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Command semantics:
|
|
205
|
+
|
|
206
|
+
- `list`: list files in S3-like storage, optionally constrained to one bucket.
|
|
207
|
+
- `upload <file>`: upload one local file and optionally override bucket and object key.
|
|
208
|
+
|
|
209
|
+
Important details:
|
|
210
|
+
|
|
211
|
+
- `upload` resolves `<file>` against the current working directory and fails fast if the file does not exist.
|
|
212
|
+
- `list` prints human-readable rows with key, size, and modification time.
|
|
213
|
+
- `upload` prints uploaded key, URL, and bucket.
|
|
214
|
+
|
|
215
|
+
Minimal examples:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
node packages/runtime-cli/dist/cli.js s3 list --app myapp --bucket docs
|
|
219
|
+
node packages/runtime-cli/dist/cli.js s3 upload ./report.pdf --app myapp --bucket docs --key reports/2026-03/report.pdf
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Important README Mismatches
|
|
223
|
+
|
|
224
|
+
Do not assume the following README-documented commands are available unless `src/cli.ts` is updated to register them:
|
|
225
|
+
|
|
226
|
+
- `amaster config ...`
|
|
227
|
+
- `amaster register ...`
|
|
228
|
+
- `amaster users ...`
|
|
229
|
+
- `amaster doctor`
|
|
230
|
+
- `amaster list`
|
|
231
|
+
- `amaster switch ...`
|
|
232
|
+
- `amaster uninstall ...`
|
|
233
|
+
- `amaster init --force`
|
|
234
|
+
- `amaster entity types ...`
|
|
235
|
+
- `amaster bpm claim ...`
|
|
236
|
+
- `amaster bpm instances`
|
|
237
|
+
- `amaster bpm instance <id>`
|
|
238
|
+
- `amaster workflow get <id>`
|
|
239
|
+
- `amaster workflow executions ...`
|
|
240
|
+
- `amaster workflow execution <id>`
|
|
241
|
+
- `amaster s3 download ...`
|
|
242
|
+
- `amaster s3 delete ...`
|
|
243
|
+
- `amaster s3 url ...`
|
|
244
|
+
|
|
245
|
+
Some of these behaviors exist as helper functions in command modules, but they are not currently wired into the public CLI.
|
|
246
|
+
|
|
247
|
+
The README also uses some outdated file names and examples. The source currently writes `~/.amaster/config.json`, not `~/.amaster/cli-config.json`.
|
|
248
|
+
|
|
249
|
+
## Runtime State And File Locations
|
|
250
|
+
|
|
251
|
+
Current source uses these paths:
|
|
252
|
+
|
|
253
|
+
- App config: `~/.amaster/config.json`
|
|
254
|
+
- Per-app auth session: `~/.amaster/auth-<appCode>.json`
|
|
255
|
+
- OpenClaw config: `~/.openclaw/config.json`
|
|
256
|
+
- Installed OpenClaw skills: `~/.openclaw/skills/<appCode>/`
|
|
257
|
+
|
|
258
|
+
During `init`, the CLI fetches app resources from OSS:
|
|
259
|
+
|
|
260
|
+
- Skills manifest: `/openclaw/apps/<appCode>/skills/manifest.json`
|
|
261
|
+
- MCP config: `/openclaw/apps/<appCode>/mcp-config.yaml`
|
|
262
|
+
- Default OSS endpoint: `https://amaster.oss-cn-hangzhou.aliyuncs.com`
|
|
263
|
+
|
|
264
|
+
## Recommended Agent Workflow
|
|
265
|
+
|
|
266
|
+
1. Build the package if you are operating from source.
|
|
267
|
+
2. Run `amaster init --app-code <code> --url <url>` for first-time app setup.
|
|
268
|
+
3. Run `amaster login --app <code> --email ... --password ...`.
|
|
269
|
+
4. Set a default app with `amaster use <code>` if you will make multiple calls.
|
|
270
|
+
5. Use explicit JSON flags for create, update, start, complete, and execute operations.
|
|
271
|
+
6. Prefer list or get operations before destructive changes.
|
|
272
|
+
|
|
273
|
+
## When To Use The SDK Instead
|
|
274
|
+
|
|
275
|
+
Prefer calling `@amaster.ai/client` directly when:
|
|
276
|
+
|
|
277
|
+
- You need stable structured data instead of human-formatted terminal output.
|
|
278
|
+
- You need command coverage that the CLI has not registered yet.
|
|
279
|
+
- You want richer retries, error handling, or composition inside a larger program.
|
|
280
|
+
|
|
281
|
+
## Interpretation Guidance For Agents
|
|
282
|
+
|
|
283
|
+
- Treat this skill as an execution guide, not as proof that every README example is valid.
|
|
284
|
+
- Prefer the command signatures in this file over README prose.
|
|
285
|
+
- Before destructive operations such as `entity delete`, confirm the target exists with `get` or `list` unless the user explicitly asked for blind deletion.
|
|
286
|
+
- If you need structured machine-readable results, switch to `@amaster.ai/client` instead of scraping terminal output.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/runtime-cli",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.73",
|
|
4
4
|
"description": "CLI for Amaster SDK - Multi-app support for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"ora": "^8.0.1",
|
|
40
40
|
"yaml": "^2.3.4",
|
|
41
41
|
"inquirer": "^9.2.12",
|
|
42
|
-
"@amaster.ai/client": "1.1.0-beta.
|
|
42
|
+
"@amaster.ai/client": "1.1.0-beta.73"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/inquirer": "^9.0.7",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsup",
|
|
58
|
+
"postbuild": "node scripts/copy-skill.mjs",
|
|
58
59
|
"dev": "tsup --watch",
|
|
59
60
|
"clean": "rm -rf dist *.tsbuildinfo",
|
|
60
61
|
"type-check": "tsc --noEmit",
|