Repository navigation
docs+feat(cli): listenhub.app 配置文档 + 版本升级提醒 + config set-domain - #23
Merged
Merged
Conversation
区分 OAuth 普通命令(LISTENHUB_API_URL)与 openapi 命令 (LISTENHUB_OPENAPI_URL)两条请求链路,给出网络受限环境的 .app 覆盖配置示例、拼接规则(/api 与 /openapi 后缀)和最小 fetch failed 排查步骤。.app 作为当前已验证的覆盖示例呈现, 不改默认、不写成唯一合法值,便于后续换域名只改示例。 Part of marswaveai/listenhub-ralph#515
update-notifier 式最小实现(零新依赖):每天最多查一次 npm registry 最新版,缓存到 ~/.config/listenhub/update-check.json, 有新版在 stderr 打一行升级提示。 硬约束 fail-open:面向网络受限用户,registry 探测设 1.5s 超时, 连不上/超时/坏响应一律静默跳过,绝不拖慢或阻断命令(fire-and- forget,命令先结束就丢弃检查)。NO_UPDATE_NOTIFIER / CI / 非 TTY 均静音,提示只走 stderr 不污染 --json stdout。版本从 package.json 读真实值(dist 与 source 两种布局都兼容)。 13 个单测覆盖 semver 比较、缓存新鲜度、静音开关与 fail-open。 Part of marswaveai/listenhub-ralph#515
两处改动都服务同一件事:只能访问备选域的用户不必自己配环境变量。 1. openapi/client.ts 原来无条件传 baseURL(env 没设就传硬编码默认值), SDK 侧「显式 baseURL 完全接管」的规则会把整组 openapi 命令排除在自动 选域之外。改成只在用户钉死了域时才传,否则交给 SDK 读 env + 自动选域。 普通命令同理,在 _shared/client.ts 统一处理。 2. config set-domain 把域选择持久化到 config.json,翻译成显式 Base URL 传给 SDK——稳定受限的网络本来就是配置问题,不该每次靠失败探测。 config show 打印两条链路实际生效的 Base URL 及其来源(env / 钉死 / SDK 自动选定 / 出厂默认)和 Node 版本,供 fetch failed 排查,不打印 任何 key 或 token。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XTMa7WBhkre12k9Waoi5by
带来自动域选域:默认域连不上时 CLI 自动切到可达备选域,用户不必自己配 LISTENHUB_API_URL / LISTENHUB_OPENAPI_URL。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XTMa7WBhkre12k9Waoi5by
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
config set-domain/config show, and stop pinning an explicit Base URL onopenapicommands so the SDK can select a reachable domain.Part of marswaveai/listenhub-ralph#515