CLI 使用
LightFlow CLI 是一个小而明确的 JSON command surface。它不启动后台服务,而是直接调用 ApiService。
Asset commands
列出 workflow:
cargo run -- assets workflows列出 node:
cargo run -- assets nodes列出 composition:
cargo run -- assets compositions列出 model:
cargo run -- assets modelsRun preview
Preview 不写 state,适合 agent 和脚本先检查 workflow 是否 ready:
cargo run -- run preview workflow.text_plan --id run-001 --inputs '{"prompt":"Write a migration plan"}'返回内容包含:
- planned
run_id - workflow asset record
- parsed workflow definition
- validation issues
- planned CortexFS paths
- optional rendered request
Create run
创建 run:
cargo run -- run create workflow.text_plan --id run-001 --inputs '{"prompt":"Write a migration plan"}'如果不传 --id,LightFlow 会生成一个安全的 run id。
Inspect run
cargo run -- run list
cargo run -- run get run-001
cargo run -- run status run-001
cargo run -- run request run-001
cargo run -- run workflow run-001Submit step
使用 workflow request template 自动渲染 body:
cargo run -- run submit run-001 draft显式传入 JSON:
cargo run -- run submit run-001 draft '{"messages":[{"role":"user","content":"Draft a plan"}]}'从文件读取:
cargo run -- run submit run-001 draft @request.json从 stdin 读取:
jq -n '{messages:[{role:"user",content:"Draft a plan"}]}' | cargo run -- run submit run-001 draft -Refresh and streams
刷新 CortexFS outbox:
cargo run -- run refresh run-001读取 event stream:
cargo run -- run events run-001读取 technical trace:
cargo run -- run trace run-001CortexFS path helpers
查看 API exchange path:
cargo run -- ctx api openai.chat draft查看 tool exchange path:
cargo run -- ctx tool filesystem.read read-file查看 thread exchange path:
cargo run -- ctx thread design-review turn-1CLI 约束
CLI 会对未知参数、重复 flag、缺失 flag value 和多余参数 fail fast。这个行为对 shell 脚本很重要,因为它避免了拼错参数后静默运行。
Last updated on