beck / Command referenceSource

Command reference

Read from the same command tree that parses the arguments.

Exit status

StatusMeaning
0The command did what was asked.
1The command ran and the answer is no: a program that does not compile, a test that failed, a file that could not be read.
2The invocation was wrong — an unknown subcommand, an unknown flag, a missing argument. `clap`'s, and the POSIX convention.
101The compiler panicked. That is a bug in this binary rather than in the program it was given, and it is Rust's own status for one.

beck check

Typecheck, infer and verify placement, and slice the signal graph

Argument
<FILE>FILE
--assert-placeNAME=TIERAssert where something runs: `--assert-place page=client`. §3.4's assertability guardrail — a placement a test depends on should fail the build when it moves, not surface as a latency regression
--write-locktrue \| falseWrite the solved placement to `beck.lock`
--lockedtrue \| falseFail if the solved placement differs from `beck.lock` — the CI form of §3.4's stability guardrail
--wire-compatPREVIOUS.beckiCompare this module's contract against a previously released `.becki` and fail on a breaking change (§4.3). The check CI runs before a rolling deploy
--breakingtrue \| falseAccept the breaking changes `--wire-compat` finds. §4.3's explicit marker: a breaking release is allowed, and saying so is the point

beck fmt

Print a program in either surface. `beck fmt` on commit normalises to `.beck` (§2.2)

Argument
<FILE>FILE
--surfacepy \| sexpr
--writetrue \| falseRewrite the file in place

beck iface

Write the module's published signature — the `.becki` of §3.6.

Generated, checked in, and reviewed like an .mli: it is what downstream modules compile against, and the file `beck check --wire-compat` compares releases of.

Argument
<FILE>FILE
-o, --outOUTWhere to write it. Defaults to the source file with a `.becki` extension
--stdouttrue \| falsePrint it instead of writing it

beck ast

Dump the canonical AST — the notation macro authors work in (§2.7)

Argument
<FILE>FILE
--expandedtrue \| falseShow the tree after macro expansion rather than as written

beck explain

Interrogate a compiler decision (§4.7)

beck explain place

Where each definition runs, and why (§4.7)

Argument
<FILE>FILE
<NAME>NAMEOne definition or signal, with its candidates and their costs

beck explain wire

The command channel's content-derived operation id (§4.3)

Argument
<FILE>FILE

beck explain render

Where a component renders, why, and what that puts on the wire (§5.1).

Mode A sends the browser a rendering of the state; Mode B sends it the state and renders locally. This prints which one, what decided it, what crosses, whether the client may apply a command optimistically — and, for a Mode B component, the size of the bundle it would have to download.

Argument
<FILE>FILE

beck explain flow

The signal graph, and what the splitter made of it — or, given a type, everywhere that type reaches and everywhere it is refused (§4.7)

Argument
<FILE>FILE
<TY>TYA type name: `beck explain flow ApiKey`

beck explain incremental

Which views a dataflow plan could maintain by delta, and why the rest could not (§3.8).

The analysis rather than the plan: it asks whether a *view* is built only from operations with delta rules, and `beck explain query` prints the operators the view actually compiles to. A view this reports as `recompute` may still have its collections maintained around whatever blocked it.

Argument
<FILE>FILE
<VIEW>VIEWOne view, by the name `beck explain flow` gives it

beck explain query

The view as a dataflow plan, and what query fusion made of it (§4.7, §5.3).

Every operator, what it reads, what orders its arrangement and which side of the session cut it is on — then the rewrites that fired, and the ones that matched a rule and were refused, with the condition that refused each.

Argument
<FILE>FILE
--unfusedtrue \| falseThe plan as the decomposition produced it, before any rewrite — one operator per construct the source names, which is what the rules are applied to
--no-jointrue \| falseLeave a loop that looks something up as the loop it was written as, rather than reading it as an equi-join and indexing what it reads (§99.6). The off switch for a choice the compiler makes unbidden. Printing the plan both ways is how to see what the operator is worth on your program.

beck explain cost

What one event costs this program's view, operator by operator (§4.7).

In the engine's own units — applications, entries touched, entries copied, operators recomputed — as a function of the change `δ` and the collection `n`, so the answer is the same on every machine.

Argument
<FILE>FILE
--no-jointrue \| falseThe same, with the join recognition switched off — what one event costs the program as its loops are written, with nothing indexed

beck explain sql

The read model: what an outside SQL client sees, as `create table` (§5.3).

Nothing executes this DDL. There is no table to create — a read model is the collection the fold already holds and the arrangement the view engine already maintains, projected — so this is the shape of the relations `beck run --pgwire` serves rather than a migration.

Argument
<FILE>FILE
--queryQUERYA `select` to compile, instead of the schema to print. A join, a `group by` and a `distinct` are compiled into the view plan rather than interpreted, so what this prints is the same operator report `beck explain query` prints for a page — the index a join builds, whether a group is built at all, and what the `where` was pushed into (`docs/99` §99.9 item 9).
--no-jointrue \| falseLeave the loop a join compiles to as the nested loop it literally is, rather than reading it as an equi-join and indexing what it reads (§99.6). The off switch, on this surface too: printing a query's plan both ways is how to see what the operator is worth on your data.

beck explain style

Every class the program's pages can carry, and every place one is built rather than named (`docs/104` §104.4).

The compiler resolved the program, so it knows the strings that can reach a `class=` — across a module boundary, and without a scanner or a safelist. What it prints is that set, and the sites where a class is assembled at run time instead, which are the ones a stylesheet emitted from this could not cover.

Argument
<FILE>FILE

beck explain deploy

The infrastructure the program's effects imply (§6.5)

Argument
<FILE>FILE

beck explain error

What a diagnostic code means — `beck explain error B0341`

Argument
<CODE>CODEThe code, as it appears in the diagnostic: `B0341`

beck graph

Every part of the program and the infrastructure it implies, and what depends on what.

The same model the dashboard draws, as text — because a graph is more useful to a tool than to an eye, and the tool is usually the point.

Argument
<FILE>FILE
--jsontrue \| falseEmit the model as JSON instead of a table
--typestrue \| falseInclude types, which are the noisiest and least often the question

beck impact

What breaks if this changes — transitively, across code *and* infrastructure

Argument
<FILE>FILE
<NAME>NAMEA definition, a signal, a type, or a resource as `Kind/name`
--jsontrue \| false

beck test

Run the program's own `test` and `property` blocks (§21.2).

A test is a log, a command and an expectation, so this needs no network, no database and no browser: the tiers are co-located and the roles are the ones the runtime drives.

Argument
<FILE>FILE
-f, --filterFILTEROnly run tests whose name contains this
-v, --verbosetrue \| falseSay what was stubbed even when the test passed — §21.3 rule 1's hidden default, declaring itself
--runsRUNSInputs per `property` block
--fuelFUELEvaluation steps one expectation may take before it is stopped. The default is a runaway-program backstop and is right for everything written by hand. A *benchmark* is the exception — three of the fourteen in `awfy/` need more at the size their suite measures at (`docs/53` §53.3), and a backstop nothing can raise is a ceiling.
--updatetrue \| falseWrite what `expect page matches snapshot` renders, instead of comparing against it. The written file is reviewed like any other diff (§21.2). Nothing writes a snapshot without this flag: one that rewrote itself on disagreement would assert nothing.

beck run

Run the program in a single process — rung 0 of the parity ladder

Argument
<FILE>FILE
--addrADDR
--storeredb \| sqlite \| postgres \| memory
--pathPATH
--urlURL
--pgwireADDRAlso serve the read models on the PostgreSQL wire protocol (§5.3). Off by default, and loopback only: the port answers every question about the application's state, and it has no authentication and no transport security. Forward it rather than exposing it.
--client-idIDThis application, as its identity provider knows it. The **issuer** is not a flag: a program says who authenticates its clients with `identity = external(issuer="https://…")`, because §6.5 derives the cluster's egress rule from the peers a program names and a flag is not one of them. A client id is a deployment fact — staging and production register different ones — so it is here.
--client-secretSECRETThe client secret, for a confidential client. Read from the environment because a secret on a command line is a secret in the process table
--redirect-uriURLWhere the issuer sends the browser back — the redirect URI registered with it. Defaults to `http://<addr>/auth/callback`, which is what a laptop needs and what a deployment behind a gateway must override, because the address this process bound is not the address a browser typed.

beck replay

Fold a recorded log and report the state it produces (§3.7)

Argument
<FILE>FILE
--storeredb \| sqlite \| postgres \| memory
--pathPATH
--urlURL
--genesistrue \| falseIgnore snapshots and fold from the first event — D3's genesis-replay discipline
--verifytrue \| falseFold twice and compare; also compare the snapshot path against a fold from genesis
--toTOStop at this position

beck build

Emit the deployable system: the object graph and the image config (§4.1 stage 11)

Argument
<FILE>FILE
--outOUT
--platformPLATFORMWhich deployment target to render for (§6.1's `Platform`): `kubernetes` or `compose`

beck native

Compile what can be compiled to native code, and say what could not (§5.2).

§5.2's dual codegen, over the scalar subset of the language: a definition whose parameters and result are `Int`, `Float` or `Bool` and whose body is arithmetic, comparison, `if`, `match` and direct calls. Everything else — anything that needs a heap, and every effect — stays with the evaluator, and this prints which went which way.

`--backend llvm` (the default) needs `clang` on the path, or `BECK_CLANG` pointing at one. `--backend cranelift` needs only a linker, because Cranelift is a crate. `--backend wasm` needs nothing at all and produces nothing this command can run: a WebAssembly module is loaded by whoever is going to call it, which for Mode B is a browser, so it writes the module and its listing and stops.

Argument
<FILE>FILE
--backendBACKENDWhich code generator: `llvm` for release code, `cranelift` for a fast build (§7.3), `wasm` for the tier a person is sitting in front of (§5.1)
--outOUTKeep the generated IR and the executable here instead of in a temporary directory
--callCALLCall a compiled definition and print what it answered. `beck native fib.beck --call fib --arg 30`. An argument is read as an `Int` if it looks like one and a `Float` otherwise; `true` and `false` are `Bool`s.
--argARGS

beck bundle

Write a Mode B component's bundle — the slice a browser downloads (§5.1, `docs/94` §94.6).

This is not how a deployment gets one. `beck run` derives the bundle from the program it is executing, so a served slice cannot be of a different program than the running one, and `beck build` deliberately writes no bundle for the same reason. This is how a *measurement* gets one: §5.1 budgets "< 150 KB brotli for a typical Mode-B component bundle", and a budget nothing can weigh is not a budget.

A Mode A component has no bundle, and asking for one is an error rather than an empty file.

Argument
<FILE>FILE
-o, --outOUTWhere to write it

beck sbom

The bill of materials for what `beck build` emits, as CycloneDX 1.6 JSON.

Derived from the same object graph the image config is, so the two cannot disagree about what is in the image. `beck build` writes one beside the manifests; this prints it.

Argument
<FILE>FILE
-o, --outOUTWrite it here instead of to standard output

beck doc

Generate reference documentation — for a module, or for the language itself.

A module's page is derived from the module: signatures come from inference, effects from the row, placement from the solver, and prose from `##` doc comments. The language reference is derived from the compiler's own tables — the diagnostic codes it can emit, the predicate the placement solver evaluates, the schemes inference reads for the prelude, and this command tree.

beck doc module

One module's reference page: every published name, with its signature, effects and tier

Argument
<FILE>FILE
-o, --outOUTWhere to write it. One file per module, named after the module
--formatmd \| html \| json
--repoURLLink the page back to the repository it was generated from. HTML only
--stdouttrue \| falsePrint it instead of writing it

beck doc guide

A written guide, rendered for the published site.

The reference is derived from the compiler; a guide is written by a person and *checked* by a harness — every program in `docs/86-getting-started.md` is compiled and run by `beck-cli/tests/getting_started.rs`. This is what puts the checked file on the site instead of a second copy of it that nothing compiles.

Argument
<FILE>FILEThe markdown file
-o, --outOUT
--link-baseURLRewrite relative links against this URL — the *directory* the guide lives in, in the repository it is published from. Without it they are left as written, which is right for reading the file in place and wrong for a static site, where `08-roadmap.md` is not a page.
--repoURLLink the page back to the repository it was generated from
--stdouttrue \| falsePrint it instead of writing it

beck doc changelog

The changelog, assembled from `changelog/` — one file per change.

A change records itself by adding a file there and editing nothing else, so two branches never write the same line and their merge has nothing to resolve. This assembles those files into the flat newest-first list under `CHANGELOG.md`'s hand-written head.

Argument
--dirDIRThe directory of entries, one file per change
-o, --outOUTThe list to assemble. Everything above `## Unreleased` is written by hand and kept
--checktrue \| falseCheck what is checked in instead of writing it: the entries it carries must be a subsequence of the directory's — each the entry its file says, in order. Any may be missing, because demanding otherwise would make reassembling part of recording a change and put every branch back on the same line of the same file

beck doc reference

The language reference: the error index, the command reference, the effect and tier matrix, the prelude, and the forms.

Checked in under `docs/reference/` and regenerated by this command, so a change to the compiler that changes the reference shows up in the diff rather than in a stale page.

Argument
-o, --outOUT
--formatmd \| html \| json
--repoURLLink every generated page back to the repository it was generated from. HTML only
--checktrue \| falseRegenerate in memory and fail if what is on disk differs. The gate CI runs

beck bench

Measure the log against every substrate, so the store is a decision and not a habit

beck bench log

Append, read and encode, against memory, redb and — with a URL — PostgreSQL

Argument
--urlURLThe PostgreSQL log to include. Also read from `BECK_POSTGRES_URL`
--dirDIRWhere to put the temporary redb file

beck lsp

Serve the Language Server Protocol on stdin and stdout (§4.6).

The same front end `beck check` runs, so an editor's squiggle and a CI failure are the same diagnostic — §4.6's "there is no separate language server implementation to drift". Not meant to be run by hand: an editor starts it and speaks JSON-RPC to it.

beck image

Build the container image, in this process — no apko, no melange, no daemon (§6.2).

Resolves the packages `beck build`'s apko config names, fetches them from the Wolfi repository, unpacks them, adds the toolchain and the program, and writes an OCI image layout. The result is reproducible: the same inputs produce the same digest, which is the property §6.2 chose this image format for and which `beck image` run twice will show.

Argument
<FILE>FILE
--outOUT
--tagTAGWhat to tag the image in the layout's index
--archARCHThe architecture to build for, as the package repository names it
--repositoryREPOSITORYWhere the packages come from
--cacheCACHEWhere fetched packages are kept. A second build reads them from here
--offlinetrue \| falseBuild from the cache alone, and fail rather than reach the network
--binaryPATHThe toolchain binary the image ships. Defaults to the running one
--signKEY.pemSign the image as it is built, with this key

beck sign

Sign the image in an OCI layout, in the form `cosign verify` reads (§6.2)

Argument
<LAYOUT>LAYOUTThe layout `beck image` wrote
--keyKEY.pemThe private key. Read from `BECK_SIGNING_KEY` when this is not given

beck verify

Check a layout's signature against a public key — and that it is over *this* image

Argument
<LAYOUT>LAYOUT
--keyCOSIGN.pub

beck key

A signing key, and the public half a consumer verifies with

beck key generate

Write a new P-256 key pair: `<name>.key` and `<name>.pub`

Argument
-o, --outOUTThe name to write, without an extension

beck init

Write the files a repository needs around a Beck program

beck init ci

The continuous-integration workflow for this program (§28.3).

Check, test, wire-compat, build — then, from the default branch, an image and a signature. Written to `.github/workflows/beck.yml`, reviewed and committed like any other file.

Argument
<FILE>FILE
-o, --outOUTThe repository root to write into
--stdouttrue \| falsePrint it instead of writing it

beck play

Serve the playground: the compiler and a running application, in a browser tab (§17).

Rung A is the compiler compiled to WebAssembly — diagnostics, the two surfaces, inferred placement, the dataflow plan, the read model, the generated Kubernetes objects — with no server involved at all. Rung B runs the program *in the tab*: a log, a fold and two client subscriptions in one page, speaking the patch protocol over a `MessageChannel`.

Needs the module: `cargo build -p beck-play --release --target wasm32-unknown-unknown`, or `BECK_PLAYGROUND` pointing at one.

Argument
--addrADDR
-o, --outOUTWrite the playground to a directory instead of serving it. The result is the whole deployment — §17.1's "costs a CDN" is not a figure of speech, and this is what makes it checkable: a directory, on any static host.

beck up

Bring the program up on a local cluster or host — rung 2 or 3 (§6.6)

Argument
<FILE>FILE
--outOUT
--dry-runtrue \| falseEmit and validate the manifests without touching a cluster
--platformPLATFORM