Skip to content

CLI ​

Create a project with bunx @hajimism/dek init, which also installs dek into it; see Getting Started. The examples below write dekc for what is really bunx dekc inside that project, or bunx @hajimism/dek outside one. Type dekc, not dek: bunx dek runs dek from npm, an unrelated package.

Conventions ​

  • Scope follows the working directory. The project root means every deck; a deck directory means that deck. From anywhere, name a deck as the first argument or with --deck <name>: dekc lint why-dek, dekc show why-dek intro, dekc why-dek. Details in Projects and Decks.
  • Result commands accept --json, with one envelope. Success is { "ok": true, ... }. Failure is { "ok": false, "error": { "message", "hint", "path", "line" }, ... } with exit code 1, both when a command cannot run and when lint or check finds an error; hint is there whenever dek knows the next step, path and line when the failure has a place. Commands that report diagnostics (lint, check, build, ls, cues) carry diagnostics pass or fail, so a reader branches on ok, reads error, and then the diagnostics. dekc and dekc rehearse stay running and do not take --json. See The JSON contract.
  • Each command's shape is a JSON Schema, published at cli.schema.json with one entry under $defs per command.
  • The shape is not frozen yet. While dek is 0.x, the --json shape and the rule ids may change between releases. A rule id is never reused for another rule.
  • Diagnostics are SARIF with dekc lint --format sarif: file:// URIs, line and column, the hint, slug, and data in properties, and skipped checks as tool execution notifications. The default is ESLint-style text, path:line:column: id message.
  • Only errors fail. Each diagnostic has a severity. lint, check, and pub publish exit 1 with "ok": false when an error remains; warnings alone exit 0.
  • init and sync never overwrite your work. They create what is missing and warn about what is left over. The only slides sync rewrites or removes are skeletons nobody has edited: rewritten when the script they came from changed, removed when their section is gone and no stylesheet or script sits beside them. In AGENTS.md, dek owns only the block between <!-- dek:begin … --> and <!-- dek:end -->. Neither renames.
  • Every error carries a hint naming the next command to run. Diagnostics carry one too when the fix is known: the beat ids a data-step may use, the classes a slide may use, the assets/ path for a remote image.
  • Text output carries no escape code a deck or a ref wrote. In a result's or an error's text, each control character other than a line break and a tab prints as U+FFFD, so the only colors that reach a terminal are dek's own. --json carries the text as it is.
  • Paths into the source tree are relative to the working directory in text and --json output: diagnostics, errors, and the files init, new, and sync create. Artifacts dek writes, such as a screenshot or a build, stay absolute. SARIF keeps absolute URIs.
  • A check that did not run is listed in "skipped", each entry with the check, the reason, and a hint when there is a way to run it: dekc check without Playwright skips visual, dekc check --voice on a deck without voice/ skips voice, dekc lint and dekc check skip a plugin that is not installed, has no lock, differs from its lock, or needs a newer dek, dekc lint skips rumdl when it is not installed, prints no SARIF, or runs past 30 s (it is then stopped, and not run for the decks after), dekc build without a URL or Playwright skips preview (the link preview image), and dekc ls on a ref skips lint. Text output prints <check>: skipped (<reason>) and the hint as help:; lint, check, and build print them on stderr, so stdout holds only the result. The field is absent when every check ran.
  • A page drawn without Chromium's sandbox is said so. Where the sandbox does not start, as in a container running as root or on Ubuntu 23.10 and later, check, lint --visual, shot, build, pdf, pptx, and video still draw the project's own decks, write warning: Chromium drew without its sandbox on stderr once a run, and carry unsandboxed in --json, with what Chromium said as reason and a hint. dekc shot <ref> refuses there instead, unless DEK_ALLOW_UNSANDBOXED=1. See A project you did not write.
  • Commands that write one file per deck return a list. build and pdf return outs, one path per deck in scope, one deck included.
  • A ref is read, never written. ls, show, theme, and shot take a ref name (owner/repo/deck, or file/<deck> for a pack) where they take a deck, and dekc new --theme-from copies a ref's theme into a new deck; every other command refuses one. No command, the dev server included, runs in a directory inside a ref's snapshot. See Refs.
  • Help is per command. dekc help <command>, dekc <command> --help, and -h print its usage, what it does, and every flag it takes. dekc --version (-v) prints the version. A mistyped command or deck name gets did you mean …?.
  • Flags are checked per command. --json, --help, and --version go anywhere; every other flag only where its command takes it, and --deck everywhere but new, ref, help, and pub alone, pub login, pub logout, and pub whoami. A misspelled flag, or one from another command, is an error whose hint lists the flags the command does take and names dekc help <command>, not a silent no-op. Values are checked before anything runs: --port takes a whole number from 1 to 65535, --fps a number above 0, --accent a whole number from 0, and --format only sarif; anything else, an empty value included, fails as invalid --<flag> "<value>" with what the flag takes.
  • Arguments are checked per command, too. A missing argument fails as missing <slug> for dekc show, and one past what the command takes as unexpected argument "extra" for dekc ls, each with the command's usage and dekc help <command> as the hint. A mistyped subcommand gets did you mean …?: dekc voice speakr suggests dekc voice speakers.

Development ​

CommandPurpose
dekc [deck] [--visual] [--port N] [--remote]Start the dev server: sync on start and on every save, live reload, lint on save, presenter view. Started at the project root, it serves every deck, each at /decks/<deck>/; started with a deck, or inside a deck's folder, it serves that deck alone, at /. A deck has one server at a time: servers for different decks run side by side, each at its own address, and a server for the project runs only while no other does. A start for a deck that is already served is refused with the running server's URL, and with what that server lacks of the start's --visual, --remote, or --port: a server takes those as it starts, so only stopping it and starting again gives them. A start for the project while servers for single decks run is refused with how to serve another deck beside them, and how to stop them and serve every deck from one; a server for a deck whose script does not parse counts too. It answers only at 127.0.0.1 or localhost, and refuses a move (a WebSocket, goto) from another origin. Another site's page cannot use what it serves either: not play its audio, apply its stylesheets, or show its pages in a frame. --visual adds overflow, contrast, line breaks, and alignment on save. --port fixes the port; without it the OS picks a free one. It stops on Ctrl-C, or when the process that started it exits, so no server is left holding a port.
dekc --remoteServe on the LAN. The presenter view, goto, current, the voice timeline and audio, and the streamed diagnostics require the 10-letter password dek makes and prints on each start. On a terminal, a QR code under it opens the presenter view on a phone: once, within five minutes; Enter prints a new one.
dekc rehearse [deck] [slug] [--remote]Auto-advance from the Timeline. Records nothing. --remote serves it on the LAN as dekc --remote does. It starts a dev server for the deck, so while one already serves the deck it is refused, with the address of the rehearsal on that server to open instead.

Project ​

CommandPurpose
dekc init [dir] [--deck NAME] [--browser] [--no-install]Create a project in dir (default: the current directory), optionally with a first deck, install the running dek into it, and print the commands to run next (next in --json). Writes dek.toml (with [pack] license = "CC0-1.0"; see Configuration), theme.css, .gitignore, .rumdl.toml, tsconfig.json, package.json, assets/, decks/, AGENTS.md, .dek/schema.json, and .dek/slide.d.ts. A first deck comes with a short starter script and its skeleton slides, so it passes lint as created; once you replace the script with your own, dekc sync removes the example skeletons you left untouched. Nothing that exists is overwritten: a file already there is kept, and listed as kept when it differs (created and kept in --json), except dek's own files, which are brought up to date and listed as updated (updated); every input is checked before the first write. An AGENTS.md already there keeps what you wrote and gets dek's block added, as sync does. A theme.css already there is kept too, and every deck copies it: when it lacks tokens every deck needs, init names them on stderr (missingTokens in --json), before the first lint reports them as DEK015, whose hint gives the value dek's own theme uses. Refuses to run inside another project; add a deck with dekc new there. Then it runs bun add -d --ignore-scripts @hajimism/dek@<version> in the project, pinned to the dek that is running, unless the project already has dek, --no-install is given, or the project's package.json is not the one init wrote (a folder that had one gets no install, and says so). --browser also runs bun add -d --ignore-scripts playwright when the project lacks it and bunx --bun playwright install chromium every time, which does nothing once Chromium is there; --visual, dekc shot, and dekc pdf need them. It installs no browser when the dek that runs is in a folder above the project, since that dek would not find it. What ran is listed (installed in --json). An install that fails leaves the project as written and is named on stderr (notInstalled in --json, each with install and reason), and the next commands then include bun add -d @hajimism/dek, or the Playwright install for the browser. --browser with --no-install is refused before anything is written when the project has no dek, since dek finds Playwright beside its own install.
dekc new <name> [--theme-from DECK|REF]Add a deck. Copies the project theme.css, or the named deck's or ref's, and creates its skeleton slides, so it passes lint as created. A ref's theme starts with a comment naming the ref and its pin, and a ref with no license gives a warning (warnings in --json). The copy's lines that hold characters a person cannot see are warnings on stderr and hidden in --json, at their place in the new deck. A deck's name holds no / or \, no control character or one a person cannot see, and does not start with -; dekc init --deck takes the same. Refreshes dek's own files as sync does, and lists each one it brought up to date (updated in --json). Prints the commands to run next (next in --json).
dekc ls [deck]List decks, or summarize one: sections, slides, diagnostics, budget, estimate, and narrated length when a Timeline exists. Diagnostics are dek's own rules, without rumdl. The list counts each deck's findings on its row and the project's (dek.toml) once, on a project line and in the top-level diagnostics of --json.

Refs ​

A ref is someone else's deck, pinned in dek.toml [refs] to read as a model. Its snapshot under refs/ is gitignored; whenever it is missing or at another commit, the next read fetches the pinned commit again. dek follows no symlink under refs/: it refuses to write or remove a snapshot through one, and names the link to remove. The same holds for packs/: a pack's copy there is written and removed only as a plain file. Public repositories need no token. For a private one, set GITHUB_TOKEN (or GH_TOKEN) to a token that can read it, such as GITHUB_TOKEN=$(gh auth token) dekc ref …. dek sends it only to api.github.com, and never asks gh for one itself.

A deck the reader cannot reach on GitHub travels as a pack: dekc pack writes it as a file, and dekc ref <file>.tgz pins it as file/<deck> to a sha256 of its files. The pack is kept as packs/<deck>.tgz, which is not ignored: commit it, and a clone, or a deleted refs/, unpacks the ref from it on the next read. file is kept for packs, so a GitHub owner of that name cannot be pinned.

A ref's text is someone else's, and dek keeps it apart from its own words. A hint names a ref only by its ref name, as the argument of the command it names, and never names the other decks, the folders, or the layouts in the ref's source, or quotes its files: where you need those names, as the decks a repository holds, the message lists them, each on one line of at most 40 characters. A ref's title, in AGENTS.md, dekc ref, and dekc ls, is one line of at most 80. Where the files ls, show, theme, or shot read of a ref hold characters a person cannot see (those Unicode marks default-ignorable, such as tag characters, zero-width characters, the byte order mark, bidi controls, and Hangul fillers, but not variation selectors; the line and paragraph separators; and the interlinear annotation marks), each line that holds any is a warning on stderr and an entry in hidden in --json, with its path, line, column, and codePoints. Text output shows each such character as ⟨U+XXXX⟩; --json keeps the text as the file has it. dekc new --theme-from <ref> reports the same for its copy of the ref's theme, at its lines in the new deck, which is yours from then on.

CommandPurpose
dekc ref <owner/repo/deck>[@rev]Pin a ref to the default branch, or to the tag, branch, or sha after @, and fetch its snapshot. A GitHub link to the deck's folder works too. A ref names its deck with up to 64 letters, digits, dots, dashes, and underscores, of any script, none a person cannot see, not starting with a dash (the whole rule is under refs in Configuration); a deck with another name cannot be pinned, and is left out of the list of decks dek gives when the name matches none. Run it again to move the pin to the latest; --json returns rev, from, and changed. Downloads at most 200 MB of the repository, unpacked to at most 1 GB. Warns when the repository has no license.
dekc ref <file>.tgzPin the pack as file/<deck>, copy it to packs/<deck>.tgz, and unpack its snapshot. A pack of the same deck with other files moves the pin, and --json returns from and changed as above; the same files change nothing. --json also returns pack, the copy to commit. A tarball of more than one deck is refused, and so is a deck whose name a ref cannot carry. Reads at most 50 MB, unpacked to at most 100 MB, and only a tar of files, folders, and links as dekc pack, git, and tar write one: a tar with a sparse file, a device, or a second archive after the first is refused. Warns when the pack has no license.
dekc pack [deck] [--root-dist]Write dist/<deck>.tgz: a gzipped tar of a project holding only the deck, under a folder named for it. It keeps script.md, theme.css, slides/, and assets/, not dist/, .cache/, voice/, or a file whose name starts with a dot; a LICENSE; and an empty dek.toml, so the project's settings stay home. The LICENSE is the legal code [pack] license names in dek.toml, else the project's own LICENSE file; with neither, the pack carries none and a warning says how to add one (warnings in --json). Refuses a deck whose name a ref cannot carry (anything but up to 64 letters, digits, dots, dashes, and underscores, none a person cannot see, not starting with a dash), one over 50 MB, a symlink out of the project or to nothing, and a ref. --json returns outs and warnings.
dekc refList the pinned refs: rev, title, slides, and which are not fetched.
dekc ref rm <ref>Drop the pin and the snapshot; for a pack, its copy in packs/ too.
dekc new <name> --theme-from <ref>Start a deck on a copy of the ref's theme.css, to build on its layouts: what dekc theme <ref> <layout> prints then passes lint in it. A ref whose snapshot is missing is fetched, or unpacked, first. The copy is the new deck's, and the ref stays as it was.
dekc ls <ref>Summarize a ref, timed at its own speaking rate. Lists lint in skipped: a ref is not yours to fix.
dekc show <ref> <slug>The same bundle as for a slide of your own, plus ref: name, rev, snapshot directory, and license file. Text output opens with ref <name> at <rev>: someone else's deck, read-only.
dekc theme <ref>, dekc shot <ref> <slug>The ref's theme, and a screenshot of one of its slides. A ref's shots are kept in your project's .cache/refs/<ref>/shots/, never in its snapshot.

Slide ​

CommandPurpose
dekc show [deck] <slug>Print everything one slide is made of, each part labeled with its file: the section as script.md has it, beat headings and their {#id}s included, slides/<slug>.html, .css, and .ts, the rules of the deck's theme.css the slide uses (with only the tokens and keyframes they reach), and the assets it references. A rule is the slide's when its classes, its layout, and the elements and attributes it needs are in the slide's markup, so a slide with no list and no data-step gets no .slide ul and no beat rules; with slides/<slug>.ts, whose draw may add elements, every element and attribute rule under .slide stays. A missing file is null. A file that is a symlink out of the project is an error, as it is for dekc build. In text, each part starts with a line --- <file>, and a file's own line that starts with --- , after any spaces, is shown one space further in, so no file can start a part. With --json, beats lists the section's beats in order, each with its title, line, and id when it has one: what a data-step names.
dekc theme [deck] [layout]List the layouts, classes, and tokens the deck's own theme.css defines. The classes are the ones markup may use and max_classes counts; is-current and is-shown, which the player sets, are listed apart as state classes (stateClasses in --json), to select in CSS and never to write in markup (DEK010). The tokens are the ones the bare .slide rule sets, which every slide can var(). With a layout, print its example markup, ready to paste into slides/<id>.html. A layout whose name is no plain word, such as one holding a space, a quote, $, ;, or a backtick, is left out of the list and of layouts in --json, and counted as unprintedLayouts, so a ref's theme cannot put text of its own into what dek prints.
dekc check [deck] <slug> [--shot] [--voice]Lint one slide: the findings with that slide's scope, including rendering rules when Playwright is available. Findings about the deck (theme.css, the frontmatter, the length) or the project are dekc lint's; see Scope. The project's plugins run too: their findings on the slide, and their errors on no slide. --shot writes a screenshot and returns its path. With Playwright, fill says how much of the frame the slide fills at its last beat: coverage, the share the content covers; box, the smallest box holding it; and rows and columns, the share of each tenth of the frame top to bottom and left to right, all from 0 to 1. It counts what the audience reads or looks at: each text's lines, each picture (an image, an SVG, a video, a canvas, a url() background image), and each painted box that holds nothing, as a chart's bar or a swatch. A painted box that holds something, a card or a window, counts by what it holds, so one whose words sit in its top half leaves the rest empty. Decoration under aria-hidden counts too, since the audience sees it take its place; ::before and ::after text and what the beat has not shown yet count for nothing. Judge a slide by rows, columns, and box, where an empty band is a run of zeros, not by coverage alone: a chapter door in large type and a dense slide can share it. The text output names each empty band as a margin at an edge or a gap between content. --voice returns kana and durations; on a deck without voice/ it lists voice in skipped with how to set it up, and the rest of the check still runs.
dekc shot [deck] [slug] [--step ID|N]Screenshot one slide, or every slide, at the last beat by default; --step 0 is the slide as it arrives, before any beat. Files are .cache/shots/<slug>~<step>.<hash>.png, where <step> is the beat id or number shot (the last beat by default), so --step hook, --step 1, and the default still share one file when they name the same beat; the hash is of the rendered content, so a changed theme or slide yields a new path and the stale image is removed. An unchanged slide keeps its image and is not shot again.
dekc shot [deck] --sheetEvery slide at its last beat, tiled on contact sheets at .cache/shots/sheets/<hash>/sheet-<n>.png. The tiles are as large as fits the whole deck on one image of at most 1568 px a side and 1.15 megapixels, which vision models read without scaling it down; a longer deck takes more sheets. The tiles are the slides' own shots, so an unchanged deck starts no browser, and --json lists each shot too.
dekc shot [deck] <slug> --motion [--step ID|N]A row for the slide's arrival and one per beat, each played from the beat or slide before it and held at 0, 25, 50, and 75% of everything that move starts, then at its end, the still dekc shot takes. Written to .cache/shots/motion/<slug>.<hash>/: the sheets as sheet-<n>.png, the frames under frames/. With --json, motion lists each beat in order, its step and its frames, each with its path and ms and end: true on the settled one, and sheets the sheets; shots is empty. --step plays that beat alone.
dekc shot [deck] <a> --to <b> [--at 0..1]One frame of the View Transition from the last beat of a into b, frozen at --at (default 0.5) of the transition's length; an entrance on b may still be running at --at 1, which --motion shows. Written to .cache/shots/<a>~<b>~<at>.<hash>.png. Does not combine with --step.
dekc mv [deck] <old> <new>Rename a section id, its HTML file and data-slug, its .css and .ts if present, and its keys in voice/voice.toml. Heading text is untouched. Refuses if any destination exists; all files change or none do. The rename is also added to .dek/renames.json, by deck, with when it was made, so comments on dek.pub follow the slide to its new id; commit the file with the project. A reorder adds nothing. A rename you made by hand, heading and files, is recorded once when you run dekc mv after it, however often you run it.
dekc mv [deck] <slug> --before|--after <slug>Reorder a section in script.md.
dekc goto [deck] <slug>Jump the open browser. Requires a running dev server, and gives up on one that does not answer within 10 s. viewers in --json counts the pages that show the deck; with none, the position is where the next page opened lands, and dek says so on stderr. url is the deck's page on that server, at 127.0.0.1, to open in a browser; it never holds the --remote password.
dekc current [deck]Print the slide on screen. Requires a running dev server, and gives up on one that does not answer within 10 s. viewers counts the pages that show it; with none, nothing is on screen, and the slide printed is where the next page lands, as stderr says. url in --json is the deck's page on that server, as for goto: the way to learn where a running server is.
dekc marks [deck]List the beats marked to rewrite while rehearsing: press m in the presenter view, or the mark button in its bar, on a beat you stumble over. Each mark gives the heading's line in script.md, was (the beat's words when it was marked), text (its words now), and status: open, edited once the words changed, or gone once no beat by that name is left. A mark follows its beat by the beat's id, or its title, so beats added before it do not move it. Marks are kept in .dek/marks.json; marking needs the dev server.
dekc marks [deck] clearDrop the deck's marks, once they are dealt with. cleared in --json counts them.
dekc annotations [deck]List the notes written on elements of the slides in annotate mode: press a on the dev server's page, or the annotate button in the presenter bar, then click what should change. Each note gives its number, as the page's markers show it, the step it was written at, the human's text, the shot command that shows that beat, and its targets: for each element the path, line, and column of its start tag in the file now, its name (the tag and its classes as written there), was (its text when the note was written), text (its text now), its box on the slide when noted, and whether it was found. status is open while the slide's own slides/<id>.html, .css, and .ts are as they were, edited once one of them changed (changed names which), or gone once none of the note's elements is on the slide or the slide left the script. edited says the slide changed, not that the note was dealt with: compare shot with the note. Each element is matched again as the file is now: at the same place with the same name and text, else the only one with that name and text, else at the same place with the same name, else at the same place with the same tag, its classes changed. Where it was found is written back, so a note follows its element from one edit to the next. Notes are kept in .dek/annotations.json; reading them needs no dev server, writing them needs the page.
dekc annotations [deck] clearDrop the deck's annotations, once the human has seen them dealt with. cleared in --json counts them.
dekc sync [deck] [--accept <plugin>]Create missing skeleton slides, refresh skeletons nobody has edited since, remove untouched skeletons whose section is gone (unless a slides/<id>.css or .ts sits beside them), and refresh dek's own files: dek's block in AGENTS.md, .dek/schema.json, and .dek/slide.d.ts. These follow the installed dek and the project's refs, not any deck, so they change only after either does, and the first command to run then, whichever it is, lists them as updated. A .gitignore that does not ignore the files dek keeps for itself, .dek/server.json, .dek/marks.json, and .dek/annotations.json, gets them added at its end and is listed as updated; a project with no .gitignore is left without one. Never touches a slide you edited, what you wrote in AGENTS.md outside dek's block, or tsconfig.json. A slide whose section is gone but that holds your edits is kept and named on stderr with what to do, and lint reports it as DEK002. For each plugin dek.toml names, it first asks dek-<name> for its manifest and pins it in plugins/<name>/plugin.json; a manifest that differs from that lock is listed on stderr with what changed and pinned only with --accept <plugin>, and a plugin it cannot find or read is named with why. Only this command runs a plugin; the dev server's sync does not. --json returns created, updated, removed, and kept, and plugins, each with its status, when dek.toml names any.

Output ​

CommandPurpose
dekc lint [deck] [--fix] [--visual] [--format sarif]Lint. --fix runs dekc sync first. --visual adds overflow, contrast, line breaks, and alignment. Each plugin the project pinned checks every deck too, under its own rule ids; one that cannot run is listed as skipped.
dekc cues [deck]Print the spoken cues as Cue[]. Paragraphs only. No engine needed.
dekc voice [deck]Synthesize changed sentences into .cache/voice/. Also runs on save. Gives up on an engine that takes more than 10 s to list its speakers or name its version, 60 s to read a sentence, or 5 minutes to speak it.
dekc voice [deck] speakersList the engine's speakers.
dekc voice [deck] say <text>Speak one sentence, kept at .cache/voice/say.wav. With --json it is written and not played: the result names the file.
dekc voice [deck] dict add <word> <kana> [--accent N]Add a reading to voice/dict.toml, with the accent position when given.
dekc voice [deck] pinCopy the master audio and timeline.json into voice/pin/.
dekc build [deck] [--root-dist] [--url <url>] [--public] [--no-script]Write one HTML file to decks/<deck>/dist/<deck>.html, or <root>/dist/<deck>.html with --root-dist. Slide stylesheets and scripts are inlined. Lint never stops a build: a section with no HTML is built from its skeleton, a slide script that cannot run (DEK016) is left out and its slide built without motion, and when dek's rules find something (rumdl is dekc lint's alone), the output says how many and --json includes the diagnostics. The page carries link preview tags; given the URL dist/ is served from (url in dek.toml, or --url, which wins), the first slide also becomes dist/<deck>.png for og:image. See On the web. --public builds a page for anyone who has the link: its presenter view leaves out the script's stage directions and HTML comments. Without it, the presenter view carries the whole script, a URL or not. --no-script builds the slides alone: the page carries no script at all, not even the beats' headings, and has no presenter view; it is what dek.pub shows readers of a deck whose script is not public. --json returns outs, images, diagnostics, and slideMaps, one map per deck in the order of outs: its deck, the built file as out, and each slide's slug, title, the heading's line in script.md, its steps as dekc shot --step takes them (0 as the slide arrives, then each beat's {#id} or number, with its title), its script as Markdown, and the paragraphs said aloud as plain text. The script is the one the page carries, so with --public it has no stage directions.
dekc video [deck] [slug] [--fps N] [--root-dist]Bake dist/<deck>.mp4 with .vtt, .chapters.txt, and .credits.txt, from the Timeline dekc voice writes. One slide goes to .cache/video/<slug>.mp4. --fps defaults to 30.
dekc pptx [deck] [--root-dist] [--public]Write dist/<deck>.pptx: one slide per ## at its last beat, and its script in the notes. Boxes with no more than a color, a solid border, and round corners are shapes, each <img>, <canvas>, and <svg> a picture of its own, grouped with what they hold, the text in a shape its paragraphs, other text a text box a block, each broken where the browser broke it, the slide's heading its title, and what ::before and ::after write text too, over a picture of the rest drawn at twice its size; a box stays in that picture when laying it over would cover something that stays drawn. The theme's tokens are the file's theme, and a plain or straight-gradient background PowerPoint's. The output names each slide where nothing came out of the picture. --public leaves the stage directions and comments out of the notes, as build --public does. Each text names the fonts Chromium drew it with, or the theme's, and is spaced character by character as the browser's features set it; no font is embedded. See PPTX. A slide script that cannot run stops it, as it stops dekc pdf. --json returns outs. Requires Playwright.
dekc pptx [deck] spec [--public]Write .cache/pptx/ in the deck's folder, for an agent that builds the PPTX again to be edited: deck.pptx.json, the file dekc pptx would write as JSON, and its schema, which is also published at deck.pptx.schema.json; spec.json, each slide's elements in reading order with their boxes, paint, and text, its shot, and its notes; and parts/, each image and each part no shape can draw, drawn alone. See Build it again to edit. --json returns spec, start, slides, and parts. Requires Playwright.
dekc pptx [deck] --from <file> [--shot] [--root-dist]Write dist/<deck>.pptx from that JSON as edited, and check it against spec.json: the diagnostics pptx-slides, pptx-title, pptx-text, and pptx-bounds are errors, pptx-place, pptx-fit, pptx-picture, pptx-lines, and pptx-notes warnings. With no spec.json, or one older than the deck, skipped says so. --shot draws each slide of the file with Quick Look, on macOS, and returns shots: each slide's picture, one beside the browser's with what differs in red, and their difference. --json returns outs, diagnostics, skipped, and shots.
dekc pdf [deck] [--root-dist]Write dist/<deck>.pdf with every slide at its last beat: each page a picture of the slide drawn at twice its size, a PNG, or a JPEG for a slide of photographs, with its text laid over it, unseen, to select, search, and copy, so it looks the same in every viewer. A slide script that cannot run stops it, as it stops dekc video: neither has findings to carry the news, and each would show the slide as if its script never ran.

Publish ​

dekc pub puts a talk on dek.pub: the slides, the script for those it is shared with, and comments on both. Each subcommand talks to https://dek.pub, or to the server --server <url> or DEK_PUB_SERVER names, over HTTPS, or plain HTTP to this machine only. It sends the API key dekc pub login kept, or DEK_TOKEN when that is for the server; a call that does not answer within 30 s, or 10 min for an upload, fails with a hint naming --server. An error dek.pub returns is printed as its message and hint. dek reads an answer it understands only in part, one with fields a newer dek.pub added, and leaves those fields out. What a comment holds is written by other people, and --json says so of each such field.

CommandPurpose
dekc pub <subcommand>Alone, a usage error that names the subcommands.
dekc pub login [--server <url>]Sign in through the browser, with OAuth's device flow: dek prints a URL and a code, a person approves the code there, and dek keeps the API key dek.pub gives it, in the OS keychain, or in ~/.config/dek/credentials.json (mode 0600) where there is none. Text output prints the URL and the code on stderr and waits in the same run. With --json, a new sign-in returns at once, { "status": "pending", "url", "code", "expiresAt", "next" }, for an agent to show a person; the code is kept beside the credentials, and the next dekc pub login --json waits up to a minute for its approval: it returns { "status": "signed-in", "me", "stored" }, or the same pending answer again to run once more. A run that is stopped while it waits loses nothing: the next one waits for the same code until it expires. A code turned down or expired, or any other error the server gives for it, is forgotten, and the error says to run dekc pub login again. When DEK_TOKEN is set for the server, warning says it will be sent instead of the key kept.
dekc pub logout [--all] [--server <url>]Revoke the key login kept on the server, then forget it. revoked is what the server says: false with a reason when it no longer knew the key. A server that cannot be reached is no reason to keep it: the key is forgotten here, revoked is false, and reason says the key still works until it is revoked on dek.pub. A key in DEK_TOKEN is the user's own, and left alone. With --all, revoke every key of the account instead, on every machine and in CI, by sending the key there is here, DEK_TOKEN or the one kept: revokedKeys says how many the server revoked, the one sent included, and the key kept here is forgotten. Unlike a plain logout, it fails when the server does not revoke them, and keeps the key, to run again; with no key it says to sign in first, or to revoke the keys on the server's /settings.
dekc pub whoami [--server <url>]Who the key signs in as, and where it came from in key: env (DEK_TOKEN), keychain, or file.
dekc pub publish [deck] [--message <text>] [--slug <slug>] [--server <url>]Lint the deck as dekc lint does, without the rendered rules; an error stops it with "ok": false, "published": false, and the diagnostics, and exit 1, with nothing sent. A title: over 500 characters, or a description: or --message over 2000, which dek.pub would not keep, is refused before anything is built or sent, with what to shorten in the hint. Then build the talk three times, into .cache/pub/: full.html with the whole script (uploaded alongside the others, not yet served); public.html with what is said aloud, as dekc build --public builds it; bare.html with no script, as dekc build --no-script. Take a picture of each slide at its last beat, as dekc shot takes it, and of the first for the link preview, unless Playwright is missing, which skipped says as shots; and write source.tar, every file under the deck but dist/, .cache/, and dot files, with effective-config.json, the dek.toml values in effect, the same bytes for the same files. A deck whose script.md has no pub: is made on dek.pub first, at the slug --slug names, else the folder's name in lowercase, or deck- and eight hex digits for a name with no ASCII letter or digit; a slug the account already has is refused, with --slug in the hint. pub: is then written into the frontmatter, every other byte as it was: frontmatterWritten is true and changed names script.md, to commit. The version goes up with the public build's slide map, made from script.md as written, the counts of what lint found, every slug dekc mv recorded renaming (the server takes each once), and --message. A version over 50 MiB, every build, the source, and the pictures together, is refused before it is sent, with its largest parts in the hint. So is one whose manifest, the slide map with every script and the renames, is over 4 MiB. It becomes the one readers see at once, and the version before it is deleted from dek.pub; the threads opened on it stay, placed on the new one. A version published since this run looked is refused, with dekc pub status in the hint.
dekc pub share [deck] [--visibility team|private|link|public] [--script shown|hidden] [--embed on|off] [--comments off|signed-in] [--new-link] [--server <url>]Change who may open the deck (team, its owner and the team's side of the people it is shared with, as a new deck is; private, its owner and everyone it is shared with, the guests too; link, anyone with the link; or public, everyone), whether readers see the script without its stage directions, whether other sites may embed it, and who may post comments at the bottom of a link or public talk; the review threads are for the people the deck is shared with, whatever --comments says. A link deck's url carries its key as ?key=, made the first time the deck becomes link and kept through other visibilities; --new-link replaces it, and the URL given out before opens the deck no more. Only the settings given change; none is an error. Prints the deck as status does. A deck with no pub: is refused, with dekc pub publish as the hint, as by every subcommand below.
dekc pub status [deck] [--server <url>]The deck as dek.pub has it: its URL, settings, and current, the version readers see. local.source is the sha256 of the source publish would send now, and local.published whether the current version was made from it.
dekc pub open [deck] [--server <url>]Print the deck's URL and open it in the browser, when it is an http or https page on the server asked; with the program BROWSER names, else open on macOS and xdg-open elsewhere. With --json, only the URL, and nothing opens.
dekc pub comments [deck] [--status open|resolved|all] [--server <url>]List the comments, open ones unless --status says otherwise, each as dek.pub has it, as dekc annotations lists a note: its number, its scope (team for a thread the deck's team keeps to itself, shared for one its guests read too), slug, step, status (open, moved when its slide was found again only by a rename or a guess, detached when its passage or element is not on the slide now, resolved), author, text, and replies. Each quote of the script gains where it is in script.md now, path, line, and column, or null and found: false; each element, its slide's file as path and whether it is there as found, or null when the comment names no slides/<slug>.html. shot is the command that shows the slide at the comment's beat. Each scope is numbered on its own, and a team thread's number is printed with a T, as T2.
dekc pub comments reply [deck] <id> <text> [--server <url>]Reply to a comment, named by its ID or by its number, 3, or T2 for a team thread. A word before the ID that names a deck is the deck, wherever dekc runs.
dekc pub comments resolve [deck] <id> [--server <url>]Mark a comment resolved.
dekc pub comments reopen [deck] <id> [--server <url>]Open a resolved comment again.
dekc pub grants [deck] [--server <url>]Who the deck is shared with, oldest grant first, as its manage page lists them: each grant's id, who (a handle, or an email address for a grant no account has claimed yet, or claimed by one that has not chosen its handle), role (view or comment), side (team or guest), and createdAt. Only the deck's owner may list them.
dekc pub grants add [deck] <who> [--role view|comment] [--side team|guest] [--server <url>]Share the deck with who, a handle with or without @ or an email address, or change what an earlier grant to them allows. A new grant is view on the guests' side unless the flags say otherwise; for one already made, what the flags leave out stays as it was. invited is true when the grant is new, and dek.pub has mailed the person an invitation; a change is mailed to no one. The owner's new grants mail at most 20 invitations in any 24 hours; past that a new grant is refused and nothing is made, with the time in UTC after which the next can go in the hint. One who is shared with at a time. A grant by an address an account has verified is tied to that account at once, and grant.who names it by handle once the account has one.
dekc pub grants remove [deck] <who> [--server <url>]Stop sharing the deck with who: a handle, the address a grant waits on, or a grant's id. A grant by address an account has claimed is listed, and removed, by its handle once the account has chosen one. A who the deck is not shared with is refused before anything is removed, with dekc pub grants in the hint.
dekc pub delete [deck] --yes [--server <url>]Delete the deck on dek.pub for good: every version, review thread and reply, public comment, like, mute, and grant on it, and its pictures and builds. Its talk page, pictures, build, and every API route keyed by it answer 404 after, and its slug is free. Only its owner may. Without --yes nothing is sent, and the error says to run it with --yes. Then pub: is taken out of script.md, every other byte as it was, and changed names script.md, to commit, so the next publish makes a new deck; id, owner, and slug say which deck went. A deck dek.pub does not have, or that is not the caller's, is refused with pub: left as it was.
dekc pub takedown <talk> --yes [--server <url>]Delete a talk named by its URL on the server, /@handle/slug with or without ?key=, or by its deck ID, d_…, as delete does, from any directory: for an operator of dek.pub, whose verified email address the server's DEK_PUB_OPERATORS lists, to take down anyone's talk. Its owner may too. A URL on another server or that names no talk is refused before anything is sent, as is a run without --yes. Returns the id, owner, and slug deleted; no file is changed. Anyone else gets the 404 of a talk that is not there.

A deck may not be named pub, or after any other command: dekc new and dekc init refuse it, since dekc pub runs the command, not the deck. A deck already named pub is served with dekc --deck pub, which the bare dekc pub names in its hint.

Help ​

CommandPurpose
dekc help [command] [--agent]Help, or one command's usage and flags. --agent is the compact reference for agents. A word that is no command fails as dekc <word> does, with did you mean …?.

Environment variables ​

dek reads its DEK_ variables only from the environment it starts in, never from a project's files. dekc runs Bun with --no-env-file --config=/dev/null, as does every bun dek starts, so neither a .env nor a bunfig.toml in the working directory applies. When Bun loads .env files anyway, as bun ./node_modules/.bin/dekc does, dek ignores every DEK_ variable, and NODE_TLS_REJECT_UNAUTHORIZED, that .env, .env.local, or the .env.<mode> and .env.<mode>.local files for development, production, and test name, and says so. That launch still reads bunfig.toml; see A project you did not write.

VariablePurpose
DEK_ALLOW_UNSANDBOXEDSet to 1 to accept that Chromium draws without its sandbox where the sandbox does not start, as in a container running as root: dekc shot <ref> then draws the ref, with a warning each run, and the project's own decks no longer warn. --json still says unsandboxed. dek asks for the sandbox first either way.
DEK_FFMPEGPath to the ffmpeg binary that dekc video muxes with, instead of ffmpeg on PATH.
DEK_GITHUB_APIBase URL of the GitHub API that dekc ref fetches from. No token is sent to it.
DEK_PLAYWRIGHTPath to an alternative Playwright worker script.
DEK_PUB_SERVERThe dek.pub dekc pub talks to, instead of https://dek.pub; --server wins. HTTPS, or plain HTTP to this machine.
DEK_TOKENThe API key dekc pub sends, over the one dekc pub login kept, for CI: to https://dek.pub only, unless DEK_TOKEN_SERVER names another.
DEK_TOKEN_SERVERThe server DEK_TOKEN is for, instead of https://dek.pub; to any other, DEK_TOKEN is not sent.
DEK_PUB_CREDENTIALSThe file dekc pub keeps its key in, instead of the OS keychain: dek then never asks the keychain. dek reads a credentials file only when it is the user's own and no one else may read or write it.
BROWSERThe program dekc pub open opens the deck with, instead of open or xdg-open.
GITHUB_TOKENToken dekc ref sends to api.github.com, for private repositories and a higher rate limit.
GH_TOKENRead as GITHUB_TOKEN when that is unset.
DEK_RUMDLPath to the rumdl binary, ahead of PATH and the node_modules/.bin beside dek's own install.
DEK_VIDEOPath to an alternative video capture worker, used instead of the Playwright worker.
DEK_VOICE_PLAYSet to 0 to keep dekc voice say from playing the audio it synthesized. With --json it never plays it.
DEK_VOICE_URLBase URL of the speech engine, overriding voice.toml.
NO_COLORSet to turn colored output off, ahead of FORCE_COLOR and CI.
FORCE_COLORSet to color output even when it is not a terminal.
CISet, as CI services do, to turn colored output off unless NO_COLOR or FORCE_COLOR decides first.

Released under the MIT License.