clikit-plugin 0.2.27 → 0.2.28
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/cli.js +27 -15
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -196,7 +196,7 @@ function writeConfig(configPath, config) {
|
|
|
196
196
|
fs.writeFileSync(tmpPath, content);
|
|
197
197
|
fs.renameSync(tmpPath, configPath);
|
|
198
198
|
}
|
|
199
|
-
async function install() {
|
|
199
|
+
async function install(options) {
|
|
200
200
|
console.log(`
|
|
201
201
|
CliKit Installer
|
|
202
202
|
================
|
|
@@ -232,22 +232,27 @@ async function install() {
|
|
|
232
232
|
console.error(`\u2717 Failed to update OpenCode config: ${err}`);
|
|
233
233
|
return 1;
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
if (options.includeProjectScaffold) {
|
|
236
|
+
console.log(`
|
|
236
237
|
[2/5] Scaffolding project .opencode assets...`);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
238
|
+
try {
|
|
239
|
+
const projectDir = resolveProjectDir();
|
|
240
|
+
const stats = scaffoldProjectOpencode(projectDir);
|
|
241
|
+
console.log(`\u2713 Project assets ready in ${path.join(projectDir, ".opencode")}`);
|
|
242
|
+
console.log(` Copied: ${stats.copied}, Skipped existing: ${stats.skipped}`);
|
|
243
|
+
if (stats.missingSources.length > 0) {
|
|
244
|
+
console.log(" Missing bundled sources (skipped):");
|
|
245
|
+
for (const missing of stats.missingSources) {
|
|
246
|
+
console.log(` - ${missing}`);
|
|
247
|
+
}
|
|
246
248
|
}
|
|
249
|
+
} catch (err) {
|
|
250
|
+
console.error(`\u2717 Failed to scaffold project assets: ${err}`);
|
|
251
|
+
return 1;
|
|
247
252
|
}
|
|
248
|
-
}
|
|
249
|
-
console.
|
|
250
|
-
|
|
253
|
+
} else {
|
|
254
|
+
console.log(`
|
|
255
|
+
[2/5] Skipping project scaffold (global-only install)`);
|
|
251
256
|
}
|
|
252
257
|
console.log(`
|
|
253
258
|
[3/5] Cleaning legacy local plugin assets...`);
|
|
@@ -313,8 +318,12 @@ Commands:
|
|
|
313
318
|
help Show this help message
|
|
314
319
|
version Show version
|
|
315
320
|
|
|
321
|
+
Install options:
|
|
322
|
+
--project Also scaffold project .opencode files (default: disabled)
|
|
323
|
+
|
|
316
324
|
Examples:
|
|
317
325
|
bun x clikit-plugin install
|
|
326
|
+
bun x clikit-plugin install --project
|
|
318
327
|
`);
|
|
319
328
|
}
|
|
320
329
|
function version() {
|
|
@@ -323,11 +332,14 @@ function version() {
|
|
|
323
332
|
async function main() {
|
|
324
333
|
const args = process.argv.slice(2);
|
|
325
334
|
const command = args[0] || "help";
|
|
335
|
+
const flags = args.slice(1);
|
|
326
336
|
let exitCode = 0;
|
|
327
337
|
switch (command) {
|
|
328
338
|
case "install":
|
|
329
339
|
case "i":
|
|
330
|
-
exitCode = await install(
|
|
340
|
+
exitCode = await install({
|
|
341
|
+
includeProjectScaffold: flags.includes("--project")
|
|
342
|
+
});
|
|
331
343
|
break;
|
|
332
344
|
case "help":
|
|
333
345
|
case "-h":
|