@vibeapi/api-helper 0.0.101 → 0.0.103

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/README.md CHANGED
@@ -124,7 +124,7 @@ vibecli base https://www.vibeapi.si # 或指定一个地址
124
124
  vibecli base default # 网络恢复后回到主站
125
125
  ```
126
126
 
127
- `auto` 按这个优先级尝试,取第一个能用的:`www.vibeapi.cn` → `www.vibeapi.si` → `hk.vibeapi.cn` → `us13-www.vibeapi.cn` → `cf.vibeapi.cn` → `token.nfeyre.top`。网关控制台以后新增的地址会排在这些后面。保存了令牌时,每个地址都用它实际拉一次模型列表,拉得到才算能用;`vibecli base` 每个地址测 3 次取中位数,并标出最快的一个。第一次 `vibecli setup` / `vibecli init` 时主站连不上,也会按同样的顺序自动换到能用的地址。切换后地址保存在当前 profile 里,Claude Code、Codex、Claude 桌面端等已用 VibeCLI 配置过的工具会一起改过去,以后再运行 `vibecli setup` 也不会改回主站。首次配置时就可以指定:`vibecli setup --key sk-xxx --base https://www.vibeapi.si`。向导主菜单里也有「切换接入地址」。
127
+ `auto` 按这个优先级尝试,取第一个能用的:`www.vibeapi.cn` → `www.vibeapi.si` → `hk.vibeapi.cn` → `us13-www.vibeapi.cn` → `cf.vibeapi.cn` → `token.nfeyre.top`。网关控制台以后新增的地址会排在这些后面。保存了令牌时,每个地址都用它实际拉一次模型列表,拉得到才算能用;`vibecli base` 每个地址测 3 次取中位数,并标出最快的一个。第一次 `vibecli setup` / `vibecli init` 时主站连不上,也会按同样的顺序自动换到能用的地址。切换后地址保存在当前 profile 里,Claude Code、Codex、Claude 桌面端等已用 VibeCLI 配置过的工具会一起改过去,以后再运行 `vibecli setup` 也不会改回主站。首次配置时就可以指定:`vibecli setup --base https://www.vibeapi.si --key sk-xxx`。向导主菜单里也有「切换接入地址」。
128
128
 
129
129
  ## 支持
130
130
 
@@ -1 +1 @@
1
- import{Command as e,Option as o}from"commander";import{readFileSync as t}from"fs";import{join as s,dirname as a}from"path";import{fileURLToPath as n}from"url";import{i18n as i}from"./i18n.js";import{wizard as r}from"./wizard.js";import{SUPPORTED_TOOLS as c}from"./tool-manager.js";import{DEFAULT_BASE_URL as l}from"./config.js";import{attachCommandHelp as p,helpConfiguration as u}from"./cli-help.js";import{langCommand as m,authCommand as d,doctorCommand as g,configCommand as f,statusCommand as x,refreshCommand as y}from"../commands/index.js";import{logsCommand as b}from"../commands/logs.js";import{completionCommand as h}from"../commands/completion.js";import{benchCommand as $}from"../commands/bench.js";import{updateCommand as k}from"../commands/update.js";import{upgradeCommand as _}from"../commands/upgrade.js";import{codexSessionsCommand as w}from"../commands/codex-sessions.js";import{setupCommand as v,DEDICATED_KEYS as j}from"../commands/setup.js";import{baseCommand as O}from"../commands/base.js";import{usageError as S}from"./errors.js";import{brand as z,brandEnv as A,CLI_NAME as C}from"./brand.js";const E=(z().gatewayAddresses[1]??z().gatewayAddresses[0]).url,G=(z().gatewayAddresses[2]??z().gatewayAddresses[0]).url;function R(e,o){return i.t(`help.${e}`,o)}function K(e,o){return{command:e,note:R(o)}}function L(e){const o=R(e);return o===`help.${e}`?"":o}function N(e,o=[]){return{when:L(`${e}.when`),prerequisites:L(`${e}.needs`).split("\n").filter(Boolean),alternatives:o.map(([e,o])=>K(e,o))}}function P(e){return e.helpCommand("help [command]",R("help_command"))}export function buildProgram(){const z=new e;z.name(`${C}`).summary(R("root.summary")).description(R("root.description")).configureHelp(u()).allowExcessArguments(!0).optionsGroup(R("group.global_options")).helpOption("-h, --help",R("global.help")).version(function(){try{const e=a(n(import.meta.url));return JSON.parse(t(s(e,"../../package.json"),"utf-8")).version}catch{return"1.0.0"}}(),"-v, --version",R("global.version")).option("--base <url>",R("global.base")).option("--non-interactive",R("global.non_interactive")).option("--json",R("global.json")).option("-y, --yes",R("global.yes")).option("--dry-run",R("global.dry_run")).option("--no-color",R("global.no_color")),z.configureOutput({writeErr:()=>{},outputError:()=>{}}),z.showSuggestionAfterError(),z.exitOverride(e=>{throw e}),z.commandsGroup(R("group.configure"));const L=z.command("setup").summary(R("setup.summary")).description(R("setup.description")).option("--key <key>",R("setup.opt.key"));for(const e of j){const t=new o(`--${e.option} <key>`,R(`setup.opt.${e.option}`));e.hidden&&t.hideHelp(),L.addOption(t)}L.option("--1m",R("setup.opt.one_m")).option("--no-1m",R("setup.opt.no_one_m")).option("--claude-official <on|off>",R("setup.opt.claude_official")).option("--desktop-registry <on|off>",R("setup.opt.desktop_registry")).option("--force",R("setup.opt.force")).option("--install",R("setup.opt.install")).option("--no-install",R("setup.opt.no_install")).option("--all",R("setup.opt.all")).action(async e=>{e.key||j.some(o=>e[o.option])||(e.key=A("SETUP_KEY")?.trim()||void 0);const o=Boolean(e.key||j.some(o=>e[o.option])),t=void 0!==e["1m"]||void 0!==e.claudeOfficial||void 0!==e.desktopRegistry,s="zh_CN"===i.getLocale()?"<你的 Key>":"<your key>";if(!o&&!t)throw S(i.t("setup.usage"),`${C} setup --key ${s}`,"missing_key");if(void 0!==e.claudeOfficial&&!["on","off"].includes(String(e.claudeOfficial).toLowerCase()))throw S(i.t("setup.claude_official_invalid",{value:String(e.claudeOfficial)}),`${C} setup --claude-official on|off`,"invalid_value");if(void 0!==e.desktopRegistry&&!["on","off"].includes(String(e.desktopRegistry).toLowerCase()))throw S(i.t("setup.desktop_registry_invalid",{value:String(e.desktopRegistry)}),`${C} setup --desktop-registry on|off`,"invalid_value");await v({key:e.key,...Object.fromEntries(j.map(o=>[o.option,e[o.option]])),all:e.all,oneMillion:e["1m"],claudeOfficial:e.claudeOfficial,desktopRegistry:e.desktopRegistry,force:e.force,install:e.install})}),p(L,{...N("setup",[[`${C} init`,"setup.alt.init"],[`${C} config <tool>`,"setup.alt.config"],[`${C} auth <key>`,"setup.alt.auth"]]),sections:[{title:R("setup.autodetect_title"),rows:[["Claude",R("setup.autodetect.claude")],["GPT",R("setup.autodetect.gpt")],["Grok",R("setup.autodetect.grok")],["Gemini",R("setup.autodetect.gemini")]]}],examples:[K(`${C} setup --key sk-xxx`,"setup.ex.key"),K(`${C} setup --key sk-xxx --install`,"setup.ex.install"),K(`${C} setup --claudekey sk-a --codexkey sk-b --agykey sk-g`,"setup.ex.split"),K(`${C} setup --key sk-xxx --force`,"setup.ex.force"),K(`${C} setup --key sk-xxx --base ${E}`,"setup.ex.base")]});const T=z.command("init").summary(R("init.summary")).description(R("init.description")).action(async()=>{await r.runFirstTimeSetup()});p(T,{...N("init",[[`${C} setup --key <key>`,"init.alt.setup"],[`${C}`,"init.alt.menu"]]),examples:[K(`${C} init`,"init.ex.run"),K(`${C} init --base ${E}`,"init.ex.base"),K(`${C}`,"init.ex.menu")]});const U=z.command("auth").summary(R("auth.summary")).description(R("auth.description")).argument("[token]",R("auth.arg.token")).action(async e=>{const o=[];e&&o.push(e),await d(o)});P(U);const B=U.command("revoke").description(R("auth.revoke")).action(async()=>{await d(["revoke"])});p(B,{examples:[K(`${C} auth revoke`,"auth.ex.revoke_ask"),K(`${C} auth revoke --yes`,"auth.ex.revoke")]});const H=U.command("reload <tool>").description(R("auth.reload")).action(async e=>{await d(["reload",e])});p(H,{examples:[K(`${C} auth reload claude-code`,"auth.ex.reload"),K(`${C} auth reload claude-code --json`,"auth.ex.reload_json")]}),p(U,{...N("auth",[[`${C} setup --key <key>`,"auth.alt.setup"]]),examples:[K(`${C} auth`,"auth.ex.prompt"),K(`${C} auth sk-xxx --non-interactive`,"auth.ex.save"),K(`${C} auth revoke --yes`,"auth.ex.revoke"),K(`${C} auth reload claude-code`,"auth.ex.reload")]});const M=z.command("config").summary(R("config.summary")).description(R("config.description")).argument("[args...]",R("config.arg.args")).option("-f, --force",R("config.opt.force")).allowUnknownOption(!0).action(async(e=[],o={})=>{await f(o.force?[...e,"--force"]:e)});p(M,{...N("config",[[`${C} setup --key <key> --force`,"config.alt.setup"],[`${C} status`,"config.alt.status"]]),sections:[{title:R("config.subcommands_title"),rows:[["<tool>",R("config.sub.tool")],["<tool> --force",R("config.sub.tool_force")],["<tool> --non-interactive",R("config.sub.tool_non_interactive")],["<tool> restore",R("config.sub.tool_restore")],["<tool> backups",R("config.sub.tool_backups")],["<tool> clear-model",R("config.sub.tool_clear_model")],["tool-model list",R("config.sub.tool_model_list")],["tool-model set <tool> [slot] <model>",R("config.sub.tool_model_set")],["tool-model clear <tool>",R("config.sub.tool_model_clear")],["profile list",R("config.sub.profile_list")],["profile create <name>",R("config.sub.profile_create")],["profile use <name>",R("config.sub.profile_use")],["profile delete <name>",R("config.sub.profile_delete")],["preset list",R("config.sub.preset_list")],["preset save <name>",R("config.sub.preset_save")],["preset use <name>",R("config.sub.preset_use")],["preset delete <name>",R("config.sub.preset_delete")],["backup list",R("config.sub.backup_list")],["backup create [label]",R("config.sub.backup_create")],["backup restore <name>",R("config.sub.backup_restore")]]},{title:R("config.tools_title"),rows:Object.values(c).filter(e=>!e.hidden).map(e=>[e.name,e.displayName])}],examples:[K(`${C} config codex`,"config.ex.menu"),K(`${C} config claude-code --force`,"config.ex.force"),K(`${C} config tool-model set codex gpt-6-astra`,"config.ex.tool_model"),K(`${C} config profile create work`,"config.ex.profile"),K(`${C} config backup create before-upgrade`,"config.ex.backup")]});const q=z.command("base").summary(R("base.summary")).description(R("base.description")).argument("[target]",R("base.arg.target")).action(async e=>{await O(e)});p(q,{...N("base",[[`${C} doctor`,"base.alt.doctor"],[`${C} bench`,"base.alt.bench"]]),sections:[{title:R("base.targets_title"),rows:[[R("base.target.none_term"),R("base.target.none")],[R("base.target.index_term"),R("base.target.index")],[R("base.target.url_term"),R("base.target.url")],["auto",R("base.target.auto")],["default",R("base.target.default",{url:l})]]}],examples:[K(`${C} base`,"base.ex.list"),K(`${C} base auto`,"base.ex.auto"),K(`${C} base 2`,"base.ex.index"),K(`${C} base ${E}`,"base.ex.url"),K(`${C} base default`,"base.ex.default")]}),z.commandsGroup(R("group.diagnose"));const F=z.command("status").summary(R("status.summary")).description(R("status.description")).action(async()=>{await x()});p(F,{...N("status",[[`${C} doctor`,"status.alt.doctor"]]),examples:[K(`${C} status`,"status.ex.show"),K(`${C} status --json`,"status.ex.json")]});const J=z.command("doctor").summary(R("doctor.summary")).description(R("doctor.description")).option("--deep",R("doctor.opt.deep")).action(async e=>{await g({deep:e.deep})});p(J,{...N("doctor",[[`${C} base auto`,"doctor.alt.base"],[`${C} logs tail`,"doctor.alt.logs"]]),examples:[K(`${C} doctor`,"doctor.ex.run"),K(`${C} doctor --deep`,"doctor.ex.deep")]});const Y=z.command("bench").summary(R("bench.summary")).description(R("bench.description")).option("--samples <n>",R("bench.opt.samples"),"5").action(async e=>{const o=[];e.samples&&o.push("--samples",e.samples),await $(o)});p(Y,{...N("bench",[[`${C} base`,"bench.alt.base"]]),examples:[K(`${C} bench`,"bench.ex.run"),K(`${C} bench --samples 3`,"bench.ex.samples"),K(`${C} bench --json`,"bench.ex.json")]});const D=z.command("logs").summary(R("logs.summary")).description(R("logs.description")).argument("[action]",R("logs.arg.action")).argument("[file]",R("logs.arg.file")).action(async(e,o)=>{const t=[];e&&t.push(e),o&&t.push(o),await b(t)});p(D,{...N("logs",[[`${C} doctor`,"logs.alt.doctor"]]),sections:[{title:R("logs.actions_title"),rows:[["list",R("logs.action.list")],["tail [file]",R("logs.action.tail")],["path",R("logs.action.path")]]}],examples:[K(`${C} logs`,"logs.ex.list"),K(`${C} logs tail`,"logs.ex.tail"),K(`${C} logs path`,"logs.ex.path")]}),z.commandsGroup(R("group.maintain"));const I=z.command("upgrade").summary(R("upgrade.summary")).description(R("upgrade.description")).argument("[tools...]",R("upgrade.arg.tools")).action(async(e=[])=>{await _(e)});p(I,{...N("upgrade",[[`${C} update`,"upgrade.alt.update"]]),examples:[K(`${C} upgrade`,"upgrade.ex.all"),K(`${C} upgrade claude-code`,"upgrade.ex.one"),K(`${C} upgrade codex agy`,"upgrade.ex.many")]});const Q=z.command("refresh").summary(R("refresh.summary")).description(R("refresh.description")).action(async()=>{await y()});p(Q,{...N("refresh",[[`${C} setup --key <你的 Key>`,"refresh.alt.setup"]]),examples:[K(`${C} refresh`,"refresh.ex.run"),K(`${C} refresh --base ${G}`,"refresh.ex.base")]});const V=z.command("update").summary(R("update.summary")).description(R("update.description")).action(async()=>{await k()});p(V,{...N("update",[[`${C} upgrade`,"update.alt.upgrade"]]),examples:[K(`${C} update`,"update.ex.check"),K(`${C} update --json`,"update.ex.json")]});const W=z.command("codex").summary(R("codex.summary")).description(R("codex.description"));P(W);const X=W.command("sessions").summary(R("codex_sessions.summary")).description(R("codex_sessions.description")).option("--to <provider>",R("codex_sessions.opt.to")).option("--undo <dir>",R("codex_sessions.opt.undo")).action(async e=>{await w(e)});p(W,{...N("codex"),examples:[K(`${C} codex sessions`,"codex_sessions.ex.move"),K(`${C} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]}),p(X,{...N("codex_sessions",[[`${C} codex sessions --undo <dir>`,"codex_sessions.alt.undo"]]),examples:[K(`${C} codex sessions`,"codex_sessions.ex.move"),K(`${C} codex sessions --to custom`,"codex_sessions.ex.to"),K(`${C} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]});const Z=z.command("lang").summary(R("lang.summary")).description(R("lang.description"));P(Z);const ee=Z.command("show").description(R("lang.show")).action(async()=>{await m(["show"])}),oe=Z.command("set <locale>").description(R("lang.set")).action(async e=>{await m(["set",e])}),te=[K(`${C} lang show`,"lang.ex.show"),K(`${C} lang set en_US`,"lang.ex.set_en"),K(`${C} lang set zh_CN`,"lang.ex.set_zh")];p(Z,{...N("lang",[[`${C} enter lang`,"lang.alt.enter"]]),examples:te}),p(ee,{examples:[te[0],K(`${C} lang show --json`,"lang.ex.show_json")]}),p(oe,{examples:te.slice(1)});const se=z.command("completion").summary(R("completion.summary")).description(R("completion.description")).argument("<shell>",R("completion.arg.shell")).action(async e=>{await h([e])});p(se,{...N("completion"),examples:[K(`${C} completion bash > ~/.${C}-completion.bash`,"completion.ex.bash"),K(`${C} completion zsh > ~/.${C}-completion.zsh`,"completion.ex.zsh"),K(`${C} completion fish > ~/.config/fish/completions/${C}.fish`,"completion.ex.fish")]});const ae=z.command("enter").summary(R("enter.summary")).description(R("enter.description")).argument("[option]",R("enter.arg.option")).action(async e=>{if(e)switch(e){case"lang":case"language":await r.configLanguage();break;case"apikey":case"api-key":await r.configApiKey();break;case"models":await r.configModels();break;default:await f([e])}else await r.run()});p(ae,{...N("enter",[[`${C}`,"enter.alt.menu"],[`${C} config <tool>`,"enter.alt.config"]]),sections:[{title:R("enter.options_title"),rows:[[R("enter.option.none_term"),R("enter.option.none")],["lang",R("enter.option.lang")],["apikey",R("enter.option.apikey")],["models",R("enter.option.models")],["<tool>",R("enter.option.tool")]]}],examples:[K(`${C} enter`,"enter.ex.menu"),K(`${C} enter models`,"enter.ex.models"),K(`${C} enter codex`,"enter.ex.tool")]}),P(z),z.action(async()=>{await r.run()}),p(z,{examples:[K(`${C}`,"root.ex.menu"),K(`${C} setup --key sk-xxx`,"root.ex.setup"),K(`${C} doctor`,"root.ex.doctor"),K(`${C} base auto`,"root.ex.base"),K(`${C} config codex`,"root.ex.config")]});const ne=e=>{for(const o of e.commands)o.helpOption("-h, --help",R("global.help")),ne(o)};return ne(z),z}
1
+ import{Command as e,Option as o}from"commander";import{readFileSync as t}from"fs";import{join as s,dirname as a}from"path";import{fileURLToPath as n}from"url";import{i18n as i}from"./i18n.js";import{wizard as r}from"./wizard.js";import{SUPPORTED_TOOLS as c}from"./tool-manager.js";import{DEFAULT_BASE_URL as l}from"./config.js";import{attachCommandHelp as p,helpConfiguration as u}from"./cli-help.js";import{langCommand as m,authCommand as d,doctorCommand as g,configCommand as f,statusCommand as x,refreshCommand as y}from"../commands/index.js";import{logsCommand as b}from"../commands/logs.js";import{completionCommand as h}from"../commands/completion.js";import{benchCommand as $}from"../commands/bench.js";import{updateCommand as k}from"../commands/update.js";import{upgradeCommand as _}from"../commands/upgrade.js";import{codexSessionsCommand as w}from"../commands/codex-sessions.js";import{setupCommand as v,DEDICATED_KEYS as j}from"../commands/setup.js";import{baseCommand as O}from"../commands/base.js";import{usageError as S}from"./errors.js";import{brand as z,brandEnv as A,CLI_NAME as C}from"./brand.js";const E=(z().gatewayAddresses[1]??z().gatewayAddresses[0]).url,G=(z().gatewayAddresses[2]??z().gatewayAddresses[0]).url;function R(e,o){return i.t(`help.${e}`,o)}function K(e,o){return{command:e,note:R(o)}}function L(e){const o=R(e);return o===`help.${e}`?"":o}function N(e,o=[]){return{when:L(`${e}.when`),prerequisites:L(`${e}.needs`).split("\n").filter(Boolean),alternatives:o.map(([e,o])=>K(e,o))}}function P(e){return e.helpCommand("help [command]",R("help_command"))}export function buildProgram(){const z=new e;z.name(`${C}`).summary(R("root.summary")).description(R("root.description")).configureHelp(u()).allowExcessArguments(!0).optionsGroup(R("group.global_options")).helpOption("-h, --help",R("global.help")).version(function(){try{const e=a(n(import.meta.url));return JSON.parse(t(s(e,"../../package.json"),"utf-8")).version}catch{return"1.0.0"}}(),"-v, --version",R("global.version")).option("--base <url>",R("global.base")).option("--non-interactive",R("global.non_interactive")).option("--json",R("global.json")).option("-y, --yes",R("global.yes")).option("--dry-run",R("global.dry_run")).option("--no-color",R("global.no_color")),z.configureOutput({writeErr:()=>{},outputError:()=>{}}),z.showSuggestionAfterError(),z.exitOverride(e=>{throw e}),z.commandsGroup(R("group.configure"));const L=z.command("setup").summary(R("setup.summary")).description(R("setup.description")).option("--key <key>",R("setup.opt.key"));for(const e of j){const t=new o(`--${e.option} <key>`,R(`setup.opt.${e.option}`));e.hidden&&t.hideHelp(),L.addOption(t)}L.option("--1m",R("setup.opt.one_m")).option("--no-1m",R("setup.opt.no_one_m")).option("--claude-official <on|off>",R("setup.opt.claude_official")).option("--desktop-registry <on|off>",R("setup.opt.desktop_registry")).option("--force",R("setup.opt.force")).option("--install",R("setup.opt.install")).option("--no-install",R("setup.opt.no_install")).option("--all",R("setup.opt.all")).action(async e=>{e.key||j.some(o=>e[o.option])||(e.key=A("SETUP_KEY")?.trim()||void 0);const o=Boolean(e.key||j.some(o=>e[o.option])),t=void 0!==e["1m"]||void 0!==e.claudeOfficial||void 0!==e.desktopRegistry,s="zh_CN"===i.getLocale()?"<你的 Key>":"<your key>";if(!o&&!t)throw S(i.t("setup.usage"),`${C} setup --key ${s}`,"missing_key");if(void 0!==e.claudeOfficial&&!["on","off"].includes(String(e.claudeOfficial).toLowerCase()))throw S(i.t("setup.claude_official_invalid",{value:String(e.claudeOfficial)}),`${C} setup --claude-official on|off`,"invalid_value");if(void 0!==e.desktopRegistry&&!["on","off"].includes(String(e.desktopRegistry).toLowerCase()))throw S(i.t("setup.desktop_registry_invalid",{value:String(e.desktopRegistry)}),`${C} setup --desktop-registry on|off`,"invalid_value");await v({key:e.key,...Object.fromEntries(j.map(o=>[o.option,e[o.option]])),all:e.all,oneMillion:e["1m"],claudeOfficial:e.claudeOfficial,desktopRegistry:e.desktopRegistry,force:e.force,install:e.install})}),p(L,{...N("setup",[[`${C} init`,"setup.alt.init"],[`${C} config <tool>`,"setup.alt.config"],[`${C} auth <key>`,"setup.alt.auth"]]),sections:[{title:R("setup.autodetect_title"),rows:[["Claude",R("setup.autodetect.claude")],["GPT",R("setup.autodetect.gpt")],["Grok",R("setup.autodetect.grok")],["Gemini",R("setup.autodetect.gemini")]]}],examples:[K(`${C} setup --key sk-xxx`,"setup.ex.key"),K(`${C} setup --install --key sk-xxx`,"setup.ex.install"),K(`${C} setup --claudekey sk-a --codexkey sk-b --agykey sk-g`,"setup.ex.split"),K(`${C} setup --force --key sk-xxx`,"setup.ex.force"),K(`${C} setup --base ${E} --key sk-xxx`,"setup.ex.base")]});const T=z.command("init").summary(R("init.summary")).description(R("init.description")).action(async()=>{await r.runFirstTimeSetup()});p(T,{...N("init",[[`${C} setup --key <key>`,"init.alt.setup"],[`${C}`,"init.alt.menu"]]),examples:[K(`${C} init`,"init.ex.run"),K(`${C} init --base ${E}`,"init.ex.base"),K(`${C}`,"init.ex.menu")]});const U=z.command("auth").summary(R("auth.summary")).description(R("auth.description")).argument("[token]",R("auth.arg.token")).action(async e=>{const o=[];e&&o.push(e),await d(o)});P(U);const B=U.command("revoke").description(R("auth.revoke")).action(async()=>{await d(["revoke"])});p(B,{examples:[K(`${C} auth revoke`,"auth.ex.revoke_ask"),K(`${C} auth revoke --yes`,"auth.ex.revoke")]});const H=U.command("reload <tool>").description(R("auth.reload")).action(async e=>{await d(["reload",e])});p(H,{examples:[K(`${C} auth reload claude-code`,"auth.ex.reload"),K(`${C} auth reload claude-code --json`,"auth.ex.reload_json")]}),p(U,{...N("auth",[[`${C} setup --key <key>`,"auth.alt.setup"]]),examples:[K(`${C} auth`,"auth.ex.prompt"),K(`${C} auth sk-xxx --non-interactive`,"auth.ex.save"),K(`${C} auth revoke --yes`,"auth.ex.revoke"),K(`${C} auth reload claude-code`,"auth.ex.reload")]});const M=z.command("config").summary(R("config.summary")).description(R("config.description")).argument("[args...]",R("config.arg.args")).option("-f, --force",R("config.opt.force")).allowUnknownOption(!0).action(async(e=[],o={})=>{await f(o.force?[...e,"--force"]:e)});p(M,{...N("config",[[`${C} setup --force --key <key>`,"config.alt.setup"],[`${C} status`,"config.alt.status"]]),sections:[{title:R("config.subcommands_title"),rows:[["<tool>",R("config.sub.tool")],["<tool> --force",R("config.sub.tool_force")],["<tool> --non-interactive",R("config.sub.tool_non_interactive")],["<tool> restore",R("config.sub.tool_restore")],["<tool> backups",R("config.sub.tool_backups")],["<tool> clear-model",R("config.sub.tool_clear_model")],["tool-model list",R("config.sub.tool_model_list")],["tool-model set <tool> [slot] <model>",R("config.sub.tool_model_set")],["tool-model clear <tool>",R("config.sub.tool_model_clear")],["profile list",R("config.sub.profile_list")],["profile create <name>",R("config.sub.profile_create")],["profile use <name>",R("config.sub.profile_use")],["profile delete <name>",R("config.sub.profile_delete")],["preset list",R("config.sub.preset_list")],["preset save <name>",R("config.sub.preset_save")],["preset use <name>",R("config.sub.preset_use")],["preset delete <name>",R("config.sub.preset_delete")],["backup list",R("config.sub.backup_list")],["backup create [label]",R("config.sub.backup_create")],["backup restore <name>",R("config.sub.backup_restore")]]},{title:R("config.tools_title"),rows:Object.values(c).filter(e=>!e.hidden).map(e=>[e.name,e.displayName])}],examples:[K(`${C} config codex`,"config.ex.menu"),K(`${C} config claude-code --force`,"config.ex.force"),K(`${C} config tool-model set codex gpt-6-astra`,"config.ex.tool_model"),K(`${C} config profile create work`,"config.ex.profile"),K(`${C} config backup create before-upgrade`,"config.ex.backup")]});const q=z.command("base").summary(R("base.summary")).description(R("base.description")).argument("[target]",R("base.arg.target")).action(async e=>{await O(e)});p(q,{...N("base",[[`${C} doctor`,"base.alt.doctor"],[`${C} bench`,"base.alt.bench"]]),sections:[{title:R("base.targets_title"),rows:[[R("base.target.none_term"),R("base.target.none")],[R("base.target.index_term"),R("base.target.index")],[R("base.target.url_term"),R("base.target.url")],["auto",R("base.target.auto")],["default",R("base.target.default",{url:l})]]}],examples:[K(`${C} base`,"base.ex.list"),K(`${C} base auto`,"base.ex.auto"),K(`${C} base 2`,"base.ex.index"),K(`${C} base ${E}`,"base.ex.url"),K(`${C} base default`,"base.ex.default")]}),z.commandsGroup(R("group.diagnose"));const F=z.command("status").summary(R("status.summary")).description(R("status.description")).action(async()=>{await x()});p(F,{...N("status",[[`${C} doctor`,"status.alt.doctor"]]),examples:[K(`${C} status`,"status.ex.show"),K(`${C} status --json`,"status.ex.json")]});const J=z.command("doctor").summary(R("doctor.summary")).description(R("doctor.description")).option("--deep",R("doctor.opt.deep")).action(async e=>{await g({deep:e.deep})});p(J,{...N("doctor",[[`${C} base auto`,"doctor.alt.base"],[`${C} logs tail`,"doctor.alt.logs"]]),examples:[K(`${C} doctor`,"doctor.ex.run"),K(`${C} doctor --deep`,"doctor.ex.deep")]});const Y=z.command("bench").summary(R("bench.summary")).description(R("bench.description")).option("--samples <n>",R("bench.opt.samples"),"5").action(async e=>{const o=[];e.samples&&o.push("--samples",e.samples),await $(o)});p(Y,{...N("bench",[[`${C} base`,"bench.alt.base"]]),examples:[K(`${C} bench`,"bench.ex.run"),K(`${C} bench --samples 3`,"bench.ex.samples"),K(`${C} bench --json`,"bench.ex.json")]});const D=z.command("logs").summary(R("logs.summary")).description(R("logs.description")).argument("[action]",R("logs.arg.action")).argument("[file]",R("logs.arg.file")).action(async(e,o)=>{const t=[];e&&t.push(e),o&&t.push(o),await b(t)});p(D,{...N("logs",[[`${C} doctor`,"logs.alt.doctor"]]),sections:[{title:R("logs.actions_title"),rows:[["list",R("logs.action.list")],["tail [file]",R("logs.action.tail")],["path",R("logs.action.path")]]}],examples:[K(`${C} logs`,"logs.ex.list"),K(`${C} logs tail`,"logs.ex.tail"),K(`${C} logs path`,"logs.ex.path")]}),z.commandsGroup(R("group.maintain"));const I=z.command("upgrade").summary(R("upgrade.summary")).description(R("upgrade.description")).argument("[tools...]",R("upgrade.arg.tools")).action(async(e=[])=>{await _(e)});p(I,{...N("upgrade",[[`${C} update`,"upgrade.alt.update"]]),examples:[K(`${C} upgrade`,"upgrade.ex.all"),K(`${C} upgrade claude-code`,"upgrade.ex.one"),K(`${C} upgrade codex agy`,"upgrade.ex.many")]});const Q=z.command("refresh").summary(R("refresh.summary")).description(R("refresh.description")).action(async()=>{await y()});p(Q,{...N("refresh",[[`${C} setup --key <你的 Key>`,"refresh.alt.setup"]]),examples:[K(`${C} refresh`,"refresh.ex.run"),K(`${C} refresh --base ${G}`,"refresh.ex.base")]});const V=z.command("update").summary(R("update.summary")).description(R("update.description")).action(async()=>{await k()});p(V,{...N("update",[[`${C} upgrade`,"update.alt.upgrade"]]),examples:[K(`${C} update`,"update.ex.check"),K(`${C} update --json`,"update.ex.json")]});const W=z.command("codex").summary(R("codex.summary")).description(R("codex.description"));P(W);const X=W.command("sessions").summary(R("codex_sessions.summary")).description(R("codex_sessions.description")).option("--to <provider>",R("codex_sessions.opt.to")).option("--undo <dir>",R("codex_sessions.opt.undo")).action(async e=>{await w(e)});p(W,{...N("codex"),examples:[K(`${C} codex sessions`,"codex_sessions.ex.move"),K(`${C} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]}),p(X,{...N("codex_sessions",[[`${C} codex sessions --undo <dir>`,"codex_sessions.alt.undo"]]),examples:[K(`${C} codex sessions`,"codex_sessions.ex.move"),K(`${C} codex sessions --to custom`,"codex_sessions.ex.to"),K(`${C} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]});const Z=z.command("lang").summary(R("lang.summary")).description(R("lang.description"));P(Z);const ee=Z.command("show").description(R("lang.show")).action(async()=>{await m(["show"])}),oe=Z.command("set <locale>").description(R("lang.set")).action(async e=>{await m(["set",e])}),te=[K(`${C} lang show`,"lang.ex.show"),K(`${C} lang set en_US`,"lang.ex.set_en"),K(`${C} lang set zh_CN`,"lang.ex.set_zh")];p(Z,{...N("lang",[[`${C} enter lang`,"lang.alt.enter"]]),examples:te}),p(ee,{examples:[te[0],K(`${C} lang show --json`,"lang.ex.show_json")]}),p(oe,{examples:te.slice(1)});const se=z.command("completion").summary(R("completion.summary")).description(R("completion.description")).argument("<shell>",R("completion.arg.shell")).action(async e=>{await h([e])});p(se,{...N("completion"),examples:[K(`${C} completion bash > ~/.${C}-completion.bash`,"completion.ex.bash"),K(`${C} completion zsh > ~/.${C}-completion.zsh`,"completion.ex.zsh"),K(`${C} completion fish > ~/.config/fish/completions/${C}.fish`,"completion.ex.fish")]});const ae=z.command("enter").summary(R("enter.summary")).description(R("enter.description")).argument("[option]",R("enter.arg.option")).action(async e=>{if(e)switch(e){case"lang":case"language":await r.configLanguage();break;case"apikey":case"api-key":await r.configApiKey();break;case"models":await r.configModels();break;default:await f([e])}else await r.run()});p(ae,{...N("enter",[[`${C}`,"enter.alt.menu"],[`${C} config <tool>`,"enter.alt.config"]]),sections:[{title:R("enter.options_title"),rows:[[R("enter.option.none_term"),R("enter.option.none")],["lang",R("enter.option.lang")],["apikey",R("enter.option.apikey")],["models",R("enter.option.models")],["<tool>",R("enter.option.tool")]]}],examples:[K(`${C} enter`,"enter.ex.menu"),K(`${C} enter models`,"enter.ex.models"),K(`${C} enter codex`,"enter.ex.tool")]}),P(z),z.action(async()=>{await r.run()}),p(z,{examples:[K(`${C}`,"root.ex.menu"),K(`${C} setup --key sk-xxx`,"root.ex.setup"),K(`${C} doctor`,"root.ex.doctor"),K(`${C} base auto`,"root.ex.base"),K(`${C} config codex`,"root.ex.config")]});const ne=e=>{for(const o of e.commands)o.helpOption("-h, --help",R("global.help")),ne(o)};return ne(z),z}
@@ -592,7 +592,7 @@
592
592
  "install": "Configure, then install whatever is missing (China mirrors)"
593
593
  },
594
594
  "when": "First setup after you get a key, or to change the key or repair broken configs.",
595
- "needs": "A {{brand}} API key (create one on the Tokens page of the console)\nClaude Code, Codex, Grok Build and Antigravity CLI can be installed later: they still get their config, plus the install command; Claude Desktop is configured only once installed (or forced with --desktopkey)",
595
+ "needs": "A {{brand}} API key (create one on the Tokens page of the console)\nTools can be installed later: missing command-line tools get their config first, then an offer to install them from China mirrors (--install installs without asking); Claude Desktop (macOS / Windows) gets its config even before it is installed",
596
596
  "alt": {
597
597
  "init": "Choose tools and models step by step",
598
598
  "config": "Change one tool only",
@@ -592,7 +592,7 @@
592
592
  "install": "配好后把没装的工具一起装上(国内镜像)"
593
593
  },
594
594
  "when": "拿到 Key 后第一次配置,或者换 Key、修复被改坏的配置时。",
595
- "needs": "一把 {{brand}} 的 API Key(在控制台的「令牌」页创建)\nClaude Code、Codex、Grok Build、Antigravity CLI 可以之后再装:没装也会先写好配置,并给出安装命令;Claude Desktop 要先装好才会配置(或用 --desktopkey 强制写入)",
595
+ "needs": "一把 {{brand}} 的 API Key(在控制台的「令牌」页创建)\n工具可以之后再装:没装的命令行工具会先写好配置,再问要不要从国内镜像装上(--install 直接装);Claude Desktop(macOS / Windows)没装也先写好,装好打开就能用",
596
596
  "alt": {
597
597
  "init": "想一步步选工具和模型",
598
598
  "config": "只改一个工具",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeapi/api-helper",
3
- "version": "0.0.101",
3
+ "version": "0.0.103",
4
4
  "description": "CLI tool for managing AI coding assistants (Claude Code, Codex, OpenClaw, Hermes, AtomCode, Grok Build) with one unified config",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",