playbooks 0.1.7 → 0.1.8
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/index.js +31 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { program } from "commander";
|
|
|
8
8
|
// package.json
|
|
9
9
|
var package_default = {
|
|
10
10
|
name: "playbooks",
|
|
11
|
-
version: "0.1.
|
|
11
|
+
version: "0.1.8",
|
|
12
12
|
description: "Install agent skills, MCPs and docs into your coding agents from any git repository.",
|
|
13
13
|
type: "module",
|
|
14
14
|
bin: {
|
|
@@ -5283,6 +5283,36 @@ program.command("get <url> [outKeyword] [outPath]").description("Fetch a URL as
|
|
|
5283
5283
|
}
|
|
5284
5284
|
outputPath = outPath;
|
|
5285
5285
|
}
|
|
5286
|
+
const shouldUseTui = Boolean(process.stdout.isTTY) && !outputPath;
|
|
5287
|
+
if (!shouldUseTui) {
|
|
5288
|
+
try {
|
|
5289
|
+
const data = await fetchUrlMarkdown(url);
|
|
5290
|
+
if (outputPath) {
|
|
5291
|
+
if (options.json) {
|
|
5292
|
+
writeFileSync(outputPath, `${JSON.stringify(data, null, 2)}
|
|
5293
|
+
`, "utf8");
|
|
5294
|
+
return;
|
|
5295
|
+
}
|
|
5296
|
+
const body3 = data.markdown.endsWith("\n") ? data.markdown : `${data.markdown}
|
|
5297
|
+
`;
|
|
5298
|
+
writeFileSync(outputPath, body3, "utf8");
|
|
5299
|
+
return;
|
|
5300
|
+
}
|
|
5301
|
+
if (options.json) {
|
|
5302
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}
|
|
5303
|
+
`);
|
|
5304
|
+
return;
|
|
5305
|
+
}
|
|
5306
|
+
const body2 = data.markdown.endsWith("\n") ? data.markdown : `${data.markdown}
|
|
5307
|
+
`;
|
|
5308
|
+
process.stdout.write(body2);
|
|
5309
|
+
return;
|
|
5310
|
+
} catch (error) {
|
|
5311
|
+
const message = error instanceof Error ? error.message : "Failed to fetch markdown.";
|
|
5312
|
+
console.error(`Failed to fetch markdown: ${message}`);
|
|
5313
|
+
process.exit(1);
|
|
5314
|
+
}
|
|
5315
|
+
}
|
|
5286
5316
|
await runApp(
|
|
5287
5317
|
{ intent: "get-url", source: url, options: { json: options.json, output: outputPath } },
|
|
5288
5318
|
"get-url"
|