wf-chain
v0.1.3
Published
Workflow Runtime 命令行:登录多个部署、管理模版和 run、驱动 step 流转(agent 的唯一入口)
Maintainers
Readme
wf-chain
English · 中文
The command line of Workflow Runtime (short alias wf) — the single entry point for agents driving a workflow: log in to deployments, manage templates and runs, submit artifacts, review.
npm install -g wf-chain # Node.js >= 20
wf-chain login --url wf.example.com # opens your browser to authorize (no password in the terminal); credentials go to ~/.wf-chain/config.json; several deployments allowed
wf-chain template validate --file my-flow.yaml
wf-chain template create --file my-flow.yaml
wf-chain run create --template my-flow --name "First run" --member [email protected]
wf-chain --help- Several deployments:
wf-chain serverslists them,wf-chain use <name>switches the default,-n <name>picks one for a single command. - Credentials:
wf-chain tokens listshows the valid CLI tokens of your account (id, device, created / last used / expiry;*= the one in use);wf-chain tokens revoke <id>revokes one (a prefix of ≥ 6 characters is enough) — e.g. after losing a laptop. Regular accounts only see and revoke their own; admins can add--email <account>to manage anyone's. The web panel has the same list under "Credentials" in the top bar (admins reach other accounts from the Accounts page). - CI / machine use: there is no shared token — every call belongs to a real account. Run
wf-chain login --url … --no-browser(it prints a link and a code; open the link in any browser where you are signed in and confirm), or put a CLI token from an earlier login intoWF_API_TOKEN(withWF_API_URL). CLI tokens last 90 days; log in again after they expire. Global jobs (recurring tick,storage gc) need an admin account. - Output is JSON by default (for agents); add
--prettyfor humans. Exit codes:0ok ·1usage / IO / network ·2rejected by the engine ·3watchdog alert. - Language: usage errors,
--help,--prettyoutput and template validation are available in English and Chinese. Resolution order:--lang <zh|en>>$WF_LANG> the language saved with the logged-in deployment >LC_ALL/LC_MESSAGES/LANG(zh*/en*, anything else ignored) > Chinese. Every request carriesAccept-Language, so server error messages follow it. JSON keys and data are never translated (bilingual step names in templates are returned as they are).
Full documentation (Chinese): the repository README.
中文
Workflow Runtime 的命令行(短别名 wf)。agent 驱动流程的唯一入口:登录部署、管理模版和 run、提交产物、审核。
npm install -g wf-chain # 需要 Node.js ≥ 20
wf-chain login --url wf.example.com # 浏览器授权(终端里不输密码),凭证存 ~/.wf-chain/config.json;可登录多个部署
wf-chain template validate --file my-flow.yaml
wf-chain template create --file my-flow.yaml
wf-chain run create --template my-flow --name "第一次运行" --member 合规[email protected]
wf-chain --help- 多部署:
wf-chain servers列出,wf-chain use <name>切换默认,-n <name>临时指定。 - 凭证管理:
wf-chain tokens list列出我账号下有效的 CLI token(id、设备名、创建 / 最后使用 / 到期时间,*是当前这条);wf-chain tokens revoke <id>吊销一条(id 写前缀即可,至少 6 位),比如电脑丢了。普通账号只能看和吊销自己的;管理员加--email <账号>可以管理任何人的。网页顶栏的「登录凭证」是同一份列表(管理员在「账号管理」里点某个账号的「登录凭证」)。 - CI / 机器:没有共享 token,每次调用都对应一个真实账号。登录:
wf-chain login --url … --no-browser会打印链接和授权码,在任意已登录网页的浏览器里打开并确认;或把某次登录换来的 CLI token 放进WF_API_TOKEN(配合WF_API_URL)。CLI token 90 天有效,过期重新登录。全局动作(recurring tick、storage gc)要用管理员账号。 - 默认输出 JSON(给 agent),加
--pretty给人看。退出码:0成功 ·1用法 / IO / 网络 ·2引擎拒绝 ·3看门狗告警。 - 语言:输出语言(用法错误、
--help、--pretty、模版校验结果)支持中文和英文,优先级:--lang <zh|en>> 环境变量WF_LANG> 登录部署时服务器返回并保存的账号语言偏好 >LC_ALL/LC_MESSAGES/LANG(zh*/en*,其他忽略) > 中文。每个请求都会带Accept-Language,服务器返回的错误文案也按这个语言。JSON 输出的字段名和数据内容不翻译(模版里的双语步骤名原样给出)。
完整说明见仓库 README。
