Skip to main content

Crate bynk

Crate bynk 

Source
Expand description

bynk — the Bynk driver.

The compiler, linked in, and an orchestrator over the Node toolchain. The compiler stays pure (compile / check / fmt / test); environment orchestration — “is wrangler installed”, “is your machine ready” — lives here (ADR: introduce the bynk driver).

v0.46 ships the first command, doctor, an upfront environment check. The crate is deliberately split into single-concern modules (per ADR 0060):

  • probe — the portable detection primitive (presence + version + provenance), backed by the which crate so it is not Unix-only.
  • doctor — the capability model, the checks, and the exit-code contract.
  • report — render a doctor::Report as a human table, --format short, or --format json.
  • new — scaffold a new project (offline file-writing; no toolchain).
  • dev — build a project and serve it locally with wrangler dev.
  • tail — stream a deployed Worker’s logs with .bynk frames (#2546).
  • check / fmt / compile / test — type-check, format, compile and test in-process (v0.138, #487; #2998).
  • diagnostics — shared flatten-then-delegate rendering for in-process compiles; shell — child-process exit statuses.
  • migrate — bynk migrate status and sweep (state-migrations S4).
  • sweep — stopping what bynk dev’s wranglers leave running (#1742).
  • job — on Windows, the job object that stops a wrangler’s whole process tree (#1762).

Modules§

approve
bynk approve (packaging slice 5, #2296, decision D): review and approve the npm packages that fetched (git or registry) packages’ adapters bring into the build, recording each approval in bynk.lock.
book
bynk book — the Bynk Book as this toolchain documents it (#2463).
check
bynk check — type-check a .bynk file or project without writing output.
cli
The bynk driver command-line interface.
compile
bynk compile — compile a project (or one file) to TypeScript or JavaScript.
deploy
bynk deploy — provision persistent Cloudflare identity, then publish.
dev
bynk dev — build a project and serve it locally in one step.
dev_inspect
bynk dev inspect (#3581, the dev agent-inspection track): list the agent instances a running bynk dev session has seen, and read one’s stored state.
diagnostics
Project-failure rendering for the driver.
doctor
bynk doctor — the capability model, the checks, and the exit-code contract.
eval
bynk eval (#3585): evaluate a snippet in a unit’s scope in the project and print the value it ends in as one JSON document. The work is bynk_driver::eval::evaluate; this reads the snippet and the unsaved buffers and prints the result.
explain
bynk explain <code> — the compiler’s own explanation of a diagnostic code (#853), the analogue of rustc --explain.
fetch
Packaging slice 2b (#2240): fetching git dependencies and writing bynk.lock — the one place the toolchain touches the network (track design/tracks/packaging.md §6.4, decision A).
fmt
bynk fmt — format .bynk source files in place.
http_client
bynk client (#3508, BC1): a typed TypeScript client for a project’s from http services.
logs
bynk dev worker logs (#2474): each line a wrangler dev prints, with the stack frames that name generated TypeScript rewritten to the .bynk source line they came from.
mcp
bynk mcp — a stdio Model Context Protocol server (#2466).
migrate
bynk migrate: where each agent class’s stored state stands, and the sweep that migrates every stored instance and raises the class’s floor (state-migrations S4, #2259; the retired track’s summary in design/archive/retired-tracks.md, §3.3, §3.6).
new
bynk new — scaffold a new project.
openapi
bynk openapi (#856) — an OpenAPI 3.1 document for a project’s from http services, a lossless re-projection of facts the compiler already holds.
probe
The shared detection probe: presence + version + provenance.
ready
bynk dev --ready-json <FILE> (#2138, end-to-end testing track §3.5, DECISION F): a machine-readable readiness signal.
registry
Registries (packaging slice 4a, #2274; track design/tracks/packaging.md §6.1–§6.2): the client bynk resolves { package, version } dependencies with, and the reference tooling for a static registry.
report
Render a Report in one of three shapes.
shell
Child-process exit statuses — shared by dev and deploy, which run wrangler (#2998 removed the shelled bynkc they once shared with).
stop
Stopping bynk dev from outside (#1955).
sweep
Stopping what bynk dev’s wranglers leave behind (#1742).
tail
bynk tail (#2546): a deployed Worker’s logs, with the stack frames that name generated TypeScript rewritten to the .bynk line they came from.
test
bynk test — discover and run a project’s test declarations.
token
bynk token (#2869): mint a credential for the project’s own Bearer actor, for calling a guarded route by hand — curl under bynk dev, or a smoke test against a deployment.
trace
bynk dev --trace-events (#3580): the per-request trace a traced Worker prints, and the request event bynk dev makes of it.
workers
Shared Workers-build plumbing for bynk dev and bynk deploy.

Constants§

DRIVER_VERSION
The driver’s own version, from Cargo.