@vibeapi/cli 0.0.64 → 0.0.66
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/dist/lib/tools/claude-code.js +1 -1
- package/dist/lib/tools/claude-plugins.d.ts +39 -0
- package/dist/lib/tools/claude-plugins.js +1 -0
- package/dist/locales/en_US.json +3 -1
- package/dist/locales/zh_CN.json +3 -1
- package/dist/settings-template.json +3 -1
- package/package.json +1 -1
- package/settings-template.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e}from"path";import{applyGatewayModels as t,claudeCodeManager as o}from"../claude-code-manager.js";import{backupBeforeWrite as a}from"./backup.js";import{i18n as n}from"../i18n.js";import{baseModelId as s}from"../model-catalog.js";import{gatewayModelSpecs as i,prettyModelName as
|
|
1
|
+
import{join as e}from"path";import{applyGatewayModels as t,claudeCodeManager as o}from"../claude-code-manager.js";import{backupBeforeWrite as a}from"./backup.js";import{i18n as n}from"../i18n.js";import{baseModelId as s}from"../model-catalog.js";import{gatewayModelSpecs as i,prettyModelName as l,vendorNames as d}from"../gateway-models.js";import{toolHome as r}from"./types.js";import{spawnSync as c}from"child_process";import{readFileSync as u}from"fs";import{detectManagedOverrides as m}from"./claude-managed.js";import{installOfficialPlugins as p}from"./claude-plugins.js";import{findInstalls as g}from"./tool-installs.js";import{updateNativeFromMirror as f}from"./claude-native-mirror.js";const h=e(r(),".claude","settings.json"),C=e(r(),".claude.json");let _,k=null;function j(){try{const t=JSON.parse(u(e(r(),".claude","settings.json"),"utf-8"));return"string"==typeof t.autoUpdatesChannel?t.autoUpdatesChannel:"latest"}catch{return"latest"}}function y(e){if(!e)return;const t=new Set(e.models);return i("claude-code",e.clientModels).filter(e=>t.has(e.id))}export const claudeCodeAdapter={name:"claude-code",displayName:"Claude Code",command:"claude",installCommand:"npm install -g @anthropic-ai/claude-code",upgradeCommand:"claude update",installSpec:{command:"claude",npmPackage:"@anthropic-ai/claude-code",native:{binDir:[".local","bin"],updateArgs:["update"],dataDirs:[[".local","share","claude"]],mirrorUpdate:()=>f(j())},brew:"claude-code"},upgradeHints:e=>"stable"===j()?[n.t("tools.claude_code.stable_channel",{min:e})]:[],configPath:h,wantsModelCatalog:!0,loadPrivateConfig(e){a(h),a(C),_=y(e.catalog),o.loadPrivateConfig(e.apiKey,e.models,e.catalog?.models,_);const t=g(claudeCodeAdapter.installSpec)[0];k=t?p(t.path):null},unloadPrivateConfig(){a(h),o.unloadPrivateConfig()},detectCurrentConfig:()=>o.detectCurrentConfig(),getConfig:()=>({settings:o.getSettings(),mcp:o.getMCPConfig()}),updateConfig(e){const t=e||{};t.settings&&o.saveSettings(t.settings),t.mcp&&o.saveMCPConfig(t.mcp)},clearPinnedModels:e=>(a(h),o.clearPinnedModels(e?.models)),listedModels(){const e=o.getSettings().modelPicker;return Array.isArray(e?.options)?e.options.map(e=>s(String(e.model))):null},refreshModelMenu(e){const n=o.getSettings(),s=t(n,y(e.catalog));JSON.stringify(s)!==JSON.stringify(n)&&(a(h),o.saveSettings(s))},applyNotes(){const e=[];k?.installed.length&&(e.push({kind:"summary",text:n.t("tools.claude_code.plugins_installed",{count:String(k.installed.length)})}),e.push({kind:"detail",text:k.installed.join(", ")})),("marketplace"===k?.skipped||k?.failed.length)&&e.push({kind:"action",text:n.t("tools.claude_code.plugins_failed")}),_&&_.length>0&&(e.push({kind:"summary",text:n.t("tools.claude_code.gateway_models",{count:String(_.length),vendors:d(_.map(e=>e.id)).join(" / ")})}),e.push({kind:"detail",text:_.map(e=>e.name||l(e.id)).join(", ")})),"win32"!==process.platform||process.env.CLAUDE_CODE_GIT_BASH_PATH||0===c("where",["git"],{windowsHide:!0,stdio:"ignore"}).status||e.push({kind:"action",text:n.t("tools.claude_code.no_git_bash")});for(const t of m())e.push({kind:"action",text:n.t("tools.claude_code.managed_override",{source:t.source,keys:t.keys.join(", ")})});for(const t of o.getLastTierFallbacks())e.push({kind:"detail",text:n.t("tools.claude_code.tier_fallback",{tier:t.tier,from:t.from,to:t.to})});return e},backupPaths:()=>[h,C],forceResetPaths:()=>[h]};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic's official Claude Code plugins vibecli installs for customers. A
|
|
3
|
+
* plugin listed in `enabledPlugins` is not installed by itself (nor with the
|
|
4
|
+
* marketplace declared in settings — checked on 2.1.295), so setup runs the CLI:
|
|
5
|
+
* `claude plugin marketplace add` then `claude plugin install`.
|
|
6
|
+
* Each plugin is offered once: one the user later uninstalls is not put back.
|
|
7
|
+
* context7 is left out (it calls its own servers).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Where the plugins come from, probed in this order before anything is added: the
|
|
11
|
+
* daily CNB copy (reachable in and outside mainland China; open-source third-party
|
|
12
|
+
* plugins vendored on CNB too, sla/claude-plugins-vendor), else Anthropic's GitHub
|
|
13
|
+
* repo. The copy is named `vibeapi-plugins` because Claude Code reserves
|
|
14
|
+
* `claude-plugins-official` for github.com/anthropics/; plugin names are the same.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PLUGIN_SOURCES: readonly [{
|
|
17
|
+
readonly name: "vibeapi-plugins";
|
|
18
|
+
readonly add: "https://cnb.cool/sla/claude-plugins-official.git";
|
|
19
|
+
readonly probe: "https://cnb.cool/sla/claude-plugins-official.git";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "claude-plugins-official";
|
|
22
|
+
readonly add: "anthropics/claude-plugins-official";
|
|
23
|
+
readonly probe: "https://github.com/anthropics/claude-plugins-official.git";
|
|
24
|
+
}];
|
|
25
|
+
export declare const OFFICIAL_PLUGINS: string[];
|
|
26
|
+
export interface PluginInstallResult {
|
|
27
|
+
installed: string[];
|
|
28
|
+
failed: string[];
|
|
29
|
+
/** Why nothing was attempted (no source reachable, disabled); null otherwise. */
|
|
30
|
+
skipped: string | null;
|
|
31
|
+
/** Marketplace the plugins came from. */
|
|
32
|
+
source?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Tests replace the CLI runner. */
|
|
35
|
+
export declare function setClaudePluginRunnerForTests(fake: (claude: string, args: string[]) => boolean): void;
|
|
36
|
+
/** Tests replace the reachability probe. */
|
|
37
|
+
export declare function setPluginSourceProbeForTests(fake: (url: string) => boolean): void;
|
|
38
|
+
/** Install the official plugins not offered before, using `claude` at `claudePath`. */
|
|
39
|
+
export declare function installOfficialPlugins(claudePath: string): PluginInstallResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{spawnSync as e}from"child_process";import{readFileSync as t}from"fs";import{join as i}from"path";import{logger as o}from"../../utils/logger.js";import{configManager as s}from"../config.js";import{toolHome as n}from"./types.js";export const PLUGIN_SOURCES=[{name:"vibeapi-plugins",add:"https://cnb.cool/sla/claude-plugins-official.git",probe:"https://cnb.cool/sla/claude-plugins-official.git"},{name:"claude-plugins-official",add:"anthropics/claude-plugins-official",probe:"https://github.com/anthropics/claude-plugins-official.git"}];export const OFFICIAL_PLUGINS=["code-review","feature-dev","frontend-design","pr-review-toolkit","commit-commands","security-guidance","code-simplifier","skill-creator","claude-md-management","claude-code-setup"];const l="official_plugins_offered";let r=(t,i)=>{const s=e(t,i,{encoding:"utf-8",timeout:12e4,windowsHide:!0,stdio:["ignore","pipe","pipe"],shell:"win32"===process.platform&&/\.cmd$/i.test(t)});return 0!==s.status&&o.logError(`claude ${i.join(" ")}`,new Error(`${s.stderr??""}${s.stdout??""}`.trim())),0===s.status},a=t=>0===e("git",["ls-remote","--heads",t],{timeout:8e3,windowsHide:!0,stdio:"ignore"}).status;export function setClaudePluginRunnerForTests(e){r=e}export function setPluginSourceProbeForTests(e){a=e}export function installOfficialPlugins(e){if("1"===process.env.VIBECLI_SKIP_CLAUDE_PLUGINS)return{installed:[],failed:[],skipped:"disabled"};const o=s.getToolSetting("claude-code",l),d=new Set("string"==typeof o?o.split(",").filter(Boolean):[]),c=function(){try{const e=JSON.parse(t(i(n(),".claude","plugins","installed_plugins.json"),"utf-8"));return new Set(Object.keys(e.plugins??{}))}catch{return new Set}}(),p=e=>PLUGIN_SOURCES.some(t=>c.has(`${e}@${t.name}`)),u=OFFICIAL_PLUGINS.filter(e=>!d.has(e)&&!p(e));if(0===u.length)return{installed:[],failed:[],skipped:null};const f=PLUGIN_SOURCES.find(e=>a(e.probe));if(!f)return{installed:[],failed:[],skipped:"marketplace"};r(e,["plugin","marketplace","add",f.add]);const g={installed:[],failed:[],skipped:null,source:f.name};for(const t of u)r(e,["plugin","install",`${t}@${f.name}`])?(g.installed.push(t),d.add(t)):g.failed.push(t);for(const e of OFFICIAL_PLUGINS)p(e)&&d.add(e);return s.setToolSetting("claude-code",l,[...d].join(",")),g}
|
package/dist/locales/en_US.json
CHANGED
|
@@ -393,7 +393,9 @@
|
|
|
393
393
|
"tier_fallback": "This key can't use Claude Code's default {{from}}; the {{tier}} alias now uses {{to}}",
|
|
394
394
|
"stable_channel": "Your update channel in settings.json is stable, which may not have reached {{min}} yet; set autoUpdatesChannel to latest, then upgrade",
|
|
395
395
|
"managed_override": "Claude Code managed settings found ({{source}}); {{keys}} there override what vibecli writes, so this config won't take effect. Managed settings usually come from your company's IT; ask your administrator",
|
|
396
|
-
"no_git_bash": "Git for Windows not found: Claude Code falls back to PowerShell for commands, which works, but bash commands and scripts won't; install Git (winget install Git.Git, or download from https://registry.npmmirror.com/binary.html?path=git-for-windows/)"
|
|
396
|
+
"no_git_bash": "Git for Windows not found: Claude Code falls back to PowerShell for commands, which works, but bash commands and scripts won't; install Git (winget install Git.Git, or download from https://registry.npmmirror.com/binary.html?path=git-for-windows/)",
|
|
397
|
+
"plugins_installed": "{{count}} official plugins installed (code review, feature dev, frontend design, …); type / to see them",
|
|
398
|
+
"plugins_failed": "Official plugins could not be installed (GitHub unreachable, most likely); everything else works. Run vibecli setup again later"
|
|
397
399
|
},
|
|
398
400
|
"model_family": {
|
|
399
401
|
"gpt": "GPT",
|
package/dist/locales/zh_CN.json
CHANGED
|
@@ -393,7 +393,9 @@
|
|
|
393
393
|
"tier_fallback": "当前 Key 用不了 Claude Code 默认的 {{from}},{{tier}} 档已改用 {{to}}",
|
|
394
394
|
"stable_channel": "settings.json 里的更新渠道是 stable,这个渠道可能还没到 {{min}};把 autoUpdatesChannel 改成 latest 后再升级",
|
|
395
395
|
"managed_override": "检测到 Claude Code 的托管配置({{source}}),其中 {{keys}} 优先于 vibecli 写入的设置,会让这里的配置不生效;托管配置一般是公司电脑统一下发的,请联系管理员",
|
|
396
|
-
"no_git_bash": "没找到 Git for Windows:Claude Code 会改用 PowerShell 执行命令,可以用,但 bash 写法的命令和脚本跑不了;建议安装 Git(winget install Git.Git,或从国内镜像 https://registry.npmmirror.com/binary.html?path=git-for-windows/ 下载)"
|
|
396
|
+
"no_git_bash": "没找到 Git for Windows:Claude Code 会改用 PowerShell 执行命令,可以用,但 bash 写法的命令和脚本跑不了;建议安装 Git(winget install Git.Git,或从国内镜像 https://registry.npmmirror.com/binary.html?path=git-for-windows/ 下载)",
|
|
397
|
+
"plugins_installed": "装好 {{count}} 个官方插件(代码审查、功能开发、前端设计等),输入 / 可以看到",
|
|
398
|
+
"plugins_failed": "官方插件没装上(多半是连不上 GitHub),不影响使用;网络好时再运行一次 vibecli setup 即可"
|
|
397
399
|
},
|
|
398
400
|
"model_family": {
|
|
399
401
|
"gpt": "GPT",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeapi/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.66",
|
|
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",
|