@vibeapi/cli 0.0.65 → 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.
|
@@ -2,19 +2,38 @@
|
|
|
2
2
|
* Anthropic's official Claude Code plugins vibecli installs for customers. A
|
|
3
3
|
* plugin listed in `enabledPlugins` is not installed by itself (nor with the
|
|
4
4
|
* marketplace declared in settings — checked on 2.1.295), so setup runs the CLI:
|
|
5
|
-
* `claude plugin marketplace add`
|
|
5
|
+
* `claude plugin marketplace add` then `claude plugin install`.
|
|
6
6
|
* Each plugin is offered once: one the user later uninstalls is not put back.
|
|
7
7
|
* context7 is left out (it calls its own servers).
|
|
8
8
|
*/
|
|
9
|
-
|
|
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
|
+
}];
|
|
10
25
|
export declare const OFFICIAL_PLUGINS: string[];
|
|
11
26
|
export interface PluginInstallResult {
|
|
12
27
|
installed: string[];
|
|
13
28
|
failed: string[];
|
|
14
|
-
/** Why nothing was attempted (
|
|
29
|
+
/** Why nothing was attempted (no source reachable, disabled); null otherwise. */
|
|
15
30
|
skipped: string | null;
|
|
31
|
+
/** Marketplace the plugins came from. */
|
|
32
|
+
source?: string;
|
|
16
33
|
}
|
|
17
34
|
/** Tests replace the CLI runner. */
|
|
18
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;
|
|
19
38
|
/** Install the official plugins not offered before, using `claude` at `claudePath`. */
|
|
20
39
|
export declare function installOfficialPlugins(claudePath: string): PluginInstallResult;
|
|
@@ -1 +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
|
|
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/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",
|