@darkrymit/crunes-cli 0.14.6 → 0.14.7
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/chunks/{add-JDQQMOP6.js → add-3WHB7E2E.js} +1 -1
- package/dist/chunks/{browse-W6ZG3CNL.js → browse-KZX2WWRU.js} +1 -1
- package/dist/chunks/{chunk-KS53HK36.js → chunk-T5JE4MJ6.js} +18 -2
- package/dist/chunks/{install-UYI2HQKP.js → install-O5FXM7BG.js} +1 -1
- package/dist/chunks/{list-XYDDJWKA.js → list-ZZ64OKJN.js} +1 -1
- package/dist/chunks/{remove-7FTCTJDX.js → remove-UBYCW2VY.js} +1 -1
- package/dist/chunks/{search-X7GVCIU2.js → search-FGHMHNJB.js} +1 -1
- package/dist/chunks/{update-JZRVEWSG.js → update-MONTHEOU.js} +1 -1
- package/dist/chunks/{update-CCJORRW2.js → update-RHZG6TU2.js} +1 -1
- package/dist/chunks/{version-SPOELOAS.js → version-Q2RW5XXT.js} +1 -1
- package/dist/cli.js +10 -10
- package/package.json +1 -1
|
@@ -52,12 +52,28 @@ function classifyMarketplaceSource(source) {
|
|
|
52
52
|
function isLocalPath(source) {
|
|
53
53
|
return source.startsWith(".") || source.startsWith("/") || source.startsWith("~") || /^[A-Za-z]:[/\\]/.test(source);
|
|
54
54
|
}
|
|
55
|
+
async function fetchMarketplaceViaGit(gitUrl) {
|
|
56
|
+
const tmp = path.join(os.tmpdir(), `crunes-marketplace-git-${Date.now()}`);
|
|
57
|
+
try {
|
|
58
|
+
await execFileAsync("git", ["clone", "--depth=1", "--filter=blob:none", "--sparse", gitUrl, tmp]);
|
|
59
|
+
await execFileAsync("git", ["-C", tmp, "sparse-checkout", "set", ".crunes-plugin"]);
|
|
60
|
+
const raw = await fs.readFile(path.join(tmp, ".crunes-plugin", "marketplace.json"), "utf8");
|
|
61
|
+
return JSON.parse(raw);
|
|
62
|
+
} finally {
|
|
63
|
+
await fs.rm(tmp, { recursive: true, force: true }).catch(() => {
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
55
67
|
async function downloadMarketplaceJson(classified) {
|
|
56
68
|
if (classified.type === "github") {
|
|
57
69
|
const url = `https://raw.githubusercontent.com/${classified.resolved}/HEAD/.crunes-plugin/marketplace.json`;
|
|
58
70
|
const res = await fetch(url, { headers: { "User-Agent": "crunes-cli" } });
|
|
59
|
-
if (
|
|
60
|
-
|
|
71
|
+
if (res.ok) return res.json();
|
|
72
|
+
try {
|
|
73
|
+
return await fetchMarketplaceViaGit(`https://github.com/${classified.resolved}.git`);
|
|
74
|
+
} catch {
|
|
75
|
+
throw new Error(`Failed to fetch marketplace from GitHub (${classified.resolved}): HTTP ${res.status}`);
|
|
76
|
+
}
|
|
61
77
|
}
|
|
62
78
|
if (classified.type === "http") {
|
|
63
79
|
const res = await fetch(classified.resolved, { headers: { "User-Agent": "crunes-cli" } });
|
package/dist/cli.js
CHANGED
|
@@ -3397,7 +3397,7 @@ var program = new Command();
|
|
|
3397
3397
|
// src/cli/program.js
|
|
3398
3398
|
function buildProgram() {
|
|
3399
3399
|
const program3 = new Command();
|
|
3400
|
-
program3.name("crunes").description("CLI tool for managing context runes").version("0.14.
|
|
3400
|
+
program3.name("crunes").description("CLI tool for managing context runes").version("0.14.7", "-v, --version").enablePositionalOptions().option("-y, --yes", "assume yes to all prompts and skip interactive mode (also auto-detected in non-TTY environments)").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").option("--cwd <path>", "project root to use instead of the current working directory").option("--ccd <path>", "config directory \u2014 where .crunes/config.json and local rune files live (default: --cwd)").option("--verbose", "print full error stack traces and other verbose output");
|
|
3401
3401
|
program3.hook("preAction", (_thisCommand, actionCommand) => {
|
|
3402
3402
|
const opts = { ...program3.opts(), ...actionCommand.opts() };
|
|
3403
3403
|
configure({ plain: !!opts.plain, verbose: !!opts.verbose });
|
|
@@ -3482,7 +3482,7 @@ function buildProgram() {
|
|
|
3482
3482
|
await handler();
|
|
3483
3483
|
});
|
|
3484
3484
|
program3.command("version").description("Print the installed version and check for updates").option("--no-check", "skip the npm update check").action(async (opts) => {
|
|
3485
|
-
const { handler } = await import("./chunks/version-
|
|
3485
|
+
const { handler } = await import("./chunks/version-Q2RW5XXT.js");
|
|
3486
3486
|
await handler({ check: opts.check, plain: !!program3.opts().plain });
|
|
3487
3487
|
});
|
|
3488
3488
|
program3.command("doctor").description("Verify environment and project setup").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").action(async () => {
|
|
@@ -3573,7 +3573,7 @@ function buildProgram() {
|
|
|
3573
3573
|
});
|
|
3574
3574
|
const plugin = program3.command("plugin").description("Manage rune plugins");
|
|
3575
3575
|
plugin.command("install <source>").description("Install a plugin from a configured marketplace in the format <marketplace>@<plugin>").option("-g, --global", "enable in the global config (~/.crunes/config.json) instead of the project").action(async (source, opts) => {
|
|
3576
|
-
const { handler } = await import("./chunks/install-
|
|
3576
|
+
const { handler } = await import("./chunks/install-O5FXM7BG.js");
|
|
3577
3577
|
await handler({ source, projectRoot: projectRoot(), configRoot: configRoot(), yes: !!program3.opts().yes, global: !!opts.global });
|
|
3578
3578
|
});
|
|
3579
3579
|
plugin.command("uninstall <plugin>").description("Uninstall an installed plugin").option("-g, --global", "also drop the plugin from the global config (~/.crunes/config.json)").action(async (name, opts) => {
|
|
@@ -3585,7 +3585,7 @@ function buildProgram() {
|
|
|
3585
3585
|
await handler({ format: opts.format, projectRoot: projectRoot() });
|
|
3586
3586
|
});
|
|
3587
3587
|
plugin.command("update [plugin]").description("Update one or all installed plugins").action(async (name) => {
|
|
3588
|
-
const { handler } = await import("./chunks/update-
|
|
3588
|
+
const { handler } = await import("./chunks/update-MONTHEOU.js");
|
|
3589
3589
|
await handler({ name, projectRoot: projectRoot(), configRoot: configRoot() });
|
|
3590
3590
|
});
|
|
3591
3591
|
plugin.command("trust <plugin> [rune]").description("Review a plugin's native runes \u2014 scripts that run outside the sandbox \u2014 and trust them to run").action(async (name, rune) => {
|
|
@@ -3622,27 +3622,27 @@ function buildProgram() {
|
|
|
3622
3622
|
});
|
|
3623
3623
|
const marketplace = program3.command("marketplace").description("Manage plugin marketplace sources");
|
|
3624
3624
|
marketplace.command("add <url>").description("Add a marketplace source URL").action(async (url) => {
|
|
3625
|
-
const { handler } = await import("./chunks/add-
|
|
3625
|
+
const { handler } = await import("./chunks/add-3WHB7E2E.js");
|
|
3626
3626
|
await handler({ url });
|
|
3627
3627
|
});
|
|
3628
3628
|
marketplace.command("remove <url>").description("Remove a marketplace, given its name or source URL").action(async (url) => {
|
|
3629
|
-
const { handler } = await import("./chunks/remove-
|
|
3629
|
+
const { handler } = await import("./chunks/remove-UBYCW2VY.js");
|
|
3630
3630
|
await handler({ url });
|
|
3631
3631
|
});
|
|
3632
3632
|
marketplace.command("list").description("List configured marketplace sources").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").action(async () => {
|
|
3633
|
-
const { handler } = await import("./chunks/list-
|
|
3633
|
+
const { handler } = await import("./chunks/list-ZZ64OKJN.js");
|
|
3634
3634
|
await handler();
|
|
3635
3635
|
});
|
|
3636
3636
|
marketplace.command("search <query>").description("Search for plugins across configured marketplace sources").action(async (query) => {
|
|
3637
|
-
const { handler } = await import("./chunks/search-
|
|
3637
|
+
const { handler } = await import("./chunks/search-FGHMHNJB.js");
|
|
3638
3638
|
await handler({ query });
|
|
3639
3639
|
});
|
|
3640
3640
|
marketplace.command("update [url]").description("Refresh cached marketplace data, given a name or source URL (all marketplaces if none given)").action(async (url) => {
|
|
3641
|
-
const { handler } = await import("./chunks/update-
|
|
3641
|
+
const { handler } = await import("./chunks/update-RHZG6TU2.js");
|
|
3642
3642
|
await handler({ url });
|
|
3643
3643
|
});
|
|
3644
3644
|
marketplace.command("browse").description("List all plugins from all configured marketplace sources").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
|
|
3645
|
-
const { handler } = await import("./chunks/browse-
|
|
3645
|
+
const { handler } = await import("./chunks/browse-KZX2WWRU.js");
|
|
3646
3646
|
await handler({ format: opts.format });
|
|
3647
3647
|
});
|
|
3648
3648
|
const completions = program3.command("completions").description("Manage shell tab-completions");
|