@askviraj/ai-plugins 1.0.0 → 1.0.1
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/bin/installer.js
CHANGED
|
@@ -290,14 +290,18 @@ class Installer extends Command {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
// Use `summary` (not `description`) so oclif prints this once at the top of
|
|
294
|
+
// --help; setting `description` would also render a duplicate DESCRIPTION block.
|
|
295
|
+
Installer.summary =
|
|
294
296
|
"Install Viraj Patel's Claude Code toolkit: marketplace plugins (via the `claude` CLI) and the powerline statusline. Checks required tools (brew/mise/claude/rtk/pnpm/…) first and prints install hints for any that are missing.";
|
|
295
297
|
|
|
298
|
+
// Users invoke this via pnpx (npx works too), never the bare `ai-plugins` bin,
|
|
299
|
+
// so spell the runnable command out rather than using <%= config.bin %>.
|
|
296
300
|
Installer.examples = [
|
|
297
|
-
"
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
301
|
+
"pnpx @askviraj/ai-plugins --all",
|
|
302
|
+
"pnpx @askviraj/ai-plugins --plugins",
|
|
303
|
+
"pnpx @askviraj/ai-plugins --plugin vwf --plugin dart-lsp",
|
|
304
|
+
"pnpx @askviraj/ai-plugins --statusline --subagentstatusline --yes",
|
|
301
305
|
];
|
|
302
306
|
|
|
303
307
|
Installer.flags = {
|
package/package.json
CHANGED
|
@@ -300,6 +300,20 @@ function gitDirtyMark(cwd) {
|
|
|
300
300
|
return "";
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
+
// Up-arrow marker when the branch is ahead of its upstream (local commits not
|
|
304
|
+
// pushed). Empty when in sync, when there is no upstream, or on any git error.
|
|
305
|
+
// One bounded git call (250ms).
|
|
306
|
+
function gitAheadMark(cwd) {
|
|
307
|
+
const { execFileSync } = require("child_process");
|
|
308
|
+
const opts = { cwd, encoding: "utf8", timeout: 250, stdio: ["ignore", "pipe", "ignore"] };
|
|
309
|
+
try {
|
|
310
|
+
const out = execFileSync("git", ["rev-list", "--count", "@{upstream}..HEAD"], opts).trim();
|
|
311
|
+
return parseInt(out, 10) > 0 ? SYM.ahead : "";
|
|
312
|
+
} catch (_) {
|
|
313
|
+
return "";
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
303
317
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
304
318
|
// Segment registry — each builder takes the resolved context `c` and returns the
|
|
305
319
|
// segment TEXT (a string), or null to omit (when its data is absent). All styling
|
|
@@ -323,6 +337,7 @@ const SEGMENTS = {
|
|
|
323
337
|
branch: (c) => {
|
|
324
338
|
if (!c.branch) return null;
|
|
325
339
|
let t = c.wt ? `${SYM.worktree} ${SYM.branch} ${c.branch}` : `${SYM.branch} ${c.branch}`;
|
|
340
|
+
if (c.ahead) t += ` ${c.ahead}`;
|
|
326
341
|
if (c.dirty) t += ` ${c.dirty}`;
|
|
327
342
|
return t;
|
|
328
343
|
},
|
|
@@ -384,6 +399,7 @@ function renderMain(d) {
|
|
|
384
399
|
projectSym: SYM.project,
|
|
385
400
|
wt: worktreeSubpath(cwd),
|
|
386
401
|
branch: git.branch,
|
|
402
|
+
ahead: git.branch ? gitAheadMark(cwd) : "",
|
|
387
403
|
dirty: git.branch ? gitDirtyMark(cwd) : "",
|
|
388
404
|
};
|
|
389
405
|
|