Skip to content

CLI (`bynkc`)

The Bynk compiler

Run bynkc <command> --help for the authoritative help text.

A diagnostic’s severity decides whether it fails a build (v0.89). An Error rejects the program: bynkc compile/check exit non-zero and produce no output. A Warning is surfaced but does not fail the build: these commands still succeed (exit 0) and emit their output, with warnings reported alongside. The build-failure gate counts error-severity diagnostics only. See the normative rule in the specification and the diagnostic index (warning-severity codes are marked (warning)).

Type-check a .bynk file or project without writing output

bynkc check <INPUT> [--format <FORMAT>]
ArgumentRequiredDefaultDescription
INPUTyesInput .bynk file or project root
--formatnorichDiagnostic output format. rich (default) is the ariadne source-context rendering; short emits one terse path:line:col: severity[category]: message line per diagnostic, for tooling (the VS Code problem-matcher, CI, scripts) (one of: rich, short)

Compile a .bynk file (single-file commons) to a TypeScript file, or a directory project to a tree of TypeScript files mirroring the source layout

bynkc compile <INPUT> --output <OUTPUT> [--target <TARGET>] [--platform <PLATFORM>] [--emit <EMIT>]
ArgumentRequiredDefaultDescription
INPUTyesInput .bynk file, or directory project root
--output (-o)yesOutput .ts file (for single-file input) or output root directory (for project input)
--targetnobundleBuild target. bundle (default) produces a single deployment unit; workers produces one Cloudflare Worker per context with Service Binding plumbing (v0.8) (one of: bundle, workers)
--platformnocloudflareDeploy platform selecting the bynk surface binding (v0.17). A new axis, distinct from --target: cloudflare (default), node, or browser (the in-browser playground binding; Bundle topology only) (one of: cloudflare, node, browser)
--emitnotsArtefact language (v0.108). ts (default) writes typed TypeScript; js writes the same modules with types stripped — a JavaScript artefact that runs with no tsc in the loop (ADR 0137) (one of: ts, js)

Format .bynk source files in place. Passing - reads from stdin and writes to stdout

bynkc fmt [INPUTS] [--check]
ArgumentRequiredDefaultDescription
INPUTSnoFiles to format. Use - for stdin → stdout
--checknoCheck formatting without writing changes. Exits non-zero if any file is not already canonical

Discover and run test declarations in a project. Compiles the project (including all generated tests/*.test.ts modules), then invokes Node.js on the aggregated runner script. Requires tsc and node to be on PATH

bynkc test [INPUT] [--output <OUTPUT>] [--no-run] [--format <FORMAT>] [--inspect]
ArgumentRequiredDefaultDescription
INPUTno.Input project root directory. Defaults to the current directory
--output (-o)noWhere to write compiled TypeScript test runner modules. Defaults to <input>/out
--no-runnoSkip the runner invocation. With --format rich this emits the generated test files (for CI flows that drive the runner separately); with --format json it emits a discovery document listing every suite and case (each outcome: "discovered") without running them — a pure compile, no tsc/Node
--formatnorichOutput format. rich (default) is the grouped ✓ / ✗ human output; json is a single pinned JSON document of results, for tooling (one of: rich, json)
--inspectnoCompile a debug build and launch the test runner under Node’s inspector (node --inspect-brk), printing the inspector URL for a JavaScript debugger to attach (slice 2, ADR 0104). The emitted .ts runs directly under Node’s line-preserving type-stripping, so source maps resolve breakpoints back to .bynk. Requires Node ≥ 22.18 (or ≥ 23.6 unflagged). Does not run tsc