@powerformer/refly-cli 0.1.13 → 0.1.15
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/bin/refly.js +2842 -2043
- package/dist/bin/refly.js.map +1 -1
- package/dist/index.d.ts +1 -370
- package/dist/index.js +64 -329
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/skill/SKILL.md +21 -18
- package/skill/references/file.md +21 -9
- package/skill/references/node.md +64 -40
- package/skill/references/skill.md +376 -31
- package/skill/references/workflow.md +136 -43
|
@@ -2,36 +2,217 @@
|
|
|
2
2
|
|
|
3
3
|
## CLI Commands
|
|
4
4
|
|
|
5
|
+
### Discovery
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# List skill packages
|
|
9
|
+
refly skill list [options]
|
|
10
|
+
--status <status> # Filter: draft, published, deprecated
|
|
11
|
+
--mine # Show only my packages
|
|
12
|
+
--tags <tags> # Filter by tags (comma-separated)
|
|
13
|
+
--page <number> # Page number (default: 1)
|
|
14
|
+
--page-size <number> # Page size (default: 20)
|
|
15
|
+
|
|
16
|
+
# Search public packages
|
|
17
|
+
refly skill search <query> [options]
|
|
18
|
+
--tags <tags> # Filter by tags (comma-separated)
|
|
19
|
+
--page <number> # Page number (default: 1)
|
|
20
|
+
--page-size <number> # Page size (default: 20)
|
|
21
|
+
|
|
22
|
+
# Get skill details
|
|
23
|
+
refly skill get <skillId> [options]
|
|
24
|
+
--include-workflows # Include workflow details
|
|
25
|
+
--share-id <shareId> # Share ID for private skills
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Lifecycle
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Create skill package (see "Skill Creation Modes" below)
|
|
32
|
+
refly skill create [options]
|
|
33
|
+
--name <name> # Skill name (required)
|
|
34
|
+
--version <version> # Semantic version (default: 1.0.0)
|
|
35
|
+
--description <desc> # Skill description
|
|
36
|
+
--triggers <triggers> # Trigger phrases (comma-separated)
|
|
37
|
+
--tags <tags> # Category tags (comma-separated)
|
|
38
|
+
--workflow <workflowId> # Bind single workflow
|
|
39
|
+
--workflow-ids <ids> # Bind multiple workflows (comma-separated)
|
|
40
|
+
--workflow-spec <json> # Workflow spec JSON
|
|
41
|
+
--workflow-query <query> # Natural language description
|
|
42
|
+
--verbose # Include workflow details in output
|
|
43
|
+
|
|
44
|
+
# Publishing
|
|
45
|
+
refly skill publish <skillId> # Make public
|
|
46
|
+
refly skill unpublish <skillId> # Make private
|
|
47
|
+
refly skill delete <skillId> [options]
|
|
48
|
+
--force # Skip confirmation
|
|
49
|
+
|
|
50
|
+
# Local management
|
|
51
|
+
refly skill sync [options] # Sync registry with filesystem
|
|
52
|
+
--dry-run # Preview changes only
|
|
53
|
+
--prune # Remove orphan entries
|
|
54
|
+
|
|
55
|
+
refly skill validate [path] [options]
|
|
56
|
+
--fix # Attempt to fix issues
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Install skill
|
|
63
|
+
refly skill install <skillId> [options]
|
|
64
|
+
--version <version> # Specific version
|
|
65
|
+
--share-id <shareId> # Share ID for private skills
|
|
66
|
+
--config <json> # Installation config JSON
|
|
67
|
+
|
|
68
|
+
# List installations
|
|
69
|
+
refly skill installations [options]
|
|
70
|
+
--status <status> # Filter: downloading, initializing, ready, error, disabled
|
|
71
|
+
--page <number> # Page number (default: 1)
|
|
72
|
+
--page-size <number> # Page size (default: 20)
|
|
73
|
+
|
|
74
|
+
# Uninstall
|
|
75
|
+
refly skill uninstall <installationId> [options]
|
|
76
|
+
--force # Skip confirmation
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Execution
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Run installed skill
|
|
83
|
+
refly skill run <installationId> [options]
|
|
84
|
+
--input <json> # Input JSON for the skill
|
|
85
|
+
--workflow <skillWorkflowId> # Run specific workflow only
|
|
86
|
+
--async # Run asynchronously
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Skill Creation Modes
|
|
92
|
+
|
|
93
|
+
### Mode 1: Generate Workflow from Query
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
refly skill create --name <name> --workflow-query "<query>"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Behavior:
|
|
100
|
+
1. Calls backend AI to generate workflow
|
|
101
|
+
2. Creates skill and binds workflow
|
|
102
|
+
3. Returns skillId + workflowId
|
|
103
|
+
|
|
104
|
+
Optional metadata (does not generate workflow by itself):
|
|
105
|
+
- `--description`, `--triggers`, `--tags`
|
|
106
|
+
|
|
107
|
+
Example:
|
|
108
|
+
```bash
|
|
109
|
+
refly skill create \
|
|
110
|
+
--name comfyui-refly-skill \
|
|
111
|
+
--workflow-query "ComfyUI image generation workflow collection" \
|
|
112
|
+
--description "ComfyUI image workflow collection" \
|
|
113
|
+
--triggers "comfyui,text to image,image generation,image to image" \
|
|
114
|
+
--tags "image,comfyui"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Mode 2: Bind Existing Workflow(s)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
refly skill create --name <name> --workflow <workflowId>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Bind multiple workflows:
|
|
124
|
+
```bash
|
|
125
|
+
refly skill create --name <name> --workflow-ids "<workflowId1,workflowId2>"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
```bash
|
|
130
|
+
refly skill create \
|
|
131
|
+
--name my-skill \
|
|
132
|
+
--description "My custom skill" \
|
|
133
|
+
--workflow c-zybbx65ydi5npo7xevjx1wlr \
|
|
134
|
+
--triggers "custom,workflow" \
|
|
135
|
+
--tags "internal"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Mode 3b: Bind Multiple Workflows (Explicit)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
refly skill create --name <name> --workflow-ids "<workflowId1,workflowId2>"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Example:
|
|
145
|
+
```bash
|
|
146
|
+
refly skill create \
|
|
147
|
+
--name multi-workflow-skill \
|
|
148
|
+
--description "Multiple workflow entry points" \
|
|
149
|
+
--workflow-ids "c-aaa111,c-bbb222" \
|
|
150
|
+
--triggers "multi,entry" \
|
|
151
|
+
--tags "batch,workflow"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Mode 3: Use Workflow Spec (Structured)
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
refly skill create --name <name> --workflow-spec '<json>'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Example:
|
|
161
|
+
```bash
|
|
162
|
+
refly skill create \
|
|
163
|
+
--name pdf-processor \
|
|
164
|
+
--workflow-spec '{
|
|
165
|
+
"nodes": [
|
|
166
|
+
{"id": "n1", "type": "start", "data": {"title": "Start"}},
|
|
167
|
+
{"id": "n2", "type": "skillResponse", "data": {"title": "Process PDF", "metadata": {"query": "Extract and summarize PDF content"}}}
|
|
168
|
+
],
|
|
169
|
+
"edges": [
|
|
170
|
+
{"id": "e1", "source": "n1", "target": "n2"}
|
|
171
|
+
]
|
|
172
|
+
}'
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> **Note**: Examples use `start` and `skillResponse`. Additional node types may be supported by backend.
|
|
176
|
+
|
|
177
|
+
### Mode 4: Local Skill Only (No Cloud Package)
|
|
178
|
+
|
|
179
|
+
Use when you only want a local skill directory and registry entry.
|
|
180
|
+
|
|
5
181
|
```bash
|
|
6
|
-
#
|
|
7
|
-
refly skill
|
|
8
|
-
|
|
9
|
-
refly skill get <name> # Get skill details
|
|
182
|
+
# Create local skill files manually, then sync
|
|
183
|
+
refly skill sync
|
|
184
|
+
```
|
|
10
185
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
refly skill
|
|
14
|
-
refly skill delete <name> # Delete skill
|
|
186
|
+
You can later create a cloud skill package with:
|
|
187
|
+
```bash
|
|
188
|
+
refly skill create --name <name> --workflow <workflowId>
|
|
15
189
|
```
|
|
16
190
|
|
|
17
191
|
---
|
|
18
192
|
|
|
193
|
+
## Workflow Generation Logic
|
|
194
|
+
|
|
195
|
+
When no `--workflow`, `--workflow-ids`, `--workflow-spec`, or `--workflow-query` is specified,
|
|
196
|
+
CLI will return `skill.create.needs_workflow` with suggested options and examples.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
19
200
|
## Directory Structure
|
|
20
201
|
|
|
21
202
|
```
|
|
22
203
|
~/.claude/skills/refly/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
204
|
+
|-- SKILL.md # Base skill
|
|
205
|
+
|-- registry.json # Skill index
|
|
206
|
+
|-- references/ # Core CLI docs
|
|
207
|
+
| |-- workflow.md
|
|
208
|
+
| |-- node.md
|
|
209
|
+
| |-- file.md
|
|
210
|
+
| `-- skill.md
|
|
211
|
+
`-- domain-skills/ # Domain skills (one directory per skill)
|
|
212
|
+
`-- <skill-name>/
|
|
213
|
+
|-- skill.md # Entry file
|
|
214
|
+
|-- REFERENCE.md # API reference (optional)
|
|
215
|
+
`-- EXAMPLES.md # Examples (optional)
|
|
35
216
|
```
|
|
36
217
|
|
|
37
218
|
---
|
|
@@ -46,19 +227,22 @@ refly skill delete <name> # Delete skill
|
|
|
46
227
|
{
|
|
47
228
|
"name": "pdf-processing",
|
|
48
229
|
"description": "Extract text/tables from PDF, fill forms, merge documents.",
|
|
49
|
-
"workflowId": "
|
|
50
|
-
"triggers": ["pdf extract", "
|
|
51
|
-
"path": "domain-skills/pdf-processing
|
|
230
|
+
"workflowId": "c-abc123xyz",
|
|
231
|
+
"triggers": ["pdf extract", "process pdf", "fill pdf form"],
|
|
232
|
+
"path": "domain-skills/pdf-processing",
|
|
52
233
|
"createdAt": "2025-01-14T00:00:00Z",
|
|
53
|
-
"
|
|
234
|
+
"updatedAt": "2025-01-14T00:00:00Z",
|
|
235
|
+
"source": "local",
|
|
236
|
+
"tags": ["pdf", "document"],
|
|
237
|
+
"author": "team-refly",
|
|
238
|
+
"version": "1.0.0",
|
|
239
|
+
"skillId": "skp-abc123"
|
|
54
240
|
}
|
|
55
241
|
]
|
|
56
242
|
}
|
|
57
243
|
```
|
|
58
244
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Registry Fields
|
|
245
|
+
### Registry Fields
|
|
62
246
|
|
|
63
247
|
| Field | Type | Required | Description |
|
|
64
248
|
|------|------|----------|-------------|
|
|
@@ -66,9 +250,14 @@ refly skill delete <name> # Delete skill
|
|
|
66
250
|
| description | string | Yes | One-line summary for matching |
|
|
67
251
|
| workflowId | string | Yes | Bound workflow ID in Refly backend |
|
|
68
252
|
| triggers | string[] | Yes | Phrases that trigger this skill |
|
|
69
|
-
| path | string | Yes | Relative path to skill directory
|
|
253
|
+
| path | string | Yes | Relative path to skill directory |
|
|
70
254
|
| createdAt | string | Yes | ISO 8601 timestamp |
|
|
71
255
|
| source | string | Yes | `local` or `refly-cloud` |
|
|
256
|
+
| updatedAt | string | No | ISO 8601 timestamp |
|
|
257
|
+
| tags | string[] | No | Categorization tags |
|
|
258
|
+
| author | string | No | Skill author |
|
|
259
|
+
| version | string | No | Semantic version |
|
|
260
|
+
| skillId | string | No | Cloud skill ID (if available) |
|
|
72
261
|
|
|
73
262
|
---
|
|
74
263
|
|
|
@@ -84,6 +273,10 @@ workflowId: <workflow-id>
|
|
|
84
273
|
triggers:
|
|
85
274
|
- <phrase-1>
|
|
86
275
|
- <phrase-2>
|
|
276
|
+
tags:
|
|
277
|
+
- <tag-1>
|
|
278
|
+
author: <author>
|
|
279
|
+
version: 1.0.0
|
|
87
280
|
---
|
|
88
281
|
|
|
89
282
|
# <Skill Name>
|
|
@@ -95,7 +288,7 @@ triggers:
|
|
|
95
288
|
## Run
|
|
96
289
|
|
|
97
290
|
```bash
|
|
98
|
-
refly skill run <
|
|
291
|
+
refly skill run <installationId> --input '<json>'
|
|
99
292
|
```
|
|
100
293
|
|
|
101
294
|
## Advanced
|
|
@@ -111,9 +304,161 @@ refly skill run <skill-name> --input '<json>'
|
|
|
111
304
|
**Naming**: lowercase, hyphens, max 64 chars (`pdf-processing`, `doc-translator`)
|
|
112
305
|
|
|
113
306
|
**Description**: verb + what + when, third person, under 100 chars
|
|
114
|
-
-
|
|
115
|
-
-
|
|
307
|
+
- Good: "Extracts text from PDF files. Use when processing PDF documents."
|
|
308
|
+
- Bad: "I can help you with PDFs"
|
|
116
309
|
|
|
117
310
|
**Triggers**: 3-6 high-signal phrases, mix EN/ZH if needed
|
|
118
311
|
|
|
119
312
|
**Structure**: Each skill is a directory with `skill.md` as entry; push details to sibling files
|
|
313
|
+
|
|
314
|
+
**Workflow Creation**:
|
|
315
|
+
1. Be specific in workflow query - helps AI generate accurate workflow
|
|
316
|
+
2. Include diverse triggers - cover EN/ZH variations
|
|
317
|
+
3. Test before publish - install then run (`refly skill install` -> `refly skill run`)
|
|
318
|
+
4. Use `--workflow-spec` for complex scenarios requiring precise control
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Local Skills vs Cloud Skills
|
|
323
|
+
|
|
324
|
+
| Type | Location | Management | Use Case |
|
|
325
|
+
|------|----------|------------|----------|
|
|
326
|
+
| Local | `~/.claude/skills/refly/domain-skills/` | `registry.json` | Fast iteration |
|
|
327
|
+
| Cloud | Backend `SkillPackage` | API | Distribution & versioning |
|
|
328
|
+
|
|
329
|
+
Integration flow:
|
|
330
|
+
1. Write local `skill.md` -> run `refly skill sync` -> updates `registry.json`
|
|
331
|
+
2. Create cloud skill -> `refly skill create` (bind workflow) -> `refly skill publish`
|
|
332
|
+
3. Install to run -> `refly skill install` -> `refly skill run <installationId>`
|
|
333
|
+
4. Cloud skills can still match locally via `source: refly-cloud`
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Output Examples
|
|
338
|
+
|
|
339
|
+
### List Output
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"ok": true,
|
|
344
|
+
"type": "skill.list",
|
|
345
|
+
"version": "1.0",
|
|
346
|
+
"payload": {
|
|
347
|
+
"skills": [
|
|
348
|
+
{
|
|
349
|
+
"skillId": "skp-xxx",
|
|
350
|
+
"name": "my-skill",
|
|
351
|
+
"version": "1.0.0",
|
|
352
|
+
"description": "Skill description",
|
|
353
|
+
"status": "published",
|
|
354
|
+
"isPublic": true,
|
|
355
|
+
"downloadCount": 10,
|
|
356
|
+
"createdAt": "2026-01-19T00:00:00Z"
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
"total": 10,
|
|
360
|
+
"page": 1,
|
|
361
|
+
"pageSize": 20,
|
|
362
|
+
"hasMore": false
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Installations Output
|
|
368
|
+
|
|
369
|
+
```json
|
|
370
|
+
{
|
|
371
|
+
"ok": true,
|
|
372
|
+
"type": "skill.installations",
|
|
373
|
+
"version": "1.0",
|
|
374
|
+
"payload": {
|
|
375
|
+
"installations": [
|
|
376
|
+
{
|
|
377
|
+
"installationId": "skpi-xxx",
|
|
378
|
+
"skillId": "skp-xxx",
|
|
379
|
+
"skillName": "my-skill",
|
|
380
|
+
"skillVersion": "1.0.0",
|
|
381
|
+
"status": "ready",
|
|
382
|
+
"installedAt": "2026-01-19T00:00:00Z"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"total": 3,
|
|
386
|
+
"page": 1,
|
|
387
|
+
"pageSize": 20,
|
|
388
|
+
"hasMore": false
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Execution Output
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"ok": true,
|
|
398
|
+
"type": "skill.run",
|
|
399
|
+
"version": "1.0",
|
|
400
|
+
"payload": {
|
|
401
|
+
"executionId": "skpe-xxx",
|
|
402
|
+
"installationId": "skpi-xxx",
|
|
403
|
+
"status": "completed",
|
|
404
|
+
"workflowExecutions": [
|
|
405
|
+
{
|
|
406
|
+
"skillWorkflowId": "skw-xxx",
|
|
407
|
+
"workflowId": "c-xxx",
|
|
408
|
+
"status": "completed"
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
"result": {},
|
|
412
|
+
"error": null
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Skill Sync Details
|
|
420
|
+
|
|
421
|
+
`refly skill sync` will:
|
|
422
|
+
- Scan local `domain-skills/` directories
|
|
423
|
+
- Load frontmatter from each `skill.md`
|
|
424
|
+
- Update `registry.json` with added/updated entries
|
|
425
|
+
- Optionally prune orphan entries with `--prune`
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Skill Validate Details
|
|
430
|
+
|
|
431
|
+
`refly skill validate [path]` will:
|
|
432
|
+
- Validate frontmatter schema and required fields
|
|
433
|
+
- Return per-file errors and warnings
|
|
434
|
+
- Provide a summary of valid/invalid files
|
|
435
|
+
|
|
436
|
+
Example output:
|
|
437
|
+
```json
|
|
438
|
+
{
|
|
439
|
+
"ok": true,
|
|
440
|
+
"type": "skill.validate",
|
|
441
|
+
"version": "1.0",
|
|
442
|
+
"payload": {
|
|
443
|
+
"path": "/path/to/skills",
|
|
444
|
+
"summary": {
|
|
445
|
+
"total": 3,
|
|
446
|
+
"valid": 2,
|
|
447
|
+
"invalid": 1,
|
|
448
|
+
"warnings": 1
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Error Handling
|
|
457
|
+
|
|
458
|
+
| Error Code | Cause | Solution |
|
|
459
|
+
|------------|-------|----------|
|
|
460
|
+
| `VALIDATION_ERROR` | Missing required params or invalid format | Check `--name` and other required params |
|
|
461
|
+
| `ACCESS_DENIED` | No permission for resource | Verify login and resource ownership |
|
|
462
|
+
| `INTERNAL_ERROR` | Server error | Retry later or contact support |
|
|
463
|
+
|
|
464
|
+
> **Note**: Invalid JSON in `--workflow-spec` will fail the command; ensure it is valid JSON.
|
|
@@ -2,31 +2,142 @@
|
|
|
2
2
|
|
|
3
3
|
## Workflow Commands
|
|
4
4
|
|
|
5
|
+
### Management
|
|
6
|
+
|
|
5
7
|
```bash
|
|
6
|
-
|
|
7
|
-
refly workflow
|
|
8
|
-
|
|
8
|
+
# Create workflow
|
|
9
|
+
refly workflow create [options]
|
|
10
|
+
--name <name> # Workflow name
|
|
11
|
+
--spec <json> # Workflow spec JSON
|
|
12
|
+
--description <desc> # Description
|
|
13
|
+
|
|
14
|
+
# Generate workflow from natural language
|
|
15
|
+
refly workflow generate [options]
|
|
16
|
+
--query <query> # Natural language description
|
|
17
|
+
--canvas-id <id> # Update existing workflow
|
|
18
|
+
--model-id <id> # Model for generation
|
|
19
|
+
--locale <locale> # Output language (en, zh)
|
|
20
|
+
--timeout <ms> # Timeout (default: 300000)
|
|
21
|
+
--variables <json> # Predefined variables
|
|
22
|
+
--skip-default-nodes # Skip default start+skillResponse
|
|
23
|
+
--no-cleanup # Disable orphan cleanup on failure
|
|
24
|
+
|
|
25
|
+
# Edit workflow
|
|
26
|
+
refly workflow edit <workflowId> [options]
|
|
27
|
+
--name <name> # New name
|
|
28
|
+
--ops <json> # Node/edge operations
|
|
29
|
+
--variables <json> # Variables array
|
|
30
|
+
--toolsets <keys> # Toolset keys (comma-separated)
|
|
31
|
+
--auto-layout # Auto-layout nodes
|
|
32
|
+
|
|
33
|
+
# Patch workflow plan
|
|
34
|
+
refly workflow patch <planId> [options]
|
|
35
|
+
--ops <json> # Operations array
|
|
36
|
+
--ops-file <path> # Read ops from file
|
|
37
|
+
--update-title <title> # Shortcut: update title
|
|
38
|
+
--delete-task <taskId> # Shortcut: delete task
|
|
39
|
+
--delete-variable <varId> # Shortcut: delete variable
|
|
40
|
+
|
|
41
|
+
# Other management
|
|
9
42
|
refly workflow get <workflowId>
|
|
10
|
-
woshrefly workflow nodes <workflowId>
|
|
11
|
-
refly workflow nodes <workflowId> --include-edges
|
|
12
|
-
refly workflow nodes <workflowId> --include-metadata
|
|
13
|
-
refly workflow list
|
|
14
43
|
refly workflow delete <workflowId>
|
|
15
|
-
refly workflow
|
|
16
|
-
refly workflow
|
|
17
|
-
refly workflow
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
44
|
+
refly workflow list [--limit <n>] [--offset <n>]
|
|
45
|
+
refly workflow layout <workflowId> [--direction LR|TB]
|
|
46
|
+
refly workflow toolset-keys [--type <type>]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Execution
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Start workflow run
|
|
53
|
+
refly workflow run start <workflowId> [options]
|
|
54
|
+
--input <json> # Input variables
|
|
55
|
+
--from-node <nodeId> # Run From Here
|
|
56
|
+
|
|
57
|
+
# Query run status
|
|
58
|
+
refly workflow run get <runId>
|
|
59
|
+
refly workflow run detail <runId> [--no-tool-calls] [--preview-length <n>]
|
|
60
|
+
refly workflow runs <workflowId> [--limit <n>] [--offset <n>] [--status <s>]
|
|
61
|
+
refly workflow status <id> [--watch] [--interval <ms>] [--full]
|
|
62
|
+
refly workflow detail <id> [--no-tool-calls] [--preview-length <n>]
|
|
63
|
+
refly workflow abort <workflowId>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Node Operations
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# List/get nodes
|
|
70
|
+
refly workflow nodes <workflowId> [--include-edges] [--include-position] [--include-metadata]
|
|
71
|
+
refly workflow node <id> <nodeId> [--include-connections]
|
|
72
|
+
refly workflow node-output <id> <nodeId> [--include-tool-calls] [--raw]
|
|
73
|
+
|
|
74
|
+
# Run from node
|
|
75
|
+
refly workflow run node-start [options]
|
|
76
|
+
--from <nodeId> # Node to run from
|
|
77
|
+
--run-id <runId> # Existing run context
|
|
78
|
+
--workflow-id <id> # Start new run
|
|
79
|
+
|
|
80
|
+
# Node results
|
|
81
|
+
refly workflow run node-detail <runId> <nodeId> [--include-messages] [--raw]
|
|
82
|
+
refly workflow run node-result <resultId> [--include-steps] [--include-messages] [--include-tool-calls]
|
|
83
|
+
refly workflow run node-abort <resultId> [--version <n>]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Tool Calls
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Workflow-level tool calls (full options)
|
|
90
|
+
refly workflow toolcalls <id> [options]
|
|
91
|
+
refly workflow run toolcalls <runId> [options]
|
|
92
|
+
--node-id <nodeId> # Filter by node
|
|
93
|
+
--toolset-id <id> # Filter by toolset
|
|
94
|
+
--tool-name <name> # Filter by tool name
|
|
95
|
+
--status <status> # Filter: executing, completed, failed
|
|
96
|
+
--limit <n> # Max results (default: 100)
|
|
97
|
+
--offset <n> # Pagination offset
|
|
98
|
+
--raw # Full output without sanitization
|
|
99
|
+
|
|
100
|
+
# Node-level tool calls (limited options)
|
|
101
|
+
refly workflow run node-toolcalls <resultId> [options]
|
|
102
|
+
--status <status> # Filter: executing, completed, failed
|
|
103
|
+
--tool-name <name> # Filter by tool name
|
|
104
|
+
--toolset-id <id> # Filter by toolset
|
|
105
|
+
|
|
106
|
+
# Single tool call
|
|
107
|
+
refly workflow run node-toolcall <callId> [--raw]
|
|
22
108
|
```
|
|
23
109
|
|
|
24
110
|
## Interaction
|
|
25
111
|
|
|
26
|
-
- `workflow run` returns `runId` used by `workflow
|
|
27
|
-
- `workflow run node` returns `resultId` for action/tool lookups (see `node.md`).
|
|
112
|
+
- `workflow run start` returns `runId` used by `workflow run get` and `workflow run node-detail`.
|
|
113
|
+
- `workflow run node-detail` returns `resultId` for action/tool lookups (see `node.md`).
|
|
114
|
+
- `workflow node-output` retrieves the actual execution output content of a node.
|
|
28
115
|
- Action results may include file IDs; use `file.md` to fetch/download.
|
|
29
116
|
|
|
117
|
+
## Node Output Command
|
|
118
|
+
|
|
119
|
+
Get the execution output content of a specific node:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Using workflowId (gets output from latest run)
|
|
123
|
+
refly workflow node-output c-xxx <nodeId>
|
|
124
|
+
|
|
125
|
+
# Using runId (gets output from specific run)
|
|
126
|
+
refly workflow node-output we-xxx <nodeId>
|
|
127
|
+
|
|
128
|
+
# Include tool call details
|
|
129
|
+
refly workflow node-output <id> <nodeId> --include-tool-calls
|
|
130
|
+
|
|
131
|
+
# Get full content without truncation (default: 10KB limit)
|
|
132
|
+
refly workflow node-output <id> <nodeId> --raw
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**ID Type Detection:**
|
|
136
|
+
- `c-xxx` prefix: Treated as workflowId, uses latest/active run
|
|
137
|
+
- `we-xxx` prefix: Treated as runId, uses specific run
|
|
138
|
+
|
|
139
|
+
**Security:** Node output access requires ownership verification at both workflow execution level and action result level (defense-in-depth).
|
|
140
|
+
|
|
30
141
|
## Workflow Generate Examples
|
|
31
142
|
|
|
32
143
|
```bash
|
|
@@ -37,7 +148,7 @@ refly workflow generate --query "Parse PDF, summarize content, translate to Chin
|
|
|
37
148
|
refly workflow generate \
|
|
38
149
|
--query "Research topic, write article, export to markdown" \
|
|
39
150
|
--model-id <modelId> \
|
|
40
|
-
--locale
|
|
151
|
+
--locale en \
|
|
41
152
|
--timeout 300000
|
|
42
153
|
```
|
|
43
154
|
|
|
@@ -47,39 +158,21 @@ refly workflow generate \
|
|
|
47
158
|
--variables '[{"variableId":"v1","name":"inputFolder","variableType":"string"}]'
|
|
48
159
|
```
|
|
49
160
|
|
|
50
|
-
## Workflow Spec Schema (
|
|
161
|
+
## Workflow Spec Schema (Simplified)
|
|
162
|
+
|
|
163
|
+
`workflow create` expects a simplified spec (no `version` or `metadata`).
|
|
164
|
+
Supported node types: `skill`, `agent` (start node is auto-created).
|
|
51
165
|
|
|
52
166
|
```json
|
|
53
167
|
{
|
|
54
|
-
"version": 1,
|
|
55
|
-
"name": "string",
|
|
56
|
-
"description": "string?",
|
|
57
168
|
"nodes": [
|
|
58
169
|
{
|
|
59
170
|
"id": "string",
|
|
60
|
-
"type": "
|
|
61
|
-
"
|
|
171
|
+
"type": "skill",
|
|
172
|
+
"query": "string",
|
|
173
|
+
"toolsetKeys": ["string"],
|
|
62
174
|
"dependsOn": ["string"]
|
|
63
175
|
}
|
|
64
|
-
]
|
|
65
|
-
"metadata": {
|
|
66
|
-
"tags": ["string"],
|
|
67
|
-
"owner": "string?"
|
|
68
|
-
}
|
|
176
|
+
]
|
|
69
177
|
}
|
|
70
178
|
```
|
|
71
|
-
|
|
72
|
-
## Backend API (Workflow)
|
|
73
|
-
|
|
74
|
-
- POST /v1/cli/workflow create
|
|
75
|
-
- POST /v1/cli/workflow/generate AI generate
|
|
76
|
-
- GET /v1/cli/workflow list
|
|
77
|
-
- GET /v1/cli/workflow/:id detail
|
|
78
|
-
- PATCH /v1/cli/workflow/:id update
|
|
79
|
-
- DELETE /v1/cli/workflow/:id delete
|
|
80
|
-
- POST /v1/cli/workflow/:id/run start run
|
|
81
|
-
- GET /v1/cli/workflow/run/:runId run status
|
|
82
|
-
- POST /v1/cli/workflow/run/:runId/abort abort run
|
|
83
|
-
- GET /v1/cli/workflow/run/:runId/detail run detail
|
|
84
|
-
- GET /v1/cli/workflow/run/:runId/node/:nodeId node result (workflow scope)
|
|
85
|
-
- GET /v1/cli/workflow/run/:runId/toolcalls tool calls (workflow scope)
|