@tobos/cli 0.1.0 → 0.2.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/tobos.js +35 -15
- package/package.json +1 -1
package/dist/tobos.js
CHANGED
|
@@ -96,7 +96,7 @@ export declare function media(name: string): string;
|
|
|
96
96
|
var define_TOBOS_SKILL_default;
|
|
97
97
|
var init_define_TOBOS_SKILL = __esm({
|
|
98
98
|
"<define:TOBOS_SKILL>"() {
|
|
99
|
-
define_TOBOS_SKILL_default = { "SKILL.md": "---\nname: tobos-present\ndescription: Build presentations as code with Tobos Present. Use when the user wants a talk, lecture, pitch or slide deck made, changed, rendered, presented or exported as a PDF, or mentions Tobos or `tobos`.\n---\n\n<!-- Installed by the `tobos` CLI and overwritten when it updates, so changes made here don't last. -->\n\n# Tobos Present\n\nTobos hosts presentations that you write as code: one Svelte 5 file per scene, with beats (one click each) and GSAP animations. You build; Tobos checks every push, hosts the deck, and puts it on stage with a presenter view. There is no AI on Tobos's side and no MCP server: everything goes through the `tobos` command and git.\n\n## Set up (once per machine)\n\n```sh\nnpm i -g @tobos/cli # the `tobos` command; needs Node 22.18+ and git\ntobos login you@example.com # e-mails the person a 6-digit code (and signs them up if new
|
|
99
|
+
define_TOBOS_SKILL_default = { "SKILL.md": "---\nname: tobos-present\ndescription: Build presentations as code with Tobos Present. Use when the user wants a talk, lecture, pitch or slide deck made, changed, rendered, presented or exported as a PDF, or mentions Tobos or `tobos`.\n---\n\n<!-- Installed by the `tobos` CLI and overwritten when it updates, so changes made here don't last. -->\n\n# Tobos Present\n\nTobos hosts presentations that you write as code: one Svelte 5 file per scene, with beats (one click each) and GSAP animations. You build; Tobos checks every push, hosts the deck, and puts it on stage with a presenter view. There is no AI on Tobos's side and no MCP server: everything goes through the `tobos` command and git.\n\n## Set up (once per machine)\n\n```sh\nnpm i -g @tobos/cli # the `tobos` command; needs Node 22.18+ and git\ntobos login you@example.com # e-mails the person a 6-digit code (and signs them up if new)\ntobos login --code 123456 # the code they paste to you from the mail\n```\n\nAsk the person for their e-mail address first, then for the code in one line: it's in their e-mail, maybe in spam, and using it accepts https://tobos.ai/terms. Only they can read it; never guess or reuse one. It works for 10 minutes. In CI, set `TOBOS_TOKEN` instead.\n\n## Start or continue a deck\n\n```sh\ntobos decks # the decks you can work on\ntobos new \"Title of the talk\" # create one and clone it into ./<slug>\ntobos clone account/deck # or clone an existing one\n```\n\nThen **read the deck's `AGENTS.md`**. It, `.tobos/FORMAT.md` and `master/GUIDE.md` are the instructions for everything that follows: the loop (`check` \u2192 `render` \u2192 look \u2192 `push`), the format, the slide master's layouts and rules.\n\n## Follow the person\n\nThey decide what to make and how much you do: some build a deck one scene at a time, some want all of it at once. Do what they ask, at the size they ask. Don't ask what a talk is about, who it's for or how long it runs, and don't propose an outline they didn't ask for.\n\n## Commands\n\n| Command | Does |\n| -------------------------------------------------------- | ------------------------------------------------------ |\n| `tobos check` | compile and check the deck, offline |\n| `tobos push -m \"\u2026\"` | upload media, commit, push; the server checks it again |\n| `tobos render scene/beat` \xB7 `scene` \xB7 `--all` \xB7 `--film` | PNGs of beats; pushes what changed first |\n| `tobos open [scene/beat] [--presenter]` | the deck in a browser; pushes what changed first |\n| `tobos open` (outside a deck) | Tobos in the browser, logged in: decks and templates |\n| `tobos export pdf` | a PDF of every beat |\n\nEvery command takes `--json`. Exit codes: 0 ok, 1 error, 2 the deck has problems, 3 not logged in.\n\nWhen a command says a newer `tobos` is out, run `npm i -g @tobos/cli`; the next command updates this skill. When a plan's limit stops a command (Free hosts 3 decks), the error links to the billing page: give the person the link, since only they can buy Pro.\n" };
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
|
|
@@ -56517,7 +56517,7 @@ function settings() {
|
|
|
56517
56517
|
|
|
56518
56518
|
// src/api.ts
|
|
56519
56519
|
init_out();
|
|
56520
|
-
var VERSION = true ? "0.
|
|
56520
|
+
var VERSION = true ? "0.2.0" : "dev";
|
|
56521
56521
|
function newer(a, b) {
|
|
56522
56522
|
const parse9 = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n2) => parseInt(n2)) : null;
|
|
56523
56523
|
const x = parse9(a);
|
|
@@ -56837,16 +56837,25 @@ async function uploadMedia(root, media, server, account, note) {
|
|
|
56837
56837
|
init_define_TOBOS_PRESENT_TYPES();
|
|
56838
56838
|
init_define_TOBOS_SKILL();
|
|
56839
56839
|
import { spawn as spawn2 } from "node:child_process";
|
|
56840
|
-
function openUrl(url) {
|
|
56841
|
-
|
|
56840
|
+
async function openUrl(url) {
|
|
56841
|
+
const env = process.env;
|
|
56842
|
+
if (env.CI || env.TOBOS_NO_BROWSER || env.SSH_CONNECTION) return false;
|
|
56843
|
+
if (process.platform === "linux" && !env.DISPLAY && !env.WAYLAND_DISPLAY) return false;
|
|
56842
56844
|
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "rundll32" : "xdg-open";
|
|
56843
56845
|
const args = process.platform === "win32" ? ["url.dll,FileProtocolHandler", url] : [url];
|
|
56844
56846
|
try {
|
|
56845
56847
|
const child = spawn2(command, args, { stdio: "ignore", detached: true });
|
|
56846
|
-
child.on("error", () => {
|
|
56847
|
-
});
|
|
56848
56848
|
child.unref();
|
|
56849
|
-
return
|
|
56849
|
+
return await new Promise((resolve4) => {
|
|
56850
|
+
let timer;
|
|
56851
|
+
const done = (opened) => {
|
|
56852
|
+
clearTimeout(timer);
|
|
56853
|
+
resolve4(opened);
|
|
56854
|
+
};
|
|
56855
|
+
child.once("error", () => done(false));
|
|
56856
|
+
child.once("exit", (code) => done(code === 0));
|
|
56857
|
+
child.once("spawn", () => timer = setTimeout(() => done(true), 1500));
|
|
56858
|
+
});
|
|
56850
56859
|
} catch {
|
|
56851
56860
|
return false;
|
|
56852
56861
|
}
|
|
@@ -56956,7 +56965,7 @@ function installed(dir2) {
|
|
|
56956
56965
|
}
|
|
56957
56966
|
|
|
56958
56967
|
// src/commands.ts
|
|
56959
|
-
var TERMS_NOTICE = "
|
|
56968
|
+
var TERMS_NOTICE = "If the address is new, using the code accepts https://tobos.ai/terms.";
|
|
56960
56969
|
async function login(out, args) {
|
|
56961
56970
|
const server = (args.values.server || settings().server).replace(/\/$/, "");
|
|
56962
56971
|
const client = `the tobos CLI on ${hostname()}`;
|
|
@@ -56971,11 +56980,9 @@ async function login(out, args) {
|
|
|
56971
56980
|
save({ server, pending: email });
|
|
56972
56981
|
out.result(
|
|
56973
56982
|
{ sent: email, next: "tobos login --code <code>", terms: TERMS_NOTICE },
|
|
56974
|
-
() => `Sent a 6-digit code to ${email}; it works for 10 minutes. Ask the person for it,
|
|
56983
|
+
() => `Sent a 6-digit code to ${email}; it works for 10 minutes. Ask the person for it in one line: check the inbox, or spam, and paste the code here. ${TERMS_NOTICE} Then run:
|
|
56975
56984
|
|
|
56976
|
-
tobos login --code <code
|
|
56977
|
-
|
|
56978
|
-
${TERMS_NOTICE}`
|
|
56985
|
+
tobos login --code <code>`
|
|
56979
56986
|
);
|
|
56980
56987
|
return;
|
|
56981
56988
|
}
|
|
@@ -57221,14 +57228,25 @@ async function deckName(args) {
|
|
|
57221
57228
|
}
|
|
57222
57229
|
async function open2(out, args) {
|
|
57223
57230
|
const position3 = args.positionals[0];
|
|
57231
|
+
if (!position3 && typeof args.values.deck !== "string" && !await findDeck().catch(() => null))
|
|
57232
|
+
return openApp(out, args);
|
|
57224
57233
|
const view = args.values.presenter ? "presenter" : void 0;
|
|
57225
57234
|
const name = await deckName(args);
|
|
57226
57235
|
const { pushed } = await pushIfChanged(out, name);
|
|
57227
57236
|
const { url } = await viewUrl(name, view, 12);
|
|
57228
57237
|
const full = position3 ? `${url}#${position3}` : url;
|
|
57229
|
-
const opened = !args.values.print && openUrl(full);
|
|
57238
|
+
const opened = !args.values.print && await openUrl(full);
|
|
57230
57239
|
out.result({ url: full, opened, pushed }, () => full);
|
|
57231
57240
|
}
|
|
57241
|
+
async function openApp(out, args) {
|
|
57242
|
+
const { url } = await api("/api/login/browser", { method: "POST" });
|
|
57243
|
+
const opened = !args.values.print && await openUrl(url);
|
|
57244
|
+
out.result(
|
|
57245
|
+
{ url, opened },
|
|
57246
|
+
() => opened ? "Opened Tobos in the browser, logged in." : `${url}
|
|
57247
|
+
This link logs a browser in once, within 10 minutes.`
|
|
57248
|
+
);
|
|
57249
|
+
}
|
|
57232
57250
|
async function exportTarget(args, file2) {
|
|
57233
57251
|
if (args.values.out) return resolve3(args.values.out);
|
|
57234
57252
|
const deck = await findDeck().catch(() => void 0);
|
|
@@ -57355,6 +57373,7 @@ Looking at it (from the working copy, render and open push what changed first)
|
|
|
57355
57373
|
tobos render scene/beat | scene | --all PNGs of beats, for you to look at
|
|
57356
57374
|
[--film] [--frames 6] [--out dir] --film: frames through the animation
|
|
57357
57375
|
tobos open [scene/beat] [--presenter] the deck in a browser (prints the URL)
|
|
57376
|
+
tobos open outside a deck: Tobos in the browser, logged in
|
|
57358
57377
|
tobos export pdf [--out file] a PDF of every beat
|
|
57359
57378
|
|
|
57360
57379
|
The skill (what your harness reads to know Tobos without this help)
|
|
@@ -57362,8 +57381,9 @@ The skill (what your harness reads to know Tobos without this help)
|
|
|
57362
57381
|
read skills; later CLIs keep it up to date
|
|
57363
57382
|
|
|
57364
57383
|
Templates (decks people start from: a new deck copies a template's master/)
|
|
57365
|
-
tobos new "Title" --from account/template start a deck from that template (default:
|
|
57366
|
-
|
|
57384
|
+
tobos new "Title" --from account/template start a deck from that template (default: your own,
|
|
57385
|
+
account/my-template)
|
|
57386
|
+
tobos new "Our brand" --template a new template: a copy of your default (or of --from)
|
|
57367
57387
|
|
|
57368
57388
|
Every command takes --json and then prints one JSON object.
|
|
57369
57389
|
Exit codes: 0 ok, 1 error, 2 the deck has problems, 3 not logged in.
|