Check your environment with `bynk doctor`
Goal: find out whether your machine is ready to compile, test, and deploy Bynk — before you hit a broken command.
Bynk has a Rust side (the bynk compiler) and a Node side (tsc/tsx to run
the emitted TypeScript, wrangler to deploy to Cloudflare). bynk doctor
checks both in one go and prints the exact remedy for anything missing.
Understand — the toolchain has two halves.
bynkcompiles Bynk to TypeScript; that’s pure and needs nothing but the compiler. Running the output (bynk test) needs Node and a TypeScript runner; deploying needswrangler.bynk doctorgroups its checks along exactly those lines, so you are never told you’re “unhealthy” for lacking a tool you don’t need.
Run it
Section titled “Run it”bynk doctorYou’ll get a grouped report — one block per capability — showing each tool’s presence, version, and provenance, with a fix line under anything that isn’t ready:
bynk doctor — environment reportdriver: bynk 0.66.0compiler: in-process
✓ compile [ok] compiler — in-process✓ test [ok] node — v22.12.0 (path) tsc | tsx — tsc v7.0.2 (path)! deploy [warn] node — v22.12.0 (path) wrangler — provisionable via npx (not installed) ↳ fix: npm install -g wrangler@4, or clear a stale npx cache (~/.npm/_npx)· editor [note] (optional) bynk-lsp — missing ↳ fix: install bynk-lsp (or download from releases)The capability groups
Section titled “The capability groups”| Capability | Needs | Missing means |
|---|---|---|
| compile / check / fmt | nothing — the compiler is built into bynk | always available |
bynk test | Node ≥ 22.13 and tsc (TypeScript 7) or tsx | you can’t run test blocks |
| dev / deploy | Node ≥ 22.13 and wrangler (4.162.0 or newer) | you can’t deploy to Cloudflare |
| editor (optional) | bynk-lsp | a note — editor features only |
| build-from-source (optional) | a Rust toolchain | shown only inside the Bynk repo |
The test and deploy blocks end with a package manager row, naming the tool
bynk test, bynk dev and bynk deploy install a build’s npm packages with and
the rule that chose it, for example pnpm (pnpm-lock.yaml is at the project root).
It is informational: no package manager found is not a failure, since only a
project with npm dependencies needs one. See Installing npm
packages.
A node below the floor (Node 22.13: 22 is the oldest major still in
support, and 22.13 its first release to load node:sqlite without a flag) is
reported as a warning, v20.11.0 below floor (≥ 22.13), with the fix to install a
newer one. bynk test --inspect checks its own minor floor on top of that: Node
≥ 22.6 to run, ≥ 22.18 for source-mapped breakpoints.
An installed wrangler older than 4.162.0 is a warning too:
wrangler — v4.100.0 (path), below 4.162.0, the oldest this Bynk release supports: `bynk dev` may not serve compatibility date 2026-08-11, and agents can't deploy ↳ fix: npm install -g wrangler@4Until v1.0.0 the minimum tracks the newest wrangler at each Bynk release. Every
generated wrangler.toml pins a compatibility_date, and an older wrangler’s
runtime can refuse a newer date outright. It doesn’t fall back, so bynk dev
would fail. bynk dev prints the same warning before it serves. A
wrangler that doctor would fetch with npx can’t be versioned without running
it. If bynk dev then fails with “This Worker requires
compatibility date …”, the npx cache holds an older wrangler: clear
~/.npm/_npx, or install one with npm install -g wrangler@4. (Under pnpm, bun
or Yarn, the fix is that tool’s install command, such as pnpm add -g wrangler@4.)
An older wrangler also can’t deploy an agent. Every generated wrangler.toml
declares its Durable Object classes in an exports map, which wrangler reads
from 4.107.0, and the generated configuration is untested below the minimum, so
bynk deploy refuses to push a context with an agent on an older one, naming
the version and the fix. A project with no agent still
deploys, which is why doctor keeps this a warning rather than failing
--only deploy.
The emitted TypeScript is verified under TypeScript 7 (what npm install -g typescript installs), the only supported major. A
tsc below 7 is a warning, below supported (≥ 7), with the fix
npm install -g typescript@7. A tsc newer than 7 is reported as
untested (verified up to 7) but stays ok: it says the emitted output hasn’t
been checked under that major yet, not that anything is wrong. So
bynk doctor --strict doesn’t fail the day a new TypeScript major ships. tsx
also satisfies the requirement, but it only runs the tests: it doesn’t
type-check them.
Provenance, and why a runner isn’t “ok”
Section titled “Provenance, and why a runner isn’t “ok””Each tool reports where it was found: on your global PATH, in a
project-local node_modules/.bin, or only provisionable through your package
manager’s runner: npx, pnpm dlx or bunx. The row names the one it would use
(“provisionable via pnpm dlx”), and its --format json provenance is npx,
pnpm-dlx or bunx. That last one is a warning, not a pass: the runner
downloads the package the first time you use it, so an environment that “works
via npx” still pauses to fetch on first real use. doctor tells you the
difference.
The runner and the fix lines follow the package
manager bynk detects for the project (the package manager row): pnpm add -g wrangler@4 for a pnpm project, bun add -g for bun,
yarn global add for Yarn classic. Yarn classic has no runner, so doctor names
npx when it is on PATH. A project-local fix uses pnpm add -D, bun add -d
or yarn add -D the same way.
The in-process compiler
Section titled “The in-process compiler”bynk links the compiler in-process, so compiling needs no separate compiler
binary — compile is always available, and there is no version to drift. The
compiler row always reads in-process. (bynkc, which used to be a separate compiler binary, no longer exists; see bynkc (removed).)
Exit codes — for scripts and CI
Section titled “Exit codes — for scripts and CI”The exit code depends on what you asked about:
- Bare
bynk doctoris informational. It surveys everything but only fails if the compile floor is broken — which, with the in-process compiler, cannot happen — so a compile-only user exits0even without Node orwrangler. bynk doctor --only <capability>gates on one capability.bynk doctor --only deployexits non-zero on a machine that genuinely can’t deploy.bynk doctor --strictturns every warning — optional gaps,npxprovisionability — into a failure. Use it for an all-green CI gate.
Machine-readable output
Section titled “Machine-readable output”Two formats are a stable, scriptable contract:
bynk doctor --format short # one `capability: level (remedy)` line per rowbynk doctor --format json # structured, for CIcompile: oktest: okdeploy: warn (npm install -g wrangler@4, or clear a stale npx cache (~/.npm/_npx))editor: note (install bynk-lsp (or download from releases))doctor only reports — it never installs anything. Copy the fix line it
prints and run it yourself.
From VS Code
Section titled “From VS Code”Bynk: Doctor in the VS Code extension runs
bynk doctor --format json in your project and shows the report as a checklist,
grouped by capability. Each gap carries its remedy, with buttons to run its
command in a terminal (after you confirm it), open a link or the relevant
setting, or copy it. The extension doesn’t run the doctor on its own. A test
run, debug session or dev server that fails on a missing tool offers Run
Doctor, scoped with --only to what failed. If bynk itself can’t be found,
the doctor can’t run either, so the extension says how to install it instead.
Related
Section titled “Related”bynk dev pre-flights the
same deploy capability (Node + wrangler) before it serves, so a green
bynk doctor --only deploy is exactly what dev needs to run.