@vibeframe/cli 0.88.0 → 0.89.0
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 +178 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -62845,7 +62845,7 @@ init_source();
|
|
|
62845
62845
|
// package.json
|
|
62846
62846
|
var package_default = {
|
|
62847
62847
|
name: "@vibeframe/cli",
|
|
62848
|
-
version: "0.
|
|
62848
|
+
version: "0.89.0",
|
|
62849
62849
|
description: "VibeFrame CLI - natural language video editing from the terminal",
|
|
62850
62850
|
private: false,
|
|
62851
62851
|
license: "MIT",
|
|
@@ -70280,6 +70280,12 @@ async function showComplete(config2, defaultTryCommand, features = []) {
|
|
|
70280
70280
|
console.log(source_default.dim(" vibe doctor Check system health + available commands"));
|
|
70281
70281
|
console.log(source_default.dim(" vibe schema --list Discover every command"));
|
|
70282
70282
|
console.log(source_default.dim(" vibe setup Re-run user-scope setup anytime"));
|
|
70283
|
+
const shellHint = pickCompletionHint(process.env.SHELL);
|
|
70284
|
+
if (shellHint) {
|
|
70285
|
+
console.log();
|
|
70286
|
+
console.log(source_default.bold(" Tab completion:"));
|
|
70287
|
+
console.log(source_default.dim(` ${shellHint}`));
|
|
70288
|
+
}
|
|
70283
70289
|
const hosts = detectedAgentHosts();
|
|
70284
70290
|
const primary = hosts[0];
|
|
70285
70291
|
if (primary) {
|
|
@@ -70414,6 +70420,20 @@ async function showConfig(opts = { verbose: false }) {
|
|
|
70414
70420
|
console.log();
|
|
70415
70421
|
}
|
|
70416
70422
|
}
|
|
70423
|
+
function pickCompletionHint(shellPath) {
|
|
70424
|
+
if (!shellPath) return void 0;
|
|
70425
|
+
const shell = shellPath.split("/").pop() ?? "";
|
|
70426
|
+
if (shell.includes("zsh")) {
|
|
70427
|
+
return `echo 'eval "$(vibe completion zsh)"' >> ~/.zshrc`;
|
|
70428
|
+
}
|
|
70429
|
+
if (shell.includes("bash")) {
|
|
70430
|
+
return `echo 'eval "$(vibe completion bash)"' >> ~/.bashrc`;
|
|
70431
|
+
}
|
|
70432
|
+
if (shell.includes("fish")) {
|
|
70433
|
+
return `vibe completion fish > ~/.config/fish/completions/vibe.fish`;
|
|
70434
|
+
}
|
|
70435
|
+
return void 0;
|
|
70436
|
+
}
|
|
70417
70437
|
|
|
70418
70438
|
// src/commands/init.ts
|
|
70419
70439
|
init_esm();
|
|
@@ -73146,6 +73166,162 @@ var walkthroughCommand = new Command("walkthrough").description("Step-by-step au
|
|
|
73146
73166
|
console.log();
|
|
73147
73167
|
});
|
|
73148
73168
|
|
|
73169
|
+
// src/commands/completion.ts
|
|
73170
|
+
init_esm();
|
|
73171
|
+
init_output();
|
|
73172
|
+
init_cost_tier();
|
|
73173
|
+
var completionCommand = new Command("completion").description("Print a shell completion script for `vibe`").argument("<shell>", "Target shell: zsh | bash | fish").addHelpText(
|
|
73174
|
+
"after",
|
|
73175
|
+
`
|
|
73176
|
+
Examples:
|
|
73177
|
+
$ vibe completion zsh >> ~/.zsh/completions/_vibe # then ensure that dir is in fpath
|
|
73178
|
+
$ echo 'eval "$(vibe completion bash)"' >> ~/.bashrc
|
|
73179
|
+
$ vibe completion fish > ~/.config/fish/completions/vibe.fish
|
|
73180
|
+
|
|
73181
|
+
The output is generated from the live command tree, so it stays in
|
|
73182
|
+
sync with the CLI surface. Re-run after upgrades.
|
|
73183
|
+
`
|
|
73184
|
+
).action((shell) => {
|
|
73185
|
+
const program3 = completionCommand.parent;
|
|
73186
|
+
if (!program3) {
|
|
73187
|
+
exitWithError(usageError("completion: program tree not available"));
|
|
73188
|
+
}
|
|
73189
|
+
const valid = /* @__PURE__ */ new Set(["zsh", "bash", "fish"]);
|
|
73190
|
+
if (!valid.has(shell)) {
|
|
73191
|
+
exitWithError(usageError(`Unknown shell: ${shell}`, "Supported: zsh, bash, fish"));
|
|
73192
|
+
}
|
|
73193
|
+
if (shell === "zsh") console.log(generateZsh(program3));
|
|
73194
|
+
else if (shell === "bash") console.log(generateBash(program3));
|
|
73195
|
+
else console.log(generateFish(program3));
|
|
73196
|
+
});
|
|
73197
|
+
function collectCommandTree(program3) {
|
|
73198
|
+
const skipTopLevel = /* @__PURE__ */ new Set(["help"]);
|
|
73199
|
+
const nodes = [];
|
|
73200
|
+
for (const top of program3.commands) {
|
|
73201
|
+
const name = top.name();
|
|
73202
|
+
if (skipTopLevel.has(name)) continue;
|
|
73203
|
+
const desc = top.description() || "";
|
|
73204
|
+
if (desc.toLowerCase().includes("deprecated")) continue;
|
|
73205
|
+
const subs = top.commands.filter((s) => !(s.description() || "").toLowerCase().includes("deprecated")).map((s) => ({
|
|
73206
|
+
name: s.name(),
|
|
73207
|
+
description: s.description() || "",
|
|
73208
|
+
cost: getCostTier(s)
|
|
73209
|
+
}));
|
|
73210
|
+
nodes.push({ name, description: desc, cost: getCostTier(top), subcommands: subs });
|
|
73211
|
+
}
|
|
73212
|
+
return nodes;
|
|
73213
|
+
}
|
|
73214
|
+
function tierBadge(cost) {
|
|
73215
|
+
if (!cost) return "";
|
|
73216
|
+
return `[${cost.toUpperCase()}] `;
|
|
73217
|
+
}
|
|
73218
|
+
function shellEscape(s) {
|
|
73219
|
+
return s.replace(/\n/g, " ").replace(/\s+/g, " ").trim().replace(/'/g, `'"'"'`);
|
|
73220
|
+
}
|
|
73221
|
+
function generateZsh(program3) {
|
|
73222
|
+
const nodes = collectCommandTree(program3);
|
|
73223
|
+
const topLines = nodes.map((n) => `'${n.name}:${shellEscape(tierBadge(n.cost) + n.description)}'`).join(" \\\n ");
|
|
73224
|
+
const subBlocks = nodes.filter((n) => n.subcommands.length > 0).map((n) => {
|
|
73225
|
+
const subs = n.subcommands.map((s) => `'${s.name}:${shellEscape(tierBadge(s.cost) + s.description)}'`).join(" \\\n ");
|
|
73226
|
+
return ` ${n.name})
|
|
73227
|
+
local -a subcommands
|
|
73228
|
+
subcommands=(
|
|
73229
|
+
${subs}
|
|
73230
|
+
)
|
|
73231
|
+
_describe 'subcommand' subcommands
|
|
73232
|
+
;;`;
|
|
73233
|
+
}).join("\n");
|
|
73234
|
+
return `#compdef vibe
|
|
73235
|
+
# vibe shell completion for zsh \u2014 generated by \`vibe completion zsh\`.
|
|
73236
|
+
# Re-run after upgrades; the script reflects the live command tree.
|
|
73237
|
+
|
|
73238
|
+
_vibe() {
|
|
73239
|
+
local -a commands
|
|
73240
|
+
commands=(
|
|
73241
|
+
${topLines}
|
|
73242
|
+
)
|
|
73243
|
+
|
|
73244
|
+
_arguments -C \\
|
|
73245
|
+
'1: :->cmd' \\
|
|
73246
|
+
'*:: :->args'
|
|
73247
|
+
|
|
73248
|
+
case $state in
|
|
73249
|
+
cmd)
|
|
73250
|
+
_describe 'command' commands
|
|
73251
|
+
;;
|
|
73252
|
+
args)
|
|
73253
|
+
case $words[1] in
|
|
73254
|
+
${subBlocks}
|
|
73255
|
+
esac
|
|
73256
|
+
;;
|
|
73257
|
+
esac
|
|
73258
|
+
}
|
|
73259
|
+
|
|
73260
|
+
_vibe "$@"
|
|
73261
|
+
`;
|
|
73262
|
+
}
|
|
73263
|
+
function generateBash(program3) {
|
|
73264
|
+
const nodes = collectCommandTree(program3);
|
|
73265
|
+
const topNames = nodes.map((n) => n.name).join(" ");
|
|
73266
|
+
const subCases = nodes.filter((n) => n.subcommands.length > 0).map((n) => {
|
|
73267
|
+
const names = n.subcommands.map((s) => s.name).join(" ");
|
|
73268
|
+
return ` ${n.name})
|
|
73269
|
+
COMPREPLY=( $(compgen -W "${names}" -- "$cur") )
|
|
73270
|
+
;;`;
|
|
73271
|
+
}).join("\n");
|
|
73272
|
+
return `# vibe shell completion for bash \u2014 generated by \`vibe completion bash\`.
|
|
73273
|
+
# Re-run after upgrades; the script reflects the live command tree.
|
|
73274
|
+
# Bash completions are word-only \u2014 no description hints \u2014 so consider
|
|
73275
|
+
# zsh or fish for richer feedback.
|
|
73276
|
+
|
|
73277
|
+
_vibe_complete() {
|
|
73278
|
+
local cur prev cmd
|
|
73279
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
73280
|
+
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
73281
|
+
cmd="\${COMP_WORDS[1]}"
|
|
73282
|
+
|
|
73283
|
+
if [[ $COMP_CWORD == 1 ]]; then
|
|
73284
|
+
COMPREPLY=( $(compgen -W "${topNames}" -- "$cur") )
|
|
73285
|
+
return 0
|
|
73286
|
+
fi
|
|
73287
|
+
|
|
73288
|
+
case "$cmd" in
|
|
73289
|
+
${subCases}
|
|
73290
|
+
*)
|
|
73291
|
+
COMPREPLY=()
|
|
73292
|
+
;;
|
|
73293
|
+
esac
|
|
73294
|
+
}
|
|
73295
|
+
|
|
73296
|
+
complete -F _vibe_complete vibe
|
|
73297
|
+
`;
|
|
73298
|
+
}
|
|
73299
|
+
function generateFish(program3) {
|
|
73300
|
+
const nodes = collectCommandTree(program3);
|
|
73301
|
+
const lines = [
|
|
73302
|
+
"# vibe shell completion for fish \u2014 generated by `vibe completion fish`.",
|
|
73303
|
+
"# Re-run after upgrades; the script reflects the live command tree.",
|
|
73304
|
+
"",
|
|
73305
|
+
"complete -c vibe -f",
|
|
73306
|
+
""
|
|
73307
|
+
];
|
|
73308
|
+
for (const n of nodes) {
|
|
73309
|
+
const desc = shellEscape(tierBadge(n.cost) + n.description);
|
|
73310
|
+
lines.push(`complete -c vibe -n '__fish_use_subcommand' -a '${n.name}' -d '${desc}'`);
|
|
73311
|
+
}
|
|
73312
|
+
lines.push("");
|
|
73313
|
+
for (const n of nodes) {
|
|
73314
|
+
if (n.subcommands.length === 0) continue;
|
|
73315
|
+
for (const s of n.subcommands) {
|
|
73316
|
+
const desc = shellEscape(tierBadge(s.cost) + s.description);
|
|
73317
|
+
lines.push(
|
|
73318
|
+
`complete -c vibe -n '__fish_seen_subcommand_from ${n.name}' -a '${s.name}' -d '${desc}'`
|
|
73319
|
+
);
|
|
73320
|
+
}
|
|
73321
|
+
}
|
|
73322
|
+
return lines.join("\n") + "\n";
|
|
73323
|
+
}
|
|
73324
|
+
|
|
73149
73325
|
// src/index.ts
|
|
73150
73326
|
init_api_key();
|
|
73151
73327
|
|
|
@@ -73372,6 +73548,7 @@ program2.addCommand(batchCommand);
|
|
|
73372
73548
|
program2.addCommand(schemaCommand);
|
|
73373
73549
|
program2.addCommand(contextCommand);
|
|
73374
73550
|
program2.addCommand(walkthroughCommand);
|
|
73551
|
+
program2.addCommand(completionCommand);
|
|
73375
73552
|
program2.addCommand(mediaCommand, { hidden: true });
|
|
73376
73553
|
function propagateErrorHandling(cmd) {
|
|
73377
73554
|
for (const sub of cmd.commands) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeframe/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"description": "VibeFrame CLI - natural language video editing from the terminal",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -183,8 +183,8 @@
|
|
|
183
183
|
"tsx": "^4.21.0",
|
|
184
184
|
"typescript": "^5.3.3",
|
|
185
185
|
"vitest": "^1.2.2",
|
|
186
|
-
"@vibeframe/ai-providers": "0.
|
|
187
|
-
"@vibeframe/core": "0.
|
|
186
|
+
"@vibeframe/ai-providers": "0.89.0",
|
|
187
|
+
"@vibeframe/core": "0.89.0"
|
|
188
188
|
},
|
|
189
189
|
"engines": {
|
|
190
190
|
"node": ">=20"
|