Files
jakevin 7d0f46d009 docs(readme): CLI Hub brand aliases + Exit Codes split to docs (#1685)
Per WAWQAQ DM:

1. **CLI Hub**: bare-name enumeration ("ntn", "discord") didn't tell
   readers what those binaries map to. Switched to the `opencli external
   list` brand-alias format: `ntn(notion)`, `discord(discord-cli)`,
   `dws(DingTalk Workspace)`, `wecom-cli(企业微信)`, `tg(tg-cli)`,
   `wx(wx-cli)`. Names that are already self-explanatory (gh / docker /
   vercel / wrangler / obsidian / longbridge / lark-cli) stay bare.

2. **Exit Codes**: the 9-row table + example block was disproportionate
   for a README. Compressed to one sentence with the 7 actionable codes
   inline, full table relocated to:
   - EN: `docs/guide/exit-codes.md` (new)
   - ZH: `docs/zh/guide/exit-codes.md` (new)
2026-05-20 03:58:27 +08:00

898 B
Raw Permalink Blame History

退出码

opencli 遵循 Unix sysexits.h 惯例,可无缝接入 shell 管道和 CI 脚本。

退出码 含义 触发场景
0 成功 命令正常完成
1 通用错误 未分类的意外错误
2 用法错误 参数错误或未知命令
66 无数据 命令返回空结果(EX_NOINPUT)
69 服务不可用 Browser Bridge 未连接(EX_UNAVAILABLE)
75 临时失败 命令超时,可重试(EX_TEMPFAIL)
77 需要认证 未登录目标网站(EX_NOPERM)
78 配置错误 凭证缺失或配置有误(EX_CONFIG)
130 中断 Ctrl-C / SIGINT

示例:根据退出码分支

opencli bilibili hot 2>/dev/null
case $? in
  0)   echo "ok" ;;
  69)  echo "请先启动 Browser Bridge" ;;
  77)  echo "请先登录 bilibili.com" ;;
esac