@vibiz/cli 0.3.16 → 0.3.18
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/README.md +3 -3
- package/dist/{chunk-4M6B5ZSL.js → chunk-LHRFNBS5.js} +16 -1
- package/dist/{src-E7DJTTI6.js → src-7A6SEUCX.js} +132 -34
- package/dist/vibiz.js +181 -48
- package/package.json +2 -2
package/dist/vibiz.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
formatUsd,
|
|
12
12
|
mergeEnvFile,
|
|
13
13
|
oneKeyMessage
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LHRFNBS5.js";
|
|
15
15
|
|
|
16
16
|
// packages/cli/src/main.ts
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
@@ -26,7 +26,7 @@ import { parseArgs } from "node:util";
|
|
|
26
26
|
|
|
27
27
|
// packages/app/src/index.ts
|
|
28
28
|
var runtimeEnv = () => globalThis.process?.env ?? {};
|
|
29
|
-
var DEFAULT_URL = "https://
|
|
29
|
+
var DEFAULT_URL = "https://thelastapi.dev";
|
|
30
30
|
var VibizAppError = class extends Error {
|
|
31
31
|
status;
|
|
32
32
|
code;
|
|
@@ -264,10 +264,10 @@ var VibizApp = class _VibizApp {
|
|
|
264
264
|
...init.body !== void 0 ? { body: JSON.stringify(init.body) } : {},
|
|
265
265
|
...init.raw ? { body: init.raw } : {}
|
|
266
266
|
});
|
|
267
|
-
const
|
|
267
|
+
const text2 = await res.text();
|
|
268
268
|
let data = null;
|
|
269
269
|
try {
|
|
270
|
-
data =
|
|
270
|
+
data = text2 ? JSON.parse(text2) : null;
|
|
271
271
|
} catch {
|
|
272
272
|
data = null;
|
|
273
273
|
}
|
|
@@ -825,10 +825,10 @@ async function designCommand(io, args, flags) {
|
|
|
825
825
|
}
|
|
826
826
|
const local = io.local();
|
|
827
827
|
const out = flags.out ?? "design.md";
|
|
828
|
-
const write = async (name,
|
|
828
|
+
const write = async (name, text2) => {
|
|
829
829
|
const path = join2(local.cwd(), name);
|
|
830
830
|
await local.mkdir(dirname2(path), { recursive: true });
|
|
831
|
-
await local.writeFile(path,
|
|
831
|
+
await local.writeFile(path, text2);
|
|
832
832
|
return name;
|
|
833
833
|
};
|
|
834
834
|
const picture = async (name, image) => image ? write(name, Buffer.from(image.base64, "base64")) : null;
|
|
@@ -969,7 +969,7 @@ var ONE_KEY_PATHS = ` Then the app loads the rest at start:
|
|
|
969
969
|
Node, Bun, Deno import { vibiz } from '@vibiz/app'; await vibiz.loadEnv();
|
|
970
970
|
any language npx @vibiz/cli run -- <your start command>
|
|
971
971
|
Docker / shell eval "$(curl -fsS -H "Authorization: Bearer $VIBIZ_APP_KEY" \\
|
|
972
|
-
https://
|
|
972
|
+
https://thelastapi.dev/v1/app/env?format=shell)" && exec <your server>
|
|
973
973
|
CI / build step npx @vibiz/cli env pull --format dotenv -o .env.production`;
|
|
974
974
|
|
|
975
975
|
// packages/cli/src/dns-records.ts
|
|
@@ -992,10 +992,10 @@ function recordLine(r) {
|
|
|
992
992
|
`id ${r.id}`
|
|
993
993
|
].filter(Boolean).join(" \xB7 ");
|
|
994
994
|
}
|
|
995
|
-
var whole = (
|
|
995
|
+
var whole = (flag2, v, example) => {
|
|
996
996
|
if (v === void 0) return void 0;
|
|
997
997
|
if (!/^\d+$/.test(v.trim())) {
|
|
998
|
-
throw new Error(`--${
|
|
998
|
+
throw new Error(`--${flag2} is a whole number, like --${flag2} ${example}. "${v}" is not.`);
|
|
999
999
|
}
|
|
1000
1000
|
return Number(v);
|
|
1001
1001
|
};
|
|
@@ -1632,8 +1632,8 @@ async function exportCommand(io, flags) {
|
|
|
1632
1632
|
}
|
|
1633
1633
|
}
|
|
1634
1634
|
if (envPath) {
|
|
1635
|
-
const
|
|
1636
|
-
await out.writeFile(envPath,
|
|
1635
|
+
const text2 = await vibiz2.exports.envFile(projectId, done.id);
|
|
1636
|
+
await out.writeFile(envPath, text2, { mode: 384 });
|
|
1637
1637
|
await out.chmod(envPath, 384);
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
@@ -1883,7 +1883,7 @@ function cliVersion() {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
|
|
1885
1885
|
// packages/cli/src/login.ts
|
|
1886
|
-
var DEFAULT_API_URL = "https://
|
|
1886
|
+
var DEFAULT_API_URL = "https://thelastapi.dev";
|
|
1887
1887
|
var pendingFile = (dir) => join4(dir, "pending-login.json");
|
|
1888
1888
|
var configFile = (dir) => join4(dir, "config.json");
|
|
1889
1889
|
async function readJson(io, path) {
|
|
@@ -2258,6 +2258,87 @@ async function phoneCommand(io, client, flags, positionals) {
|
|
|
2258
2258
|
}
|
|
2259
2259
|
}
|
|
2260
2260
|
|
|
2261
|
+
// packages/cli/src/profile.ts
|
|
2262
|
+
var onOff = (v) => v ? "on" : "off";
|
|
2263
|
+
function pairs(args, usage2) {
|
|
2264
|
+
if (!args.length) throw new Error(usage2);
|
|
2265
|
+
return args.map((a) => {
|
|
2266
|
+
const i = a.indexOf("=");
|
|
2267
|
+
if (i <= 0) throw new Error(`"${a}" isn't key=value. ${usage2}`);
|
|
2268
|
+
return [a.slice(0, i).trim().toLowerCase(), a.slice(i + 1).trim()];
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
function flag(key, v) {
|
|
2272
|
+
if (/^(on|true|yes|1)$/i.test(v)) return true;
|
|
2273
|
+
if (/^(off|false|no|0)$/i.test(v)) return false;
|
|
2274
|
+
throw new Error(`${key}: use on or off (got "${v}").`);
|
|
2275
|
+
}
|
|
2276
|
+
var text = (v) => v === "" ? null : v;
|
|
2277
|
+
var PROFILE_USAGE = 'usage: vibiz profile set username=alice name="Alice" bio="\u2026" x=@alice website=https://\u2026 country=US avatar=https://\u2026 public=on|off activity=on|off activity-stats=on|off';
|
|
2278
|
+
function profileInput(args) {
|
|
2279
|
+
const out = {};
|
|
2280
|
+
for (const [k, v] of pairs(args, PROFILE_USAGE)) {
|
|
2281
|
+
if (k === "username") out.username = v;
|
|
2282
|
+
else if (k === "name" || k === "display_name") out.display_name = text(v);
|
|
2283
|
+
else if (k === "bio") out.bio = text(v);
|
|
2284
|
+
else if (k === "avatar" || k === "avatar_url" || k === "picture") out.avatar_url = text(v);
|
|
2285
|
+
else if (k === "x" || k === "twitter") out.x = text(v);
|
|
2286
|
+
else if (k === "website") out.website = text(v);
|
|
2287
|
+
else if (k === "country") out.country = text(v);
|
|
2288
|
+
else if (k === "public") out.public = flag(k, v);
|
|
2289
|
+
else if (k === "activity") out.show_activity = flag(k, v);
|
|
2290
|
+
else if (k === "activity-stats" || k === "activity_stats") out.show_activity_stats = flag(k, v);
|
|
2291
|
+
else throw new Error(`Unknown field "${k}". ${PROFILE_USAGE}`);
|
|
2292
|
+
}
|
|
2293
|
+
return out;
|
|
2294
|
+
}
|
|
2295
|
+
var BUSINESS_USAGE = 'usage: vibiz profile business [<project>] listed=on|off revenue=on|off mrr=on|off visitors=on|off tagline="\u2026" description="\u2026" logo=https://\u2026 founded=2025-03';
|
|
2296
|
+
function profileBusinessInput(args) {
|
|
2297
|
+
const out = {};
|
|
2298
|
+
for (const [k, v] of pairs(args, BUSINESS_USAGE)) {
|
|
2299
|
+
if (k === "listed" || k === "list") out.listed = flag(k, v);
|
|
2300
|
+
else if (k === "revenue") out.show_revenue = flag(k, v);
|
|
2301
|
+
else if (k === "mrr") out.show_mrr = flag(k, v);
|
|
2302
|
+
else if (k === "visitors") out.show_visitors = flag(k, v);
|
|
2303
|
+
else if (k === "tagline") out.tagline = text(v);
|
|
2304
|
+
else if (k === "description") out.description = text(v);
|
|
2305
|
+
else if (k === "logo" || k === "logo_url") out.logo_url = text(v);
|
|
2306
|
+
else if (k === "founded") out.founded = text(v);
|
|
2307
|
+
else throw new Error(`Unknown field "${k}". ${BUSINESS_USAGE}`);
|
|
2308
|
+
}
|
|
2309
|
+
return out;
|
|
2310
|
+
}
|
|
2311
|
+
function formatProfileBusiness(b) {
|
|
2312
|
+
const shown = [
|
|
2313
|
+
b.show_revenue && "revenue",
|
|
2314
|
+
b.show_mrr && "MRR",
|
|
2315
|
+
b.show_visitors && "visitors"
|
|
2316
|
+
].filter(Boolean);
|
|
2317
|
+
return [
|
|
2318
|
+
`${b.name} (${b.slug}) ${b.listed ? "listed" : "not listed"}`,
|
|
2319
|
+
b.listed ? ` shows: ${shown.length ? shown.join(", ") : "no numbers"} \xB7 founded ${b.founded.slice(0, 7)}${b.tagline ? ` \xB7 "${b.tagline}"` : ""}` : "",
|
|
2320
|
+
b.url && b.listed ? ` ${b.url}` : ""
|
|
2321
|
+
].filter(Boolean).join("\n");
|
|
2322
|
+
}
|
|
2323
|
+
function formatProfile(p) {
|
|
2324
|
+
const lines = [
|
|
2325
|
+
p.username ? `Profile ${p.url} ${p.public ? "PUBLIC" : 'private (answers "not found")'}` : "Profile no username yet: vibiz profile set username=<name>",
|
|
2326
|
+
`Name ${p.display_name ?? "\u2013"}`
|
|
2327
|
+
];
|
|
2328
|
+
if (p.bio) lines.push(`Bio ${p.bio}`);
|
|
2329
|
+
const links = [p.x && `@${p.x}`, p.website, p.country].filter(Boolean);
|
|
2330
|
+
if (links.length) lines.push(`Links ${links.join(" \xB7 ")}`);
|
|
2331
|
+
lines.push(
|
|
2332
|
+
`Activity ${onOff(p.show_activity)}${p.show_activity ? ` (streaks ${onOff(p.show_activity_stats)})` : ""}`,
|
|
2333
|
+
"",
|
|
2334
|
+
"Businesses (each is unlisted, and each number hidden, until turned on)"
|
|
2335
|
+
);
|
|
2336
|
+
for (const b of p.businesses) lines.push(formatProfileBusiness(b));
|
|
2337
|
+
if (!p.businesses.length) lines.push(" none yet");
|
|
2338
|
+
lines.push("", `Console: ${p.console_url}`);
|
|
2339
|
+
return lines.join("\n");
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2261
2342
|
// packages/cli/src/scaffold.ts
|
|
2262
2343
|
import { existsSync } from "node:fs";
|
|
2263
2344
|
import { cp, readdir as readdir3, readFile, rename, writeFile } from "node:fs/promises";
|
|
@@ -2456,11 +2537,11 @@ async function readText2(io, path) {
|
|
|
2456
2537
|
}
|
|
2457
2538
|
}
|
|
2458
2539
|
async function mergeJsonServer(io, path, key, entry) {
|
|
2459
|
-
const
|
|
2540
|
+
const text2 = await readText2(io, path);
|
|
2460
2541
|
let doc = {};
|
|
2461
|
-
if (
|
|
2542
|
+
if (text2?.trim()) {
|
|
2462
2543
|
try {
|
|
2463
|
-
doc = JSON.parse(
|
|
2544
|
+
doc = JSON.parse(text2);
|
|
2464
2545
|
} catch {
|
|
2465
2546
|
throw new Error(
|
|
2466
2547
|
`${path} isn't plain JSON (comments?), so it was left as it is. Add the vibiz entry by hand: ${JSON.stringify({ [key]: { vibiz: entry } })}`
|
|
@@ -2484,12 +2565,12 @@ async function mergeJsonServer(io, path, key, entry) {
|
|
|
2484
2565
|
return before ? "updated" : "added";
|
|
2485
2566
|
}
|
|
2486
2567
|
async function mergeCodexToml(io, path, url) {
|
|
2487
|
-
const
|
|
2488
|
-
if (/^\s*\[mcp_servers\.vibiz\]\s*$/m.test(
|
|
2568
|
+
const text2 = await readText2(io, path) ?? "";
|
|
2569
|
+
if (/^\s*\[mcp_servers\.vibiz\]\s*$/m.test(text2)) return "unchanged";
|
|
2489
2570
|
const local = io.local();
|
|
2490
2571
|
await local.mkdir(dirname5(path), { recursive: true });
|
|
2491
|
-
const sep2 =
|
|
2492
|
-
await local.writeFile(path, `${
|
|
2572
|
+
const sep2 = text2 && !text2.endsWith("\n") ? "\n\n" : text2 ? "\n" : "";
|
|
2573
|
+
await local.writeFile(path, `${text2}${sep2}[mcp_servers.vibiz]
|
|
2493
2574
|
url = "${url}"
|
|
2494
2575
|
`);
|
|
2495
2576
|
return "added";
|
|
@@ -3574,7 +3655,7 @@ var HELP = `vibiz \u2014 website, database and sign-in for a new business, in on
|
|
|
3574
3655
|
vibiz email automation create --file automation.json {name, trigger, steps, exit_event}
|
|
3575
3656
|
vibiz ai "<prompt>" [--model m] [--system s] stream an answer from a language model (metered)
|
|
3576
3657
|
--model: a thelastapi model (vibiz/smart) or any lab model
|
|
3577
|
-
(anthropic/claude-sonnet-5.5):
|
|
3658
|
+
(anthropic/claude-sonnet-5.5): thelastapi.dev/docs/ai
|
|
3578
3659
|
vibiz ai models [search\u2026] [--all] [--json] the thelastapi models and the model each runs, with prices;
|
|
3579
3660
|
--all (or a search) lists every model you can call
|
|
3580
3661
|
vibiz ai budget [<dollars>] [--project id | --all] a project's daily AI budget: show it, or set it
|
|
@@ -3609,6 +3690,15 @@ var HELP = `vibiz \u2014 website, database and sign-in for a new business, in on
|
|
|
3609
3690
|
vibiz billing limit [<dollars>] the account's daily spend limit (all projects, AI and
|
|
3610
3691
|
web data): show it, or raise it. Full-access key to change.
|
|
3611
3692
|
vibiz billing auto-recharge on|off [--threshold 5] [--amount 25] (full-access key)
|
|
3693
|
+
vibiz profile [--json] your public founder page (thelastapi.dev/<username>):
|
|
3694
|
+
private until turned on; each business and number opt-in
|
|
3695
|
+
vibiz profile set key=value\u2026 username=alice name="Alice" bio="\u2026" x=@alice
|
|
3696
|
+
website=https://\u2026 country=US avatar=https://\u2026
|
|
3697
|
+
public=on|off activity=on|off activity-stats=on|off
|
|
3698
|
+
vibiz profile business [<project>] key=value\u2026 what one business shows: listed=on|off
|
|
3699
|
+
revenue=on|off mrr=on|off visitors=on|off
|
|
3700
|
+
tagline="\u2026" description="\u2026" logo=https://\u2026 founded=2025-03
|
|
3701
|
+
vibiz profile check <username> is a username free (and allowed)?
|
|
3612
3702
|
vibiz metrics [--period 7d] [--json] request counts, error rate and latency by capability
|
|
3613
3703
|
vibiz keys [create <name> [--limited|--read-all] | access [<id> full|read|limited | <id> allow <permission>] | permissions | revoke <id>]
|
|
3614
3704
|
named API keys, one per person or agent: full
|
|
@@ -4350,7 +4440,7 @@ var USAGE_WORDS = {
|
|
|
4350
4440
|
};
|
|
4351
4441
|
async function ownerStripeCommand(io, vibiz2, [sub, arg], flags) {
|
|
4352
4442
|
const env = flags.dev ? "development" : "production";
|
|
4353
|
-
const out = (x,
|
|
4443
|
+
const out = (x, text2) => flags.json ? io.log(JSON.stringify(x, null, 2)) : text2();
|
|
4354
4444
|
const print = (s) => {
|
|
4355
4445
|
for (const e of ["production", "development"]) {
|
|
4356
4446
|
const x = s.environments[e];
|
|
@@ -4588,7 +4678,7 @@ function contentTypeOf(name) {
|
|
|
4588
4678
|
const ext = name.toLowerCase().split(".").pop() ?? "";
|
|
4589
4679
|
return CONTENT_TYPES[ext] ?? "application/octet-stream";
|
|
4590
4680
|
}
|
|
4591
|
-
var snippet = (
|
|
4681
|
+
var snippet = (text2, max) => text2.length > max ? `${text2.slice(0, max - 1).trimEnd()}\u2026` : text2;
|
|
4592
4682
|
function bytesLabel(n) {
|
|
4593
4683
|
if (n < 1024) return `${n} B`;
|
|
4594
4684
|
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
@@ -4613,9 +4703,9 @@ async function campaignCreateInputFrom(values, vibiz2, id, env, mediaUrl, readFi
|
|
|
4613
4703
|
let base = {};
|
|
4614
4704
|
if (v.file) {
|
|
4615
4705
|
const file = String(v.file);
|
|
4616
|
-
const
|
|
4706
|
+
const text2 = await readFile4(file);
|
|
4617
4707
|
try {
|
|
4618
|
-
base = JSON.parse(
|
|
4708
|
+
base = JSON.parse(text2);
|
|
4619
4709
|
} catch (e) {
|
|
4620
4710
|
throw new Error(
|
|
4621
4711
|
`${file} is not valid JSON (${e instanceof Error ? e.message : String(e)}): fix it, or use the flags instead.`
|
|
@@ -5176,7 +5266,7 @@ ${link.url}`
|
|
|
5176
5266
|
const env = values.dev ? "development" : void 0;
|
|
5177
5267
|
const [sub, arg, arg2] = positionals;
|
|
5178
5268
|
if (sub === "app-store") {
|
|
5179
|
-
const out = (x,
|
|
5269
|
+
const out = (x, text2) => values.json ? io.log(JSON.stringify(x, null, 2)) : text2();
|
|
5180
5270
|
const steps = (next) => {
|
|
5181
5271
|
for (const n of next) io.log(` - ${n}`);
|
|
5182
5272
|
};
|
|
@@ -5341,7 +5431,7 @@ ${link.url}`);
|
|
|
5341
5431
|
const id = await io.project();
|
|
5342
5432
|
const env = values.dev ? "development" : void 0;
|
|
5343
5433
|
const [sub, arg, arg2] = positionals;
|
|
5344
|
-
const out = (x,
|
|
5434
|
+
const out = (x, text2) => values.json ? io.log(JSON.stringify(x, null, 2)) : text2();
|
|
5345
5435
|
const amount = values.amount !== void 0 ? Number(values.amount) : void 0;
|
|
5346
5436
|
if (amount !== void 0 && !Number.isInteger(amount)) {
|
|
5347
5437
|
throw new Error(
|
|
@@ -5793,7 +5883,7 @@ ${link.url}`
|
|
|
5793
5883
|
const id = await io.project();
|
|
5794
5884
|
const env = values.dev ? "development" : void 0;
|
|
5795
5885
|
const [sub = "list", name, ...more] = positionals;
|
|
5796
|
-
const out = (x,
|
|
5886
|
+
const out = (x, text2) => values.json ? io.log(JSON.stringify(x, null, 2)) : text2();
|
|
5797
5887
|
const c = vibiz2.projects.connectors;
|
|
5798
5888
|
const ready = (k) => `prod ${k.ready.production ? "ready" : "no key"}, dev ${k.ready.development ? "ready" : "no key"}`;
|
|
5799
5889
|
const printOps = (ops) => {
|
|
@@ -5943,13 +6033,13 @@ ${link.url}`
|
|
|
5943
6033
|
return;
|
|
5944
6034
|
}
|
|
5945
6035
|
if (sub === "call") {
|
|
5946
|
-
const [op, ...
|
|
6036
|
+
const [op, ...pairs2] = more;
|
|
5947
6037
|
if (!op)
|
|
5948
6038
|
throw new Error(
|
|
5949
6039
|
"usage: vibiz connectors call <name> <operation> [key=value\u2026] [--body json]"
|
|
5950
6040
|
);
|
|
5951
6041
|
const params = {};
|
|
5952
|
-
for (const p of
|
|
6042
|
+
for (const p of pairs2) {
|
|
5953
6043
|
const at = p.indexOf("=");
|
|
5954
6044
|
if (at < 1) throw new Error(`"${p}" is not key=value`);
|
|
5955
6045
|
const raw = p.slice(at + 1);
|
|
@@ -6275,18 +6365,18 @@ ${await oneKeyLines(vibiz2, id)}`);
|
|
|
6275
6365
|
}
|
|
6276
6366
|
const key = io.env.VIBIZ_APP_KEY;
|
|
6277
6367
|
if (!key) throw new Error("vibiz env pull needs VIBIZ_APP_KEY (the app\u2019s own key).");
|
|
6278
|
-
const base = (io.env.VIBIZ_API_URL ??
|
|
6368
|
+
const base = (io.env.VIBIZ_API_URL ?? DEFAULT_API_URL).replace(/\/$/, "");
|
|
6279
6369
|
const res = await fetch(`${base}/v1/app/env?format=${format2}`, {
|
|
6280
6370
|
headers: { authorization: `Bearer ${key}` }
|
|
6281
6371
|
});
|
|
6282
|
-
const
|
|
6283
|
-
if (!res.ok) throw new Error(`thelastapi answered ${res.status}: ${
|
|
6372
|
+
const text2 = await res.text();
|
|
6373
|
+
if (!res.ok) throw new Error(`thelastapi answered ${res.status}: ${text2.slice(0, 200)}`);
|
|
6284
6374
|
if (values.output) {
|
|
6285
|
-
await io.local().writeFile(values.output,
|
|
6375
|
+
await io.local().writeFile(values.output, text2, { mode: 384 });
|
|
6286
6376
|
await io.local().chmod(values.output, 384);
|
|
6287
6377
|
io.err(`Wrote the app's env to ${values.output}
|
|
6288
6378
|
`);
|
|
6289
|
-
} else io.out(
|
|
6379
|
+
} else io.out(text2);
|
|
6290
6380
|
return;
|
|
6291
6381
|
}
|
|
6292
6382
|
const sub = positionals[0];
|
|
@@ -6757,12 +6847,12 @@ Run one: vibiz video "<prompt>" -o out.mp4 --model <id> [--params '{...}']`);
|
|
|
6757
6847
|
}
|
|
6758
6848
|
case "say": {
|
|
6759
6849
|
io.local();
|
|
6760
|
-
const
|
|
6761
|
-
if (!
|
|
6850
|
+
const text2 = positionals.join(" ");
|
|
6851
|
+
if (!text2 || !values.output)
|
|
6762
6852
|
throw new Error('usage: vibiz say "<text>" -o out.mp3 [--voice alloy]');
|
|
6763
6853
|
const vibiz2 = await io.aiClient(values.project);
|
|
6764
6854
|
const audio = await vibiz2.ai.speech({
|
|
6765
|
-
input:
|
|
6855
|
+
input: text2,
|
|
6766
6856
|
...values.voice ? { voice: values.voice } : {},
|
|
6767
6857
|
...values.model ? { model: values.model } : {}
|
|
6768
6858
|
});
|
|
@@ -6885,6 +6975,49 @@ The credits show in \`vibiz billing\` a few seconds after paying.`
|
|
|
6885
6975
|
"usage: vibiz billing [top-up <dollars> | history [--kind k] | auto-recharge on|off]"
|
|
6886
6976
|
);
|
|
6887
6977
|
}
|
|
6978
|
+
case "profile": {
|
|
6979
|
+
const vibiz2 = await io.client();
|
|
6980
|
+
const [sub, ...args] = positionals;
|
|
6981
|
+
if (!sub || sub === "show") {
|
|
6982
|
+
const p = await vibiz2.profile.get();
|
|
6983
|
+
io.log(values.json ? JSON.stringify(p, null, 2) : formatProfile(p));
|
|
6984
|
+
return;
|
|
6985
|
+
}
|
|
6986
|
+
if (sub === "check") {
|
|
6987
|
+
if (!args[0]) throw new Error("usage: vibiz profile check <username>");
|
|
6988
|
+
const r = await vibiz2.profile.checkUsername(args[0]);
|
|
6989
|
+
io.log(
|
|
6990
|
+
values.json ? JSON.stringify(r, null, 2) : r.available ? `${r.username} is available: vibiz profile set username=${r.username}` : r.reason ?? `${r.username} is not available.`
|
|
6991
|
+
);
|
|
6992
|
+
return;
|
|
6993
|
+
}
|
|
6994
|
+
if (sub === "set") {
|
|
6995
|
+
const input = profileInput(args);
|
|
6996
|
+
const p = await vibiz2.profile.update(input);
|
|
6997
|
+
io.log(values.json ? JSON.stringify(p, null, 2) : formatProfile(p));
|
|
6998
|
+
return;
|
|
6999
|
+
}
|
|
7000
|
+
if (sub === "business") {
|
|
7001
|
+
const named = args[0] && !args[0].includes("=") ? args[0] : void 0;
|
|
7002
|
+
const project = named ?? await io.project();
|
|
7003
|
+
const b = await vibiz2.profile.business(
|
|
7004
|
+
project,
|
|
7005
|
+
profileBusinessInput(named ? args.slice(1) : args)
|
|
7006
|
+
);
|
|
7007
|
+
if (values.json) {
|
|
7008
|
+
io.log(JSON.stringify(b, null, 2));
|
|
7009
|
+
return;
|
|
7010
|
+
}
|
|
7011
|
+
io.log(formatProfileBusiness(b));
|
|
7012
|
+
if (b.listed && !b.profile_public) {
|
|
7013
|
+
io.log("\nThe profile itself is private: vibiz profile set public=on to publish it.");
|
|
7014
|
+
}
|
|
7015
|
+
return;
|
|
7016
|
+
}
|
|
7017
|
+
throw new Error(
|
|
7018
|
+
"usage: vibiz profile [set key=value\u2026 | business [<project>] key=value\u2026 | check <username>]"
|
|
7019
|
+
);
|
|
7020
|
+
}
|
|
6888
7021
|
case "metrics": {
|
|
6889
7022
|
const report = await (await io.client()).metrics.get({ period: usagePeriod("7d") });
|
|
6890
7023
|
io.log(values.json ? JSON.stringify(report, null, 2) : formatMetrics(report));
|
|
@@ -6970,7 +7103,7 @@ Store the key now: it is not shown again.`
|
|
|
6970
7103
|
return;
|
|
6971
7104
|
}
|
|
6972
7105
|
case "docs": {
|
|
6973
|
-
const { DOC_TOPICS, DOCS } = await import("./src-
|
|
7106
|
+
const { DOC_TOPICS, DOCS } = await import("./src-7A6SEUCX.js");
|
|
6974
7107
|
const topic = positionals[0];
|
|
6975
7108
|
if (!topic || !DOC_TOPICS.includes(topic)) {
|
|
6976
7109
|
for (const t of DOC_TOPICS) io.log(` vibiz docs ${t.padEnd(13)} ${DOCS[t].title}`);
|
|
@@ -6995,7 +7128,7 @@ ${DOCS[topic].body}`);
|
|
|
6995
7128
|
if (positionals[0])
|
|
6996
7129
|
throw new Error('usage: vibiz mcp (serve over stdio) | vibiz mcp add --clients "<client>"');
|
|
6997
7130
|
io.local();
|
|
6998
|
-
const { serveStdio } = await import("./src-
|
|
7131
|
+
const { serveStdio } = await import("./src-7A6SEUCX.js");
|
|
6999
7132
|
await serveStdio({ version: cliVersion() });
|
|
7000
7133
|
return;
|
|
7001
7134
|
}
|
|
@@ -7089,8 +7222,8 @@ async function aiKeysCommand(io, args, values) {
|
|
|
7089
7222
|
const provider = rawProvider;
|
|
7090
7223
|
const readKey = async (envNames, what) => {
|
|
7091
7224
|
if (values["key-file"]) {
|
|
7092
|
-
const
|
|
7093
|
-
return
|
|
7225
|
+
const text2 = (await io.local().readFile(values["key-file"])).toString();
|
|
7226
|
+
return text2.split(/\r?\n/)[0]?.trim() ?? "";
|
|
7094
7227
|
}
|
|
7095
7228
|
for (const n of envNames) if (io.env[n]) return io.env[n];
|
|
7096
7229
|
const typed = await io.promptHidden(`${what} (hidden): `);
|
|
@@ -7237,8 +7370,8 @@ async function siteSearchCommand(io, positionals, values) {
|
|
|
7237
7370
|
}
|
|
7238
7371
|
if (values.key) {
|
|
7239
7372
|
const { readFile: readFile4 } = await import("node:fs/promises");
|
|
7240
|
-
const
|
|
7241
|
-
const out3 = await vibiz2.search.addGoogleKey(
|
|
7373
|
+
const text2 = await readFile4(String(values.key), "utf8");
|
|
7374
|
+
const out3 = await vibiz2.search.addGoogleKey(text2, {
|
|
7242
7375
|
...values["owner-email"] ? { owner_email: values["owner-email"] } : {}
|
|
7243
7376
|
});
|
|
7244
7377
|
if (values.json) return print(out3);
|
|
@@ -7433,8 +7566,8 @@ function openUrl(url) {
|
|
|
7433
7566
|
var terminal = {
|
|
7434
7567
|
log: (...parts) => console.log(format(...parts)),
|
|
7435
7568
|
error: (...parts) => console.error(format(...parts)),
|
|
7436
|
-
out: (
|
|
7437
|
-
err: (
|
|
7569
|
+
out: (text2) => void process.stdout.write(text2),
|
|
7570
|
+
err: (text2) => void process.stderr.write(text2),
|
|
7438
7571
|
env: process.env,
|
|
7439
7572
|
client: async () => new Vibiz({ ...await login(), client: `vibiz-cli/${cliVersion()}` }),
|
|
7440
7573
|
aiClient: async (project) => {
|
|
@@ -7515,9 +7648,9 @@ if (argv[0] === "--version" || argv[0] === "-v") {
|
|
|
7515
7648
|
const latest = latestVersion(CONFIG_DIR, process.env);
|
|
7516
7649
|
const notice = async () => {
|
|
7517
7650
|
const v = await latest;
|
|
7518
|
-
const
|
|
7519
|
-
if (
|
|
7520
|
-
${
|
|
7651
|
+
const text2 = v && updateNotice(v, cliVersion());
|
|
7652
|
+
if (text2) console.error(`
|
|
7653
|
+
${text2}`);
|
|
7521
7654
|
};
|
|
7522
7655
|
runCli(argv, terminal).then(notice).catch(async (err) => {
|
|
7523
7656
|
for (const line2 of cliErrorLines(err)) console.error(line2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibiz/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.18",
|
|
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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"deploy",
|
|
10
10
|
"hosting"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://thelastapi.dev/docs",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/Vibiz-ai/vibiz-stack.git",
|