@vibeapi/api-helper 0.0.131 → 0.0.132

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.
@@ -1 +1 @@
1
- import{Command as e,Option as o}from"commander";import{readFileSync as s}from"fs";import{join as t,dirname as n}from"path";import{fileURLToPath as a}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 m}from"./cli-help.js";import{langCommand as u,authCommand as d,doctorCommand as f,configCommand as g,statusCommand as x,refreshCommand as h}from"../commands/index.js";import{logsCommand as y}from"../commands/logs.js";import{completionCommand as $}from"../commands/completion.js";import{benchCommand as b}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{sessionsExportCommand as v,sessionsListCommand as j,sessionsResumeCommand as O,sessionsShowCommand as S}from"../commands/sessions.js";import{setupCommand as A,DEDICATED_KEYS as E}from"../commands/setup.js";import{baseCommand as G}from"../commands/base.js";import{usageError as z}from"./errors.js";import{brand as C,brandEnv as R,CLI_NAME as B}from"./brand.js";const L=(C().gatewayAddresses[1]??C().gatewayAddresses[0]).url,N=(C().gatewayAddresses[2]??C().gatewayAddresses[0]).url;function P(e,o){return i.t(`help.${e}`,o)}function T(e,o){return{command:e,note:P(o)}}function U(e){const o=P(e);return o===`help.${e}`?"":o}function H(e,o=[]){return{when:U(`${e}.when`),prerequisites:U(`${e}.needs`).split("\n").filter(Boolean),alternatives:o.map(([e,o])=>T(e,o))}}function K(e){return e.helpCommand("help [command]",P("help_command"))}export function buildProgram(){const C=new e;C.name(`${B}`).summary(P("root.summary")).description(P("root.description")).configureHelp(m()).allowExcessArguments(!0).optionsGroup(P("group.global_options")).helpOption("-h, --help",P("global.help")).version(function(){try{const e=n(a(import.meta.url));return JSON.parse(s(t(e,"../../package.json"),"utf-8")).version}catch{return"1.0.0"}}(),"-v, --version",P("global.version")).option("--base <url>",P("global.base")).option("--non-interactive",P("global.non_interactive")).option("--json",P("global.json")).option("-y, --yes",P("global.yes")).option("--dry-run",P("global.dry_run")).option("--no-color",P("global.no_color")),C.configureOutput({writeErr:()=>{},outputError:()=>{}}),C.showSuggestionAfterError(),C.exitOverride(e=>{throw e}),C.commandsGroup(P("group.configure"));const U=C.command("setup").summary(P("setup.summary")).description(P("setup.description")).option("--key <key>",P("setup.opt.key"));for(const e of E){const s=new o(`--${e.option} <key>`,P(`setup.opt.${e.option}`));e.hidden&&s.hideHelp(),U.addOption(s)}U.option("--1m",P("setup.opt.one_m")).option("--no-1m",P("setup.opt.no_one_m")).option("--claude-official <on|off>",P("setup.opt.claude_official")).option("--desktop-registry <on|off>",P("setup.opt.desktop_registry")).option("--force",P("setup.opt.force")).option("--install",P("setup.opt.install")).option("--no-install",P("setup.opt.no_install")).option("--all",P("setup.opt.all")).action(async e=>{e.key||E.some(o=>e[o.option])||(e.key=R("SETUP_KEY")?.trim()||void 0,e.fromInstaller=Boolean(e.key));const o=Boolean(e.key||E.some(o=>e[o.option])),s=void 0!==e["1m"]||void 0!==e.claudeOfficial||void 0!==e.desktopRegistry,t=i.t("errors.key_placeholder");if(!o&&!s)throw z(i.t("setup.usage"),`${B} setup --key ${t}`,"missing_key");if(void 0!==e.claudeOfficial&&!["on","off"].includes(String(e.claudeOfficial).toLowerCase()))throw z(i.t("setup.claude_official_invalid",{value:String(e.claudeOfficial)}),`${B} setup --claude-official on|off`,"invalid_value");if(void 0!==e.desktopRegistry&&!["on","off"].includes(String(e.desktopRegistry).toLowerCase()))throw z(i.t("setup.desktop_registry_invalid",{value:String(e.desktopRegistry)}),`${B} setup --desktop-registry on|off`,"invalid_value");await A({key:e.key,...Object.fromEntries(E.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(U,{...H("setup",[[`${B} init`,"setup.alt.init"],[`${B} config <tool>`,"setup.alt.config"],[`${B} auth <key>`,"setup.alt.auth"]]),sections:[{title:P("setup.autodetect_title"),rows:[["Claude",P("setup.autodetect.claude")],["GPT",P("setup.autodetect.gpt")],["Grok",P("setup.autodetect.grok")],["Gemini",P("setup.autodetect.gemini")]]}],examples:[T(`${B} setup --key sk-xxx`,"setup.ex.key"),T(`${B} setup --install --key sk-xxx`,"setup.ex.install"),T(`${B} setup --claudekey sk-a --codexkey sk-b --agykey sk-g`,"setup.ex.split"),T(`${B} setup --force --key sk-xxx`,"setup.ex.force"),T(`${B} setup --base ${L} --key sk-xxx`,"setup.ex.base")]});const M=C.command("init").summary(P("init.summary")).description(P("init.description")).action(async()=>{await r.runFirstTimeSetup()});p(M,{...H("init",[[`${B} setup --key <key>`,"init.alt.setup"],[`${B}`,"init.alt.menu"]]),examples:[T(`${B} init`,"init.ex.run"),T(`${B} init --base ${L}`,"init.ex.base"),T(`${B}`,"init.ex.menu")]});const q=C.command("auth").summary(P("auth.summary")).description(P("auth.description")).argument("[token]",P("auth.arg.token")).action(async e=>{const o=[];e&&o.push(e),await d(o)});K(q);const D=q.command("revoke").description(P("auth.revoke")).action(async()=>{await d(["revoke"])});p(D,{examples:[T(`${B} auth revoke`,"auth.ex.revoke_ask"),T(`${B} auth revoke --yes`,"auth.ex.revoke")]});const F=q.command("reload <tool>").description(P("auth.reload")).action(async e=>{await d(["reload",e])});p(F,{examples:[T(`${B} auth reload claude-code`,"auth.ex.reload"),T(`${B} auth reload claude-code --json`,"auth.ex.reload_json")]}),p(q,{...H("auth",[[`${B} setup --key <key>`,"auth.alt.setup"]]),examples:[T(`${B} auth`,"auth.ex.prompt"),T(`${B} auth sk-xxx --non-interactive`,"auth.ex.save"),T(`${B} auth revoke --yes`,"auth.ex.revoke"),T(`${B} auth reload claude-code`,"auth.ex.reload")]});const I=C.command("config").summary(P("config.summary")).description(P("config.description")).argument("[args...]",P("config.arg.args")).option("-f, --force",P("config.opt.force")).allowUnknownOption(!0).action(async(e=[],o={})=>{await g(o.force?[...e,"--force"]:e)});p(I,{...H("config",[[`${B} setup --force --key <key>`,"config.alt.setup"],[`${B} status`,"config.alt.status"]]),sections:[{title:P("config.subcommands_title"),rows:[["<tool>",P("config.sub.tool")],["<tool> --force",P("config.sub.tool_force")],["<tool> --non-interactive",P("config.sub.tool_non_interactive")],["<tool> remove",P("config.sub.tool_remove")],["<tool> restore",P("config.sub.tool_restore")],["<tool> backups",P("config.sub.tool_backups")],["<tool> clear-model",P("config.sub.tool_clear_model")],["tool-model list",P("config.sub.tool_model_list")],["tool-model set <tool> [slot] <model>",P("config.sub.tool_model_set")],["tool-model clear <tool>",P("config.sub.tool_model_clear")],["profile list",P("config.sub.profile_list")],["profile create <name>",P("config.sub.profile_create")],["profile use <name>",P("config.sub.profile_use")],["profile delete <name>",P("config.sub.profile_delete")],["preset list",P("config.sub.preset_list")],["preset save <name>",P("config.sub.preset_save")],["preset use <name>",P("config.sub.preset_use")],["preset delete <name>",P("config.sub.preset_delete")],["backup list",P("config.sub.backup_list")],["backup create [label]",P("config.sub.backup_create")],["backup restore <name>",P("config.sub.backup_restore")]]},{title:P("config.tools_title"),rows:Object.values(c).filter(e=>!e.hidden).map(e=>[e.name,e.displayName])}],examples:[T(`${B} config codex`,"config.ex.menu"),T(`${B} config claude-code --force`,"config.ex.force"),T(`${B} config tool-model set codex gpt-6-astra`,"config.ex.tool_model"),T(`${B} config profile create work`,"config.ex.profile"),T(`${B} config codex remove`,"config.ex.remove")]});const J=C.command("base").summary(P("base.summary")).description(P("base.description")).argument("[target]",P("base.arg.target")).action(async e=>{await G(e)});p(J,{...H("base",[[`${B} doctor`,"base.alt.doctor"],[`${B} bench`,"base.alt.bench"]]),sections:[{title:P("base.targets_title"),rows:[[P("base.target.none_term"),P("base.target.none")],[P("base.target.index_term"),P("base.target.index")],[P("base.target.url_term"),P("base.target.url")],["auto",P("base.target.auto")],["default",P("base.target.default",{url:l})]]}],examples:[T(`${B} base`,"base.ex.list"),T(`${B} base auto`,"base.ex.auto"),T(`${B} base 2`,"base.ex.index"),T(`${B} base ${L}`,"base.ex.url"),T(`${B} base default`,"base.ex.default")]}),C.commandsGroup(P("group.diagnose"));const Y=C.command("status").summary(P("status.summary")).description(P("status.description")).action(async()=>{await x()});p(Y,{...H("status",[[`${B} doctor`,"status.alt.doctor"]]),examples:[T(`${B} status`,"status.ex.show"),T(`${B} status --json`,"status.ex.json")]});const Q=C.command("doctor").summary(P("doctor.summary")).description(P("doctor.description")).option("--deep",P("doctor.opt.deep")).option("--report",P("doctor.opt.report")).action(async e=>{await f({deep:e.deep,report:e.report})});p(Q,{...H("doctor",[[`${B} base auto`,"doctor.alt.base"],[`${B} logs tail`,"doctor.alt.logs"]]),examples:[T(`${B} doctor`,"doctor.ex.run"),T(`${B} doctor --deep`,"doctor.ex.deep"),T(`${B} doctor --report`,"doctor.ex.report")]});const V=C.command("bench").summary(P("bench.summary")).description(P("bench.description")).option("--samples <n>",P("bench.opt.samples"),"5").option("--stream",P("bench.opt.stream")).option("--model <model>",P("bench.opt.model")).action(async e=>{const o=[];e.samples&&o.push("--samples",e.samples),e.stream&&o.push("--stream"),e.model&&o.push("--model",e.model),await b(o)});p(V,{...H("bench",[[`${B} base`,"bench.alt.base"]]),examples:[T(`${B} bench`,"bench.ex.run"),T(`${B} bench --samples 3`,"bench.ex.samples"),T(`${B} bench --stream`,"bench.ex.stream"),T(`${B} bench --stream --model gpt-6-astra`,"bench.ex.stream_model"),T(`${B} bench --json`,"bench.ex.json")]});const W=C.command("logs").summary(P("logs.summary")).description(P("logs.description")).argument("[action]",P("logs.arg.action")).argument("[file]",P("logs.arg.file")).action(async(e,o)=>{const s=[];e&&s.push(e),o&&s.push(o),await y(s)});p(W,{...H("logs",[[`${B} doctor`,"logs.alt.doctor"]]),sections:[{title:P("logs.actions_title"),rows:[["list",P("logs.action.list")],["tail [file]",P("logs.action.tail")],["path",P("logs.action.path")]]}],examples:[T(`${B} logs`,"logs.ex.list"),T(`${B} logs tail`,"logs.ex.tail"),T(`${B} logs path`,"logs.ex.path")]}),C.commandsGroup(P("group.maintain"));const X=C.command("upgrade").summary(P("upgrade.summary")).description(P("upgrade.description")).argument("[tools...]",P("upgrade.arg.tools")).action(async(e=[])=>{await _(e)});p(X,{...H("upgrade",[[`${B} update`,"upgrade.alt.update"]]),examples:[T(`${B} upgrade`,"upgrade.ex.all"),T(`${B} upgrade claude-code`,"upgrade.ex.one"),T(`${B} upgrade codex agy`,"upgrade.ex.many")]});const Z=C.command("refresh").summary(P("refresh.summary")).description(P("refresh.description")).action(async()=>{await h()});p(Z,{...H("refresh",[[`${B} setup --key ${i.t("errors.key_placeholder")}`,"refresh.alt.setup"]]),examples:[T(`${B} refresh`,"refresh.ex.run"),T(`${B} refresh --base ${N}`,"refresh.ex.base")]});const ee=C.command("update").summary(P("update.summary")).description(P("update.description")).action(async()=>{await k()});p(ee,{...H("update",[[`${B} upgrade`,"update.alt.upgrade"]]),examples:[T(`${B} update`,"update.ex.check"),T(`${B} update --json`,"update.ex.json")]});const oe=C.command("codex").summary(P("codex.summary")).description(P("codex.description"));K(oe);const se=oe.command("sessions").summary(P("codex_sessions.summary")).description(P("codex_sessions.description")).option("--to <provider>",P("codex_sessions.opt.to")).option("--undo <dir>",P("codex_sessions.opt.undo")).action(async e=>{await w(e)});p(oe,{...H("codex"),examples:[T(`${B} codex sessions`,"codex_sessions.ex.move"),T(`${B} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]}),p(se,{...H("codex_sessions",[[`${B} codex sessions --undo <dir>`,"codex_sessions.alt.undo"]]),examples:[T(`${B} codex sessions`,"codex_sessions.ex.move"),T(`${B} codex sessions --to custom`,"codex_sessions.ex.to"),T(`${B} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]});const te=C.command("sessions").summary(P("sessions.summary")).description(P("sessions.description"));K(te);const ne=te.command("list",{isDefault:!0}).description(P("sessions.list")).option("--tool <tool>",P("sessions.opt.tool")).option("--dir <path>",P("sessions.opt.dir")).option("--here",P("sessions.opt.here")).option("-n, --limit <count>",P("sessions.opt.limit")).option("--all",P("sessions.opt.all")).action(async e=>{await j(e)}),ae=te.command("show <id>").description(P("sessions.show")).option("-m, --messages <count>",P("sessions.opt.messages")).action(async(e,o)=>{await S(e,o)}),ie=te.command("resume <id>").description(P("sessions.resume")).option("--run",P("sessions.opt.run")).action(async(e,o)=>{await O(e,o)}),re=te.command("export <ids...>").description(P("sessions.export")).option("-o, --output <dir>",P("sessions.opt.output")).option("--tools",P("sessions.opt.tools")).action(async(e,o)=>{await v(e,o)});p(ne,{examples:[T(`${B} sessions list`,"sessions.ex.list"),T(`${B} sessions list --tool codex`,"sessions.ex.codex"),T(`${B} sessions list --here --all`,"sessions.ex.here"),T(`${B} sessions list --json`,"sessions.ex.json")]}),p(ae,{examples:[T(`${B} sessions show 01a0f5fe`,"sessions.ex.show"),T(`${B} sessions show 01a0f5fe -m 20`,"sessions.ex.show_more")]}),p(ie,{examples:[T(`${B} sessions resume 01a0f5fe`,"sessions.ex.resume_print"),T(`${B} sessions resume 01a0f5fe --run`,"sessions.ex.resume")]}),p(re,{examples:[T(`${B} sessions export 01a0f5fe 7c2e9d41 -o ./sessions`,"sessions.ex.export"),T(`${B} sessions export 01a0f5fe -o ./sessions --tools`,"sessions.ex.export_tools")]}),p(te,{...H("sessions",[[`${B} codex sessions`,"sessions.alt.codex_sessions"]]),examples:[T(`${B} sessions`,"sessions.ex.list"),T(`${B} sessions --tool codex --here`,"sessions.ex.here"),T(`${B} sessions show 01a0f5fe`,"sessions.ex.show"),T(`${B} sessions resume 01a0f5fe --run`,"sessions.ex.resume"),T(`${B} sessions export 01a0f5fe 7c2e9d41 -o ./sessions`,"sessions.ex.export")]});const ce=C.command("lang").summary(P("lang.summary")).description(P("lang.description"));K(ce);const le=ce.command("show").description(P("lang.show")).action(async()=>{await u(["show"])}),pe=ce.command("set <locale>").description(P("lang.set")).action(async e=>{await u(["set",e])}),me=[T(`${B} lang show`,"lang.ex.show"),T(`${B} lang set en_US`,"lang.ex.set_en"),T(`${B} lang set zh_CN`,"lang.ex.set_zh")];p(ce,{...H("lang",[[`${B} enter lang`,"lang.alt.enter"]]),examples:me}),p(le,{examples:[me[0],T(`${B} lang show --json`,"lang.ex.show_json")]}),p(pe,{examples:me.slice(1)});const ue=C.command("completion").summary(P("completion.summary")).description(P("completion.description")).argument("<shell>",P("completion.arg.shell")).action(async e=>{await $([e])});p(ue,{...H("completion"),examples:[T(`${B} completion bash > ~/.${B}-completion.bash`,"completion.ex.bash"),T(`${B} completion zsh > ~/.${B}-completion.zsh`,"completion.ex.zsh"),T(`${B} completion fish > ~/.config/fish/completions/${B}.fish`,"completion.ex.fish")]});const de=C.command("enter").summary(P("enter.summary")).description(P("enter.description")).argument("[option]",P("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 g([e])}else await r.run()});p(de,{...H("enter",[[`${B}`,"enter.alt.menu"],[`${B} config <tool>`,"enter.alt.config"]]),sections:[{title:P("enter.options_title"),rows:[[P("enter.option.none_term"),P("enter.option.none")],["lang",P("enter.option.lang")],["apikey",P("enter.option.apikey")],["models",P("enter.option.models")],["<tool>",P("enter.option.tool")]]}],examples:[T(`${B} enter`,"enter.ex.menu"),T(`${B} enter models`,"enter.ex.models"),T(`${B} enter codex`,"enter.ex.tool")]}),K(C),C.action(async()=>{await r.run()}),p(C,{examples:[T(`${B}`,"root.ex.menu"),T(`${B} setup --key sk-xxx`,"root.ex.setup"),T(`${B} doctor`,"root.ex.doctor"),T(`${B} base auto`,"root.ex.base"),T(`${B} config codex`,"root.ex.config")]});const fe=e=>{for(const o of e.commands)o.helpOption("-h, --help",P("global.help")),fe(o)};return fe(C),C}
1
+ import{Command as e,Option as o}from"commander";import{readFileSync as s}from"fs";import{join as t,dirname as n}from"path";import{fileURLToPath as a}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 m}from"./cli-help.js";import{langCommand as u,authCommand as d,doctorCommand as f,configCommand as g,statusCommand as x,refreshCommand as h}from"../commands/index.js";import{logsCommand as y}from"../commands/logs.js";import{completionCommand as $}from"../commands/completion.js";import{benchCommand as b}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{sessionsExportCommand as v,sessionsListCommand as j,sessionsResumeCommand as O,sessionsShowCommand as S}from"../commands/sessions.js";import{setupCommand as A,DEDICATED_KEYS as E}from"../commands/setup.js";import{baseCommand as G}from"../commands/base.js";import{usageError as z}from"./errors.js";import{brand as C,brandEnv as R,CLI_NAME as B}from"./brand.js";const I=(C().gatewayAddresses[1]??C().gatewayAddresses[0]).url,L=(C().gatewayAddresses[2]??C().gatewayAddresses[0]).url;function N(e,o){return i.t(`help.${e}`,o)}function P(e,o){return{command:e,note:N(o)}}function T(e){const o=N(e);return o===`help.${e}`?"":o}function U(e,o=[]){return{when:T(`${e}.when`),prerequisites:T(`${e}.needs`).split("\n").filter(Boolean),alternatives:o.map(([e,o])=>P(e,o))}}function H(e){return e.helpCommand("help [command]",N("help_command"))}export function buildProgram(){const C=new e;C.name(`${B}`).summary(N("root.summary")).description(N("root.description")).configureHelp(m()).allowExcessArguments(!0).optionsGroup(N("group.global_options")).helpOption("-h, --help",N("global.help")).version(function(){try{const e=n(a(import.meta.url));return JSON.parse(s(t(e,"../../package.json"),"utf-8")).version}catch{return"1.0.0"}}(),"-v, --version",N("global.version")).option("--base <url>",N("global.base")).option("--non-interactive",N("global.non_interactive")).option("--json",N("global.json")).option("-y, --yes",N("global.yes")).option("--dry-run",N("global.dry_run")).option("--no-color",N("global.no_color")),C.configureOutput({writeErr:()=>{},outputError:()=>{}}),C.showSuggestionAfterError(),C.exitOverride(e=>{throw e}),C.commandsGroup(N("group.configure"));const T=C.command("setup").summary(N("setup.summary")).description(N("setup.description")).option("--key <key>",N("setup.opt.key"));for(const e of E){const s=new o(`--${e.option} <key>`,N(`setup.opt.${e.option}`));e.hidden&&s.hideHelp(),T.addOption(s)}T.option("--1m",N("setup.opt.one_m")).option("--no-1m",N("setup.opt.no_one_m")).option("--claude-official <on|off>",N("setup.opt.claude_official")).option("--desktop-registry <on|off>",N("setup.opt.desktop_registry")).option("--force",N("setup.opt.force")).option("--install",N("setup.opt.install")).option("--no-install",N("setup.opt.no_install")).option("--all",N("setup.opt.all")).action(async e=>{e.key||E.some(o=>e[o.option])||(e.key=R("SETUP_KEY")?.trim()||void 0,e.fromInstaller=Boolean(e.key));const o=Boolean(e.key||E.some(o=>e[o.option])),s=void 0!==e["1m"]||void 0!==e.claudeOfficial||void 0!==e.desktopRegistry,t=i.t("errors.key_placeholder");if(!o&&!s)throw z(i.t("setup.usage"),`${B} setup --key ${t}`,"missing_key");if(void 0!==e.claudeOfficial&&!["on","off"].includes(String(e.claudeOfficial).toLowerCase()))throw z(i.t("setup.claude_official_invalid",{value:String(e.claudeOfficial)}),`${B} setup --claude-official on|off`,"invalid_value");if(void 0!==e.desktopRegistry&&!["on","off"].includes(String(e.desktopRegistry).toLowerCase()))throw z(i.t("setup.desktop_registry_invalid",{value:String(e.desktopRegistry)}),`${B} setup --desktop-registry on|off`,"invalid_value");await A({key:e.key,...Object.fromEntries(E.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,fromInstaller:e.fromInstaller})}),p(T,{...U("setup",[[`${B} init`,"setup.alt.init"],[`${B} config <tool>`,"setup.alt.config"],[`${B} auth <key>`,"setup.alt.auth"]]),sections:[{title:N("setup.autodetect_title"),rows:[["Claude",N("setup.autodetect.claude")],["GPT",N("setup.autodetect.gpt")],["Grok",N("setup.autodetect.grok")],["Gemini",N("setup.autodetect.gemini")]]}],examples:[P(`${B} setup --key sk-xxx`,"setup.ex.key"),P(`${B} setup --install --key sk-xxx`,"setup.ex.install"),P(`${B} setup --claudekey sk-a --codexkey sk-b --agykey sk-g`,"setup.ex.split"),P(`${B} setup --force --key sk-xxx`,"setup.ex.force"),P(`${B} setup --base ${I} --key sk-xxx`,"setup.ex.base")]});const K=C.command("init").summary(N("init.summary")).description(N("init.description")).action(async()=>{await r.runFirstTimeSetup()});p(K,{...U("init",[[`${B} setup --key <key>`,"init.alt.setup"],[`${B}`,"init.alt.menu"]]),examples:[P(`${B} init`,"init.ex.run"),P(`${B} init --base ${I}`,"init.ex.base"),P(`${B}`,"init.ex.menu")]});const M=C.command("auth").summary(N("auth.summary")).description(N("auth.description")).argument("[token]",N("auth.arg.token")).action(async e=>{const o=[];e&&o.push(e),await d(o)});H(M);const q=M.command("revoke").description(N("auth.revoke")).action(async()=>{await d(["revoke"])});p(q,{examples:[P(`${B} auth revoke`,"auth.ex.revoke_ask"),P(`${B} auth revoke --yes`,"auth.ex.revoke")]});const D=M.command("reload <tool>").description(N("auth.reload")).action(async e=>{await d(["reload",e])});p(D,{examples:[P(`${B} auth reload claude-code`,"auth.ex.reload"),P(`${B} auth reload claude-code --json`,"auth.ex.reload_json")]}),p(M,{...U("auth",[[`${B} setup --key <key>`,"auth.alt.setup"]]),examples:[P(`${B} auth`,"auth.ex.prompt"),P(`${B} auth sk-xxx --non-interactive`,"auth.ex.save"),P(`${B} auth revoke --yes`,"auth.ex.revoke"),P(`${B} auth reload claude-code`,"auth.ex.reload")]});const F=C.command("config").summary(N("config.summary")).description(N("config.description")).argument("[args...]",N("config.arg.args")).option("-f, --force",N("config.opt.force")).allowUnknownOption(!0).action(async(e=[],o={})=>{await g(o.force?[...e,"--force"]:e)});p(F,{...U("config",[[`${B} setup --force --key <key>`,"config.alt.setup"],[`${B} status`,"config.alt.status"]]),sections:[{title:N("config.subcommands_title"),rows:[["<tool>",N("config.sub.tool")],["<tool> --force",N("config.sub.tool_force")],["<tool> --non-interactive",N("config.sub.tool_non_interactive")],["<tool> remove",N("config.sub.tool_remove")],["<tool> restore",N("config.sub.tool_restore")],["<tool> backups",N("config.sub.tool_backups")],["<tool> clear-model",N("config.sub.tool_clear_model")],["tool-model list",N("config.sub.tool_model_list")],["tool-model set <tool> [slot] <model>",N("config.sub.tool_model_set")],["tool-model clear <tool>",N("config.sub.tool_model_clear")],["profile list",N("config.sub.profile_list")],["profile create <name>",N("config.sub.profile_create")],["profile use <name>",N("config.sub.profile_use")],["profile delete <name>",N("config.sub.profile_delete")],["preset list",N("config.sub.preset_list")],["preset save <name>",N("config.sub.preset_save")],["preset use <name>",N("config.sub.preset_use")],["preset delete <name>",N("config.sub.preset_delete")],["backup list",N("config.sub.backup_list")],["backup create [label]",N("config.sub.backup_create")],["backup restore <name>",N("config.sub.backup_restore")]]},{title:N("config.tools_title"),rows:Object.values(c).filter(e=>!e.hidden).map(e=>[e.name,e.displayName])}],examples:[P(`${B} config codex`,"config.ex.menu"),P(`${B} config claude-code --force`,"config.ex.force"),P(`${B} config tool-model set codex gpt-6-astra`,"config.ex.tool_model"),P(`${B} config profile create work`,"config.ex.profile"),P(`${B} config codex remove`,"config.ex.remove")]});const J=C.command("base").summary(N("base.summary")).description(N("base.description")).argument("[target]",N("base.arg.target")).action(async e=>{await G(e)});p(J,{...U("base",[[`${B} doctor`,"base.alt.doctor"],[`${B} bench`,"base.alt.bench"]]),sections:[{title:N("base.targets_title"),rows:[[N("base.target.none_term"),N("base.target.none")],[N("base.target.index_term"),N("base.target.index")],[N("base.target.url_term"),N("base.target.url")],["auto",N("base.target.auto")],["default",N("base.target.default",{url:l})]]}],examples:[P(`${B} base`,"base.ex.list"),P(`${B} base auto`,"base.ex.auto"),P(`${B} base 2`,"base.ex.index"),P(`${B} base ${I}`,"base.ex.url"),P(`${B} base default`,"base.ex.default")]}),C.commandsGroup(N("group.diagnose"));const Y=C.command("status").summary(N("status.summary")).description(N("status.description")).action(async()=>{await x()});p(Y,{...U("status",[[`${B} doctor`,"status.alt.doctor"]]),examples:[P(`${B} status`,"status.ex.show"),P(`${B} status --json`,"status.ex.json")]});const Q=C.command("doctor").summary(N("doctor.summary")).description(N("doctor.description")).option("--deep",N("doctor.opt.deep")).option("--report",N("doctor.opt.report")).action(async e=>{await f({deep:e.deep,report:e.report})});p(Q,{...U("doctor",[[`${B} base auto`,"doctor.alt.base"],[`${B} logs tail`,"doctor.alt.logs"]]),examples:[P(`${B} doctor`,"doctor.ex.run"),P(`${B} doctor --deep`,"doctor.ex.deep"),P(`${B} doctor --report`,"doctor.ex.report")]});const V=C.command("bench").summary(N("bench.summary")).description(N("bench.description")).option("--samples <n>",N("bench.opt.samples"),"5").option("--stream",N("bench.opt.stream")).option("--model <model>",N("bench.opt.model")).action(async e=>{const o=[];e.samples&&o.push("--samples",e.samples),e.stream&&o.push("--stream"),e.model&&o.push("--model",e.model),await b(o)});p(V,{...U("bench",[[`${B} base`,"bench.alt.base"]]),examples:[P(`${B} bench`,"bench.ex.run"),P(`${B} bench --samples 3`,"bench.ex.samples"),P(`${B} bench --stream`,"bench.ex.stream"),P(`${B} bench --stream --model gpt-6-astra`,"bench.ex.stream_model"),P(`${B} bench --json`,"bench.ex.json")]});const W=C.command("logs").summary(N("logs.summary")).description(N("logs.description")).argument("[action]",N("logs.arg.action")).argument("[file]",N("logs.arg.file")).action(async(e,o)=>{const s=[];e&&s.push(e),o&&s.push(o),await y(s)});p(W,{...U("logs",[[`${B} doctor`,"logs.alt.doctor"]]),sections:[{title:N("logs.actions_title"),rows:[["list",N("logs.action.list")],["tail [file]",N("logs.action.tail")],["path",N("logs.action.path")]]}],examples:[P(`${B} logs`,"logs.ex.list"),P(`${B} logs tail`,"logs.ex.tail"),P(`${B} logs path`,"logs.ex.path")]}),C.commandsGroup(N("group.maintain"));const X=C.command("upgrade").summary(N("upgrade.summary")).description(N("upgrade.description")).argument("[tools...]",N("upgrade.arg.tools")).action(async(e=[])=>{await _(e)});p(X,{...U("upgrade",[[`${B} update`,"upgrade.alt.update"]]),examples:[P(`${B} upgrade`,"upgrade.ex.all"),P(`${B} upgrade claude-code`,"upgrade.ex.one"),P(`${B} upgrade codex agy`,"upgrade.ex.many")]});const Z=C.command("refresh").summary(N("refresh.summary")).description(N("refresh.description")).action(async()=>{await h()});p(Z,{...U("refresh",[[`${B} setup --key ${i.t("errors.key_placeholder")}`,"refresh.alt.setup"]]),examples:[P(`${B} refresh`,"refresh.ex.run"),P(`${B} refresh --base ${L}`,"refresh.ex.base")]});const ee=C.command("update").summary(N("update.summary")).description(N("update.description")).action(async()=>{await k()});p(ee,{...U("update",[[`${B} upgrade`,"update.alt.upgrade"]]),examples:[P(`${B} update`,"update.ex.check"),P(`${B} update --json`,"update.ex.json")]});const oe=C.command("codex").summary(N("codex.summary")).description(N("codex.description"));H(oe);const se=oe.command("sessions").summary(N("codex_sessions.summary")).description(N("codex_sessions.description")).option("--to <provider>",N("codex_sessions.opt.to")).option("--undo <dir>",N("codex_sessions.opt.undo")).action(async e=>{await w(e)});p(oe,{...U("codex"),examples:[P(`${B} codex sessions`,"codex_sessions.ex.move"),P(`${B} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]}),p(se,{...U("codex_sessions",[[`${B} codex sessions --undo <dir>`,"codex_sessions.alt.undo"]]),examples:[P(`${B} codex sessions`,"codex_sessions.ex.move"),P(`${B} codex sessions --to custom`,"codex_sessions.ex.to"),P(`${B} codex sessions --undo <dir>`,"codex_sessions.ex.undo")]});const te=C.command("sessions").summary(N("sessions.summary")).description(N("sessions.description"));H(te);const ne=te.command("list",{isDefault:!0}).description(N("sessions.list")).option("--tool <tool>",N("sessions.opt.tool")).option("--dir <path>",N("sessions.opt.dir")).option("--here",N("sessions.opt.here")).option("-n, --limit <count>",N("sessions.opt.limit")).option("--all",N("sessions.opt.all")).action(async e=>{await j(e)}),ae=te.command("show <id>").description(N("sessions.show")).option("-m, --messages <count>",N("sessions.opt.messages")).action(async(e,o)=>{await S(e,o)}),ie=te.command("resume <id>").description(N("sessions.resume")).option("--run",N("sessions.opt.run")).action(async(e,o)=>{await O(e,o)}),re=te.command("export <ids...>").description(N("sessions.export")).option("-o, --output <dir>",N("sessions.opt.output")).option("--tools",N("sessions.opt.tools")).action(async(e,o)=>{await v(e,o)});p(ne,{examples:[P(`${B} sessions list`,"sessions.ex.list"),P(`${B} sessions list --tool codex`,"sessions.ex.codex"),P(`${B} sessions list --here --all`,"sessions.ex.here"),P(`${B} sessions list --json`,"sessions.ex.json")]}),p(ae,{examples:[P(`${B} sessions show 01a0f5fe`,"sessions.ex.show"),P(`${B} sessions show 01a0f5fe -m 20`,"sessions.ex.show_more")]}),p(ie,{examples:[P(`${B} sessions resume 01a0f5fe`,"sessions.ex.resume_print"),P(`${B} sessions resume 01a0f5fe --run`,"sessions.ex.resume")]}),p(re,{examples:[P(`${B} sessions export 01a0f5fe 7c2e9d41 -o ./sessions`,"sessions.ex.export"),P(`${B} sessions export 01a0f5fe -o ./sessions --tools`,"sessions.ex.export_tools")]}),p(te,{...U("sessions",[[`${B} codex sessions`,"sessions.alt.codex_sessions"]]),examples:[P(`${B} sessions`,"sessions.ex.list"),P(`${B} sessions --tool codex --here`,"sessions.ex.here"),P(`${B} sessions show 01a0f5fe`,"sessions.ex.show"),P(`${B} sessions resume 01a0f5fe --run`,"sessions.ex.resume"),P(`${B} sessions export 01a0f5fe 7c2e9d41 -o ./sessions`,"sessions.ex.export")]});const ce=C.command("lang").summary(N("lang.summary")).description(N("lang.description"));H(ce);const le=ce.command("show").description(N("lang.show")).action(async()=>{await u(["show"])}),pe=ce.command("set <locale>").description(N("lang.set")).action(async e=>{await u(["set",e])}),me=[P(`${B} lang show`,"lang.ex.show"),P(`${B} lang set en_US`,"lang.ex.set_en"),P(`${B} lang set zh_CN`,"lang.ex.set_zh")];p(ce,{...U("lang",[[`${B} enter lang`,"lang.alt.enter"]]),examples:me}),p(le,{examples:[me[0],P(`${B} lang show --json`,"lang.ex.show_json")]}),p(pe,{examples:me.slice(1)});const ue=C.command("completion").summary(N("completion.summary")).description(N("completion.description")).argument("<shell>",N("completion.arg.shell")).action(async e=>{await $([e])});p(ue,{...U("completion"),examples:[P(`${B} completion bash > ~/.${B}-completion.bash`,"completion.ex.bash"),P(`${B} completion zsh > ~/.${B}-completion.zsh`,"completion.ex.zsh"),P(`${B} completion fish > ~/.config/fish/completions/${B}.fish`,"completion.ex.fish")]});const de=C.command("enter").summary(N("enter.summary")).description(N("enter.description")).argument("[option]",N("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 g([e])}else await r.run()});p(de,{...U("enter",[[`${B}`,"enter.alt.menu"],[`${B} config <tool>`,"enter.alt.config"]]),sections:[{title:N("enter.options_title"),rows:[[N("enter.option.none_term"),N("enter.option.none")],["lang",N("enter.option.lang")],["apikey",N("enter.option.apikey")],["models",N("enter.option.models")],["<tool>",N("enter.option.tool")]]}],examples:[P(`${B} enter`,"enter.ex.menu"),P(`${B} enter models`,"enter.ex.models"),P(`${B} enter codex`,"enter.ex.tool")]}),H(C),C.action(async()=>{await r.run()}),p(C,{examples:[P(`${B}`,"root.ex.menu"),P(`${B} setup --key sk-xxx`,"root.ex.setup"),P(`${B} doctor`,"root.ex.doctor"),P(`${B} base auto`,"root.ex.base"),P(`${B} config codex`,"root.ex.config")]});const fe=e=>{for(const o of e.commands)o.helpOption("-h, --help",N("global.help")),fe(o)};return fe(C),C}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeapi/api-helper",
3
- "version": "0.0.131",
3
+ "version": "0.0.132",
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",