@vibiz/cli 0.3.14 → 0.3.16

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/vibiz.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  formatUsd,
12
12
  mergeEnvFile,
13
13
  oneKeyMessage
14
- } from "./chunk-PU7FGYLR.js";
14
+ } from "./chunk-4M6B5ZSL.js";
15
15
 
16
16
  // packages/cli/src/main.ts
17
17
  import { spawn } from "node:child_process";
@@ -3247,6 +3247,10 @@ var HELP = `vibiz \u2014 website, database and sign-in for a new business, in on
3247
3247
  itself. --elsewhere: the app runs on another host
3248
3248
  vibiz domains verify <domain> check its DNS (and its TXT proof) again now
3249
3249
  vibiz domains remove <domain> disconnect it (full-access keys)
3250
+ vibiz domains redirect <from> <to|none> [--project <id|slug>]
3251
+ moving to a new domain: every URL on <from> answers a
3252
+ permanent redirect to the same path on <to> (add <to>,
3253
+ wait until it's live first); none stops it (full-access keys)
3250
3254
  vibiz domains search <name> find a domain to buy, with prices (sellshelf, sellshelf.app)
3251
3255
  vibiz domains buy <domain> [--years 1] [--yes]
3252
3256
  buy it from your credits for this project (full-access keys,
@@ -3591,8 +3595,9 @@ var HELP = `vibiz \u2014 website, database and sign-in for a new business, in on
3591
3595
  vibiz files get <id> [--json] one file: its link, size, and the prompt if AI made it
3592
3596
  vibiz files download <id> [-o path] save its bytes here (private files too)
3593
3597
  vibiz files rm <id> delete it: its link stops working
3594
- vibiz image "<prompt>" -o out.png [--size 1024x1024] [--model m] generate an image
3595
- vibiz video "<prompt>" -o out.mp4 [--from-image <https url>] [--aspect 16:9|9:16] [--model m] a short video (or animate an image)
3598
+ vibiz image "<prompt>" -o out.png [--size 1024x1024] [--model m] [--from-image <https url>] generate an image, or edit a photo
3599
+ vibiz video "<prompt>" -o out.mp4 [--from-image <https url>] [--aspect 16:9|9:16] [--model m] [--params '<json>'] a short video (or animate an image)
3600
+ vibiz media-models [words] [--category image-to-video] every image/video model you can run by id (Kling, face swap\u2026), with its live price
3596
3601
  vibiz say "<text>" -o out.mp3 [--voice alloy] text to speech
3597
3602
  vibiz transcribe <audio-file> [--language en] speech to text
3598
3603
  vibiz usage [--period 24h|7d|30d|month] [--by tool|model|alias|project|api_key|end_user|day|capability]
@@ -3733,7 +3738,7 @@ function printDomains(io, list2, only) {
3733
3738
  }
3734
3739
  for (const x of rows) {
3735
3740
  io.log(
3736
- `${x.domain} ${DOMAIN_STATUS[x.status]}${x.www_redirect ? ` (${x.www_redirect} redirects here)` : ""}${x.trusted_for_sign_in ? "" : " [analytics only]"}`
3741
+ `${x.domain} ${DOMAIN_STATUS[x.status]}${x.redirect_to ? ` \u2192 redirects to ${x.redirect_to}` : ""}${x.www_redirect ? ` (${x.www_redirect} redirects ${x.redirect_to ? "there too" : "here"})` : ""}${x.trusted_for_sign_in ? "" : " [analytics only]"}`
3737
3742
  );
3738
3743
  if (x.error) io.log(` ${x.error}`);
3739
3744
  if (x.records_to_set.length && x.status !== "active") {
@@ -3756,6 +3761,16 @@ function printDomains(io, list2, only) {
3756
3761
  io.log(` ${x.next_step}`);
3757
3762
  }
3758
3763
  }
3764
+ async function projectIdOf(vibiz2, ref) {
3765
+ const r = ref.toLowerCase();
3766
+ const hit = (await vibiz2.projects.list()).find((p) => p.id === ref || p.slug === r);
3767
+ if (!hit) {
3768
+ throw new Error(
3769
+ `No project "${ref}" on this account: name one by id or slug (vibiz projects lists them).`
3770
+ );
3771
+ }
3772
+ return hit.id;
3773
+ }
3759
3774
  var accessLabel = (access, preset, grants) => access !== "agent" ? "full access" : preset === "read_all" ? "Read everything" : grants?.length ? `Limited + ${grants.length} permission${grants.length === 1 ? "" : "s"}` : "Limited access";
3760
3775
  var BUY_DOMAIN_COMMANDS = /* @__PURE__ */ new Set([
3761
3776
  "search",
@@ -4715,6 +4730,8 @@ async function runCli(argv2, io) {
4715
4730
  size: { type: "string" },
4716
4731
  voice: { type: "string" },
4717
4732
  "from-image": { type: "string" },
4733
+ params: { type: "string" },
4734
+ category: { type: "string" },
4718
4735
  aspect: { type: "string" },
4719
4736
  language: { type: "string" },
4720
4737
  project: { type: "string" },
@@ -5992,9 +6009,24 @@ ${link.url}`
5992
6009
  await buyDomainsCommand(io, vibiz2, values, sub, arg, third);
5993
6010
  return;
5994
6011
  }
5995
- const id = await io.project();
6012
+ const id = values.project ? await projectIdOf(vibiz2, values.project) : await io.project();
5996
6013
  const d = vibiz2.projects.domains;
5997
6014
  const print = (list2, only) => values.json ? io.log(JSON.stringify(only ? list2.data.find((x) => x.domain === only) : list2, null, 2)) : printDomains(io, list2, only);
6015
+ if (sub === "redirect") {
6016
+ if (!arg || !third) {
6017
+ throw new Error(
6018
+ "usage: vibiz domains redirect <from> <to|none> [--project <id|slug>] (e.g. vibiz domains redirect old.com new.com)"
6019
+ );
6020
+ }
6021
+ const off = third === "none" || third === "off";
6022
+ const one = await d.redirect(id, arg, off ? null : third);
6023
+ if (values.json) return io.log(JSON.stringify(one, null, 2));
6024
+ print({ ...await d.list(id), data: [one] }, one.domain);
6025
+ io.log(
6026
+ off ? `${one.domain} serves the app again: its redirect is off.` : `Every URL on ${one.domain} now answers a permanent redirect to the same path on ${one.redirect_to}.`
6027
+ );
6028
+ return;
6029
+ }
5998
6030
  if (sub === "add" || sub === "verify" || sub === "remove" || sub === "rm") {
5999
6031
  if (!arg) throw new Error(`usage: vibiz domains ${sub} <domain>`);
6000
6032
  if (sub === "add") {
@@ -6015,7 +6047,7 @@ ${link.url}`
6015
6047
  }
6016
6048
  if (sub)
6017
6049
  throw new Error(
6018
- "usage: vibiz domains [add | verify | remove | search | buy | owned | use | move | point | records | renew | auto-renew | transfer-code | owner]"
6050
+ "usage: vibiz domains [add | verify | remove | redirect | search | buy | owned | use | move | point | records | renew | auto-renew | transfer-code | owner]"
6019
6051
  );
6020
6052
  print(await d.list(id));
6021
6053
  return;
@@ -6628,12 +6660,19 @@ ${await oneKeyLines(vibiz2, id)}`);
6628
6660
  case "image": {
6629
6661
  io.local();
6630
6662
  const prompt = positionals.join(" ");
6631
- if (!prompt || !values.output) throw new Error('usage: vibiz image "<prompt>" -o out.png');
6663
+ if (!prompt || !values.output)
6664
+ throw new Error('usage: vibiz image "<prompt>" -o out.png [--from-image <https url>]');
6665
+ const photo = values["from-image"];
6666
+ if (photo && !photo.startsWith("https://"))
6667
+ throw new Error(
6668
+ "--from-image must be a public https link (upload it with vibiz files add first)."
6669
+ );
6632
6670
  const vibiz2 = await io.aiClient(values.project);
6633
6671
  const out = await vibiz2.ai.image({
6634
6672
  prompt,
6635
6673
  ...values.size ? { size: values.size } : {},
6636
- ...values.model ? { model: values.model } : {}
6674
+ ...values.model ? { model: values.model } : {},
6675
+ ...photo ? { image_url: photo } : {}
6637
6676
  });
6638
6677
  const b64 = out.data[0]?.b64_json;
6639
6678
  if (!b64) throw new Error("No image came back.");
@@ -6658,6 +6697,16 @@ ${await oneKeyLines(vibiz2, id)}`);
6658
6697
  throw new Error(
6659
6698
  "--from-image must be a public https link (upload it with vibiz files add first)."
6660
6699
  );
6700
+ let params;
6701
+ if (values.params) {
6702
+ try {
6703
+ params = JSON.parse(values.params);
6704
+ } catch {
6705
+ throw new Error(
6706
+ `--params must be a JSON object, e.g. --params '{"duration":"10"}' (the model's own parameters).`
6707
+ );
6708
+ }
6709
+ }
6661
6710
  const vibiz2 = await io.aiClient(values.project);
6662
6711
  const job = await vibiz2.ai.jobs.create({
6663
6712
  type: "video",
@@ -6665,7 +6714,8 @@ ${await oneKeyLines(vibiz2, id)}`);
6665
6714
  input: {
6666
6715
  prompt,
6667
6716
  ...from ? { image_url: from } : {},
6668
- ...aspect ? { aspect_ratio: aspect } : {}
6717
+ ...aspect ? { aspect_ratio: aspect } : {},
6718
+ ...params ? { model_input: params } : {}
6669
6719
  }
6670
6720
  });
6671
6721
  io.error(` rendering ${job.id} (about a minute)\u2026`);
@@ -6682,6 +6732,29 @@ ${await oneKeyLines(vibiz2, id)}`);
6682
6732
  if (clip.file_url) io.log(` saved in the project's Files: ${clip.file_url}`);
6683
6733
  return;
6684
6734
  }
6735
+ case "media-models": {
6736
+ const vibiz2 = await io.aiClient(values.project);
6737
+ const q = positionals.join(" ");
6738
+ const models = await vibiz2.ai.mediaModels({
6739
+ ...q ? { q } : {},
6740
+ ...values.category ? { category: values.category } : {}
6741
+ });
6742
+ if (values.json) {
6743
+ io.log(JSON.stringify(models, null, 2));
6744
+ return;
6745
+ }
6746
+ if (!models.length) {
6747
+ io.log('No model matches. Try other words, like "kling", "face swap" or "upscale".');
6748
+ return;
6749
+ }
6750
+ for (const m of models) {
6751
+ const price = m.price ? `$${m.price.usd} / ${m.price.unit}` : "price on request";
6752
+ io.log(`${m.id} (${m.type}, ${price}) ${m.name}`);
6753
+ }
6754
+ io.log(`
6755
+ Run one: vibiz video "<prompt>" -o out.mp4 --model <id> [--params '{...}']`);
6756
+ return;
6757
+ }
6685
6758
  case "say": {
6686
6759
  io.local();
6687
6760
  const text = positionals.join(" ");
@@ -6897,7 +6970,7 @@ Store the key now: it is not shown again.`
6897
6970
  return;
6898
6971
  }
6899
6972
  case "docs": {
6900
- const { DOC_TOPICS, DOCS } = await import("./src-H7SRDBOZ.js");
6973
+ const { DOC_TOPICS, DOCS } = await import("./src-E7DJTTI6.js");
6901
6974
  const topic = positionals[0];
6902
6975
  if (!topic || !DOC_TOPICS.includes(topic)) {
6903
6976
  for (const t of DOC_TOPICS) io.log(` vibiz docs ${t.padEnd(13)} ${DOCS[t].title}`);
@@ -6922,7 +6995,7 @@ ${DOCS[topic].body}`);
6922
6995
  if (positionals[0])
6923
6996
  throw new Error('usage: vibiz mcp (serve over stdio) | vibiz mcp add --clients "<client>"');
6924
6997
  io.local();
6925
- const { serveStdio } = await import("./src-H7SRDBOZ.js");
6998
+ const { serveStdio } = await import("./src-E7DJTTI6.js");
6926
6999
  await serveStdio({ version: cliVersion() });
6927
7000
  return;
6928
7001
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/cli",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "The thelastapi CLI and MCP server: website, database, sign-in, email and AI for a new business, from your terminal or your AI agent.",
5
5
  "keywords": [
6
6
  "vibiz",