Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 31 variants Doctor { input: PathBuf, only: Option<CapabilityArg>, strict: bool, format: FormatArg, }, Dev {
Show 14 fields sub: Option<DevSub>, path: PathBuf, lock: LockArgs, contexts: Vec<String>, base_port: Option<u16>, inspect: bool, inspect_port: Option<u16>, no_install: bool, env: String, local_workers: Vec<String>, format: DevFormatArg, ready_json: Option<PathBuf>, stream: DevStreamArgs, wrangler_args: Vec<String>,
}, Tail { path: PathBuf, lock: LockArgs, context: Option<String>, env: String, wrangler_args: Vec<String>, }, Deploy {
Show 17 fields path: PathBuf, lock: LockArgs, context: Option<String>, worker: Option<String>, env: String, dry_run: bool, no_install: bool, format: DeployFormatArg, yes: bool, secrets_file: Option<PathBuf>, secrets: Vec<String>, force: bool, prune: bool, confirm_delete: Vec<String>, accept_fresh_agent: Vec<String>, accept_compatible_skew: bool, wrangler_args: Vec<String>,
}, New { path: PathBuf, name: Option<String>, }, Check { input: PathBuf, format: CheckFormatArg, fix: Option<Vec<String>>, emit: bool, each: bool, lock: LockArgs, }, Build { input: PathBuf, out: Option<PathBuf>, target: Option<CliTarget>, platform: Option<CliPlatform>, emit: Option<EmitFormat>, profile: Option<CliProfile>, lock: LockArgs, }, Compile { input: PathBuf, output: PathBuf, target: CliTarget, platform: CliPlatform, emit: EmitFormat, sources_stdin: bool, lock: LockArgs, }, Client { input: PathBuf, out: Option<PathBuf>, service: Vec<String>, layout: Option<ClientLayoutArg>, check: bool, lock: LockArgs, }, Openapi { input: PathBuf, service: Option<String>, out: Option<PathBuf>, format: Option<OpenapiFormatArg>, lock: LockArgs, }, Token { actor: Option<String>, sub: Option<String>, lifetime: Option<String>, expired: bool, not_before: Option<String>, claims: Vec<String>, input: PathBuf, lock: LockArgs, }, Fmt { args: FmtArgs, }, Test { args: Box<TestArgs>, lock: LockArgs, }, Eval { args: EvalCommand, lock: LockArgs, }, Fetch { path: PathBuf, lock: LockArgs, format: DeployFormatArg, }, Update { names: Vec<String>, path: PathBuf, }, Revert { path: PathBuf, context: Option<String>, worker: Option<String>, env: String, to: Option<String>, dry_run: bool, format: DeployFormatArg, yes: bool, accept_schema_ahead: Vec<String>, accept_secret_changes: bool, }, Migrate { command: MigrateCommand, }, Add { package: String, alias: Option<String>, path: PathBuf, format: DeployFormatArg, }, Search { package: String, path: PathBuf, format: DeployFormatArg, }, Deps { path: PathBuf, format: DeployFormatArg, }, Publish { path: PathBuf, dry_run: bool, expect_checksum: Option<String>, format: DeployFormatArg, }, Yank { package: String, version: String, undo: bool, path: PathBuf, }, Login { target: AccountTarget, }, Logout { target: AccountTarget, }, Org { command: OrgCommand, }, Approve { package: Option<String>, all: bool, list: bool, format: DeployFormatArg, path: PathBuf, }, Registry { command: RegistryCommand, }, Explain { code: String, }, Mcp { path: PathBuf, }, Book { search: Option<String>, format: BookFormat, },
}

Variants§

§

Doctor

Check this machine has the tools Bynk needs.

Surveys what compiling, testing, and deploying need, and prints the exact remedy for anything missing.

Bare bynk doctor is informational: it surveys every capability and exits 0 unless the compiler itself is unusable. --only <capability> gates on one capability (exits non-zero if its tools are missing); --strict turns every warning into a failure, for CI.

Fields

§input: PathBuf

Project directory to inspect (for project-local node_modules/.bin resolution). Defaults to the current directory.

§only: Option<CapabilityArg>

Scope the check — and the exit code — to one capability.

§strict: bool

Treat every warning (optional gaps, npx provisionability, minor version skew) as a failure. For an all-green CI gate.

§format: FormatArg

Output format. human (default) is a grouped table; short and json are the stable scriptable surface.

§

Dev

Build and serve the project locally, rebuilding on save.

One step in place of the manual compile + cd + wrangler dev recipe.

Compiles into a managed .bynk/dev/ build dir and runs one wrangler dev per context from inside its worker dir, in local mode (Miniflare) — no namespace provisioning needed. Every context is served by default and the service bindings between them are wired (#552), so a cross-context call resolves locally; --context narrows to a subset. While serving, .bynk sources are watched (#524): saving a file rebuilds in place and the running workers hot-reload; a failing rebuild reports errors and keeps serving the last good build. Everything after -- is forwarded to wrangler dev verbatim.

bynk dev inspect reads a running session (#3581): see its help.

Fields

§path: PathBuf

Project directory to serve from (anywhere inside the project; the root is found by walking up for bynk.toml). Defaults to ..

§contexts: Vec<String>

Which context to serve, repeatable. Omit to serve every context in the project with the service bindings between them wired (#552); pass one or more to narrow to a subset. Accepts the dotted name or its dasherised worker-dir form.

§base_port: Option<u16>

First port of the per-context allocation (context i gets --base-port + i, in sorted order). Defaults to wrangler’s 8787. A single context left on the default keeps -- --port N working.

§inspect: bool

Serve with the V8 inspector enabled (slice 3, ADR 0104): wrangler dev starts with --inspector-port so a JavaScript debugger can attach. Breakpoints set in .bynk sources resolve through the emitted source maps, composed into the worker bundle. Prints the inspector URL on start.

§inspect_port: Option<u16>

First inspector port, allocated per context exactly as --base-port is. Always honoured, even for one context. Without it the base is 9229 under --inspect or with several contexts, and a single context without --inspect gets a free port of its own, so sessions started together do not collide on 9229.

§no_install: bool

Do not install the generated project’s npm packages: stop, naming the install command, when one is missing. For people who provision node_modules themselves, and CI. Also set by BYNK_NO_INSTALL=1.

§env: String

Which bynk.deploy.lock environment -- --remote reads the KV id from. dev never provisions, so this only selects among what bynk deploy --env NAME already recorded — irrelevant without --remote. Omit for today’s single, unqualified default.

§local_workers: Vec<String>

A Worker outside the project, named by a Service instance (@worker("NAME")), to reach in your own locally running wrangler dev of it rather than in the stand-in dev binds by default. Repeatable.

§format: DevFormatArg

Output format. human (default) is the readable stream on stderr. json adds one JSON event per line on stdout (serving with each context’s ports, rebuilding, rebuild_ok, rebuild_failed, stopped), the stable scriptable surface for editors and CI.

§ready_json: Option<PathBuf>

Once every served context answers an HTTP probe, write { "<worker>": "<url>" } to FILE: the readiness signal for a test runner or CI script. A stale FILE is removed at start, and FILE is removed when the session stops.

§wrangler_args: Vec<String>

Arguments after --, forwarded to wrangler dev (e.g. -- --remote). Ports are the driver’s to allocate: use --base-port / --inspect-port.

§

Tail

Stream a deployed Worker’s logs, mapped to .bynk sources.

Runs wrangler tail with stack frames rewritten to .bynk locations, as bynk dev does for the local server (#2546). The project is compiled so the frames can be mapped through the emitter’s source maps, but nothing is deployed or provisioned. Everything after -- is forwarded to wrangler tail.

Fields

§path: PathBuf

Project directory (anywhere inside the project). Defaults to ..

§context: Option<String>

Which context’s Worker to tail. Optional when the project has one context. Accepts the dotted name or its dasherised worker-dir form.

§env: String

Which bynk deploy --env environment’s Worker to tail.

§wrangler_args: Vec<String>

Arguments after --, forwarded to wrangler tail (e.g. -- --status error).

§

Deploy

Provision Cloudflare resources and deploy every Worker.

Each context’s resources are provisioned and its Worker deployed; the whole project ships in one command, in Service-Binding dependency order — Cloudflare rejects a Worker uploaded before a Worker it binds to. The generated configuration remains disposable: Cloudflare ids live in the committed bynk.deploy.lock.

Fields

§path: PathBuf

Project directory to deploy from. Defaults to the current directory.

§context: Option<String>

Deploy this context alone, assuming the contexts it consumes are already live; a dependency that has never been deployed is reported rather than pushed into. Accepts the dotted name or its dasherised worker-dir form. Omit to deploy the whole project in order.

§worker: Option<String>

Deploy this Worker alone, by its directory name under workers/: a [deploy.workers.<key>] group’s key (the group is one Worker, so it deploys, and rolls back, as a unit), or a context’s dasherised name. Like --context, it assumes the Workers it binds to are already live.

§env: String

Target environment. Selects the bynk.deploy.lock section and, for any value other than default, synthesises an environment- scoped Wrangler config section (KV, queues, Service Bindings all qualified) since Cloudflare does not inherit bindings into a named environment. Omit to deploy today’s single, unqualified default.

§dry_run: bool

Print the provisioning and deploy plan without changing Cloudflare or writing bynk.deploy.lock.

§no_install: bool

Do not install the generated project’s npm packages: stop, naming the install command, when one is missing. For people who provision node_modules themselves, and CI. Also set by BYNK_NO_INSTALL=1.

§format: DeployFormatArg

Plan output format. short is line-oriented; json is for CI.

§yes: bool

Skip the confirmation required before creating a namespace or publishing a Worker. Required for non-interactive automation.

§secrets_file: Option<PathBuf>

Read secret values from a dotenv-style NAME=value file. Supplies both names and values; never committed, never persisted. Values move to wrangler secret put and are dropped.

§secrets: Vec<String>

Set this named secret, taking its value from the environment (or a prompt). Repeatable. Use for a bynk.Secrets name, whose spelling the compiler cannot know — an actor’s declared auth secret needs no flag. The environment is never scanned for names.

§force: bool

Overwrite a secret that is already set. The default sets only the missing ones, so a re-deploy does not cut a fresh Cloudflare secret version for every secret every time.

§prune: bool

Delete every reported orphan — a KV namespace or queue the ledger remembers that the current build no longer declares. Never deletes a Worker. Prompts separately from the creation confirmation unless –yes is also given; omit to report only.

§confirm_delete: Vec<String>

Confirm deleting this agent class’s stored data, named as the plan prints it (<context>.<Class>). Repeatable. A removed agent declaration deletes data irreversibly, so --yes never stands in for this.

§accept_fresh_agent: Vec<String>

Let this context start with fresh agent state on another Worker script than the one it was last deployed to (into or out of a [deploy.workers.<key>] group, or after a group is renamed or re-keyed). An agent’s state belongs to its script, so without this such a move is refused (bynk.deploy.agent_move_refused); with it the old state stays in the old script, which the plan then reports as holding data. Repeatable; each context is named, never a blanket.

§accept_compatible_skew: bool

With --context: deploy a callee ahead of live callers still on an older contract, when every such change is compatible for them. The older contracts are recorded in bynk.contracts.lock (commit it), and the callee answers them until the callers are redeployed. A breaking change, and a caller ahead of its live callee, are refused as before.

§wrangler_args: Vec<String>

Arguments after --, forwarded to wrangler deploy verbatim.

§

New

Scaffold a new project.

The project is a complete, runnable single-context HTTP service you can serve immediately with bynk dev.

Writes a bynk.toml, a .gitignore, and src/<name>.bynk into a new directory. Pure offline file-writing — it shells nothing and needs no toolchain, so you can run it before Node or wrangler are installed. The project name defaults to the target directory’s final component; --name overrides it and must be a legal Bynk identifier.

Fields

§path: PathBuf

Directory to create for the new project (e.g. hello or ./hello).

§name: Option<String>

Project name / context identifier. Defaults to PATH’s final component; must be a legal Bynk identifier (a letter followed by letters, digits, or underscores).

§

Check

Type-check a file or project.

Writes no output.

Runs the compiler pipeline in-process.

Fields

§input: PathBuf

Input .bynk file or project root. Defaults to the current directory.

§format: CheckFormatArg

Diagnostic 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). In both, path is the file as you’d type it from the working directory (the input you passed, joined with the file’s place in it), the same path fmt reports.

§fix: Option<Vec<String>>

Apply the machine-applicable fix suggestions to the sources, in place, before checking (#2642): the same fixes the editor’s “fix all” applies, repeated until none remain. Writes only files that change, does not format, and writes nothing if applying the fixes would leave a problem that needs a human. What remains is reported as usual. --fix=<code>[,<code>…] takes only the fixes of the named diagnostic codes (a hint’s too, when named): for a single migration, such as an upgrade note’s one change. An unknown code is an error that names the nearest real one (#3537).

§emit: bool

After a passing check, generate the Workers TypeScript into a temporary directory and type-check it with tsc (#3068). A failure is reported as bynk.codegen.tsc_failed at the Bynk source the failing line came from: it is a compiler bug. Needs tsc (with Node.js); slower than a plain check, so off by default. Project directories only.

§each: bool

Run over each project directly inside a directory that has no bynk.toml of its own (#3274): as at a [workspace] root, one report per project under a ── path ── header, every project run, and a non-zero exit if any fails. A subdirectory without a bynk.toml is not a project and is skipped. At a workspace root it changes nothing; at a project, or inside one, it is an error.

§

Build

Build a project from its [build] settings.

Needs no flags: out, target, platform and emit come from the [build] table, else the defaults (out, bundle, cloudflare, ts), and a flag overrides its key. build infers from the project; bynk compile is told, and never reads [build].

Fields

§input: PathBuf

Project directory. Defaults to the current directory.

§out: Option<PathBuf>

Output directory. Overrides [build] out.

§target: Option<CliTarget>

Build target. Overrides [build] target.

§platform: Option<CliPlatform>

Deploy platform. Overrides [build] platform.

§emit: Option<EmitFormat>

Artefact language. Overrides [build] emit.

§profile: Option<CliProfile>

Build profile: release (the default, no contract checks) or dev (contract checks on). [profile.<name>] overrides its defaults.

§

Compile

Compile a project to TypeScript, settings as flags.

Use bynk build for a project that takes its settings from bynk.toml. Runs in-process (#2471, #2998).

The compiler is linked in. With --sources-stdin it compiles unsaved editor buffers: a JSON object { "<absolute path>": "<text>" } on stdin wins over the files on disk, and bynk.schema.lock is neither read nor written. What “Bynk: Show Compiled Output” runs.

Fields

§input: PathBuf

Project directory, or one .bynk file. Defaults to the current directory.

§output: PathBuf

Output root directory (the output file, for a single-file input).

§target: CliTarget

Build target. bundle (default) produces a single deployment unit; workers produces one Cloudflare Worker per context with Service Binding plumbing.

§platform: CliPlatform

Deploy platform selecting the bynk surface binding: cloudflare (default), node, or browser (bundle topology only).

§emit: EmitFormat

Artefact language. ts (default) writes typed TypeScript; js writes the same modules with types stripped, runnable with no tsc in the loop.

§sources_stdin: bool

Compile the unsaved buffers given as JSON on stdin (see above).

§

Client

Write a typed TypeScript client for the HTTP services.

One module a front end (SvelteKit, Next.js, anything that can fetch) imports (#3508): one function per from http route, the boundary types as TypeScript types, and the same refinement checks the server runs, on the way out and on the way in. Each call returns a union of the route’s own responses keyed by status, or a CallFailure; nothing is thrown for an HTTP status. An optional value is T | null.

The module carries a small browser-safe runtime, so it needs nothing installed. Pass it your own fetch, a baseUrl and headers: createClient({ baseUrl, fetch, headers }). Writes to stdout unless --out is given. The project must check clean. Experimental: member names may change in a minor version until it is stabilised.

Routes the client cannot represent yet (raw bodies, raw and streamed responses) are named on stderr and left out. bynk openapi is the language-neutral contract and stays.

Fields

§input: PathBuf

Project directory (or any path inside it). Defaults to the current directory.

§out: Option<PathBuf>

Write the client to PATH instead of stdout: a .ts file, or with --layout dir a directory. Defaults to [build.client] out in bynk.toml.

§service: Vec<String>

Generate only this from http service (Name or unit.Name); may be given more than once. Defaults to [build.client] service, else every one.

§layout: Option<ClientLayoutArg>

file (default) writes one module; dir writes index.ts, types.ts, codecs.ts and runtime.ts into --out. Defaults to [build.client] layout.

§check: bool

Write nothing: compare the client at --out with the one the project generates, and exit non-zero, naming where they differ, when it is stale or missing. The CI drift gate.

§

Openapi

Write an OpenAPI document for the project’s HTTP services.

An OpenAPI 3.1 document for every from http service (#856): paths and methods from the routes, parameters and request bodies from the handler params, and responses keyed by the exact status codes the handlers can return — the 2xx body and each error variant a handler constructs, plus the 400 the boundary itself answers.

Schemas come from the same boundary-shape derivation the emitted codecs use, so a refinement (String where NonEmpty) becomes the JSON Schema constraint it re-validates (minLength: 1) and the spec cannot drift from the handlers. Writes to stdout unless --out is given, so it composes in CI. The project must check clean.

Fields

§input: PathBuf

Project directory (or any path inside it). Defaults to the current directory.

§service: Option<String>

Document only this from http service (Name or unit.Name). Defaults to every one.

§out: Option<PathBuf>

Write the document to FILE instead of stdout.

§format: Option<OpenapiFormatArg>

Output format. Defaults to yaml when --out ends in .yaml or .yml, otherwise json.

§

Token

Mint a credential for the project’s own Bearer actor.

For calling a Bearer-guarded route by hand — curl under bynk dev, or a smoke test against a deployment. Prints the token alone on stdout, so $(bynk token Reader --sub me) works.

This is not bynk org token mint, which mints a registry publish token for bynk publish. bynk token signs an HS256 JWT for an actor this project declares, exactly as that actor’s emitted seam verifies it.

The secret is read from the environment under the name the actor declares (auth = Bearer(secret = "API_TOKEN_SECRET") → $API_TOKEN_SECRET), never from an argument, and is never printed. --sub is checked against the actor’s identity type, refinements included, before signing. Only Bearer actors are supported: a Signature actor signs a request body, and an Oidc actor’s tokens come from the identity provider. With no actor, lists the project’s Bearer actors and the secret each reads.

A refinement actor (actor Moderator = Reader where hasClaim("mod")) signs with its base’s secret and carries the claims its predicate needs, as the system test harness does for by Moderator("x"). A predicate that no claims satisfy is refused. --claim name[=value] (repeatable) adds claims to any actor’s token, and replaces a claim the predicate would have set, so the seam’s 403 can be tested.

The default lifetime is 1 hour; --lifetime (up to 365d) sets another. --expired and --not-before mint tokens the seam must refuse, for testing the refusals.

Fields

§actor: Option<String>

The actor to mint for (Name or unit.Name). Omit to list the project’s Bearer actors.

§sub: Option<String>

The identity the token names — its sub claim.

§lifetime: Option<String>

How long the token is valid, like 15m, 1h or 30d (default 1h, at most 365d). Counted from --not-before when that is set.

§expired: bool

Mint a token that expired an hour ago, to test that the seam refuses it.

§not_before: Option<String>

Start the token’s validity this long from now, like 10m, to test that the seam refuses a token not yet valid.

§claims: Vec<String>

Add a claim to the token: name signs true, name=value signs the string. Repeatable. Not sub, iat, exp, nbf, iss or aud, which bynk token signs itself.

§input: PathBuf

Project directory (or any path inside it). Defaults to the current directory.

§

Fmt

Format .bynk source files.

Formats in place. Passing - reads from stdin and writes to stdout.

Runs the formatter in-process.

--indent, --indent-width, --max-line-width and --no-trailing-comma override the canonical style for this run; with none of them the output is the canonical formatting.

Fields

§args: FmtArgs
§

Test

Run the project’s tests.

Discovers and runs test declarations.

Runs in-process. Requires tsc (with Node.js) or tsx on PATH.

Fields

§

Eval

Evaluate a snippet in a unit’s scope; print its value.

Compiles and runs the snippet as a synthetic test case in a suite for --unit, under the test runtime, and prints {"value": <wire shape>, "type": "…", "diagnostics": […]} (#3585). The snippet is --expr, or stdin; its last expression is the value. Leading consumes and stub lines belong to the suite, so a snippet that uses another unit consumes it, as a suite does. A capability the snippet calls needs a stub; nothing reaches the network. Each evaluation is independent: send earlier cells’ lets again ahead of the snippet.

The project’s own suites are left out of the build, so a suite that does not compile cannot block an evaluation. --suite <UNIT> builds --unit’s own suite in and puts the snippet inside it, so the suite’s stubs and fns apply; its errors are then reported.

Runs in-process, with the build and runner of bynk test; requires tsc (with Node.js) or tsx on PATH. The exit status is zero only when there is a value.

Fields

§

Fetch

Fetch dependencies and write bynk.lock.

Resolves the project’s dependencies, fetches the git ones missing from the store, and writes bynk.lock (#2240). check, test, dev and deploy do this first anyway; fetch does only this — warm the store before an --offline CI step, or after editing [dependencies].

Fields

§path: PathBuf

Project (or workspace) directory. Defaults to ..

§format: DeployFormatArg

Output format. json prints one document on stdout (#2472).

§

Update

Move git dependencies to their latest revisions.

Re-resolves git dependencies’ revisions — a branch that moved upstream — and rewrites bynk.lock (#2240). Name aliases or packages to update only those; with none, every git dependency is re-resolved.

Fields

§names: Vec<String>

The aliases or org/package names to update. All when omitted.

§path: PathBuf

Project (or workspace) directory.

§

Revert

Make a Worker’s previous deployment live again.

Needs no rebuild. Drives Cloudflare’s version rollback after checking what makes it unsafe: D1 migrations the live version applied, agent state stamped with a newer schema version, contract skew against the other live Workers, a replaced resource id, a secret change. Every unknown is a refusal, and a refusal changes nothing. Reads Cloudflare even with --dry-run, so it needs CLOUDFLARE_API_TOKEN (with D1 read access) and CLOUDFLARE_ACCOUNT_ID. Only versions deployed by a bynk that records deploy facts can be reverted; for any other, redeploy the tag.

Fields

§path: PathBuf

Project directory. Defaults to the current directory.

§context: Option<String>

Revert this context alone (dotted name or Worker directory). Default: every Worker the ledger records for the environment.

§worker: Option<String>

Revert this Worker alone, by its directory name: a [deploy.workers.<key>] group’s key, or a context’s dashed name. A group is one script, so every member goes back together.

§env: String

The environment to revert.

§to: Option<String>

Go back to this Cloudflare Worker version id instead of the deployment before the live release. Needs --context, since a version id belongs to one Worker. The same checks apply.

§dry_run: bool

Print each check’s verdict and stop. Still reads Cloudflare.

§format: DeployFormatArg

Plan output format. short is line-oriented; json is for CI.

§yes: bool

Skip the confirmation. Required for non-interactive runs. Never overrides a refusal.

§accept_schema_ahead: Vec<String>

Assert that the D1 migrations applied after the target was built are additive, for this binding (D1_ORDERS). Repeatable.

§accept_secret_changes: bool

Accept secret changes between the target and now (a bynk migrate sweep makes two).

§

Migrate

Inspect and migrate agents’ stored state.

status reports where each agent class’s stored state stands; sweep migrates every stored instance so old migrate steps can retire.

Fields

§

Add

Add a registry dependency to bynk.toml.

Adds (#2274) the highest version its registry offers (or one matching @<range>), written as <alias> = { package = "…", version = "^…" }, then resolved and locked.

Fields

§package: String

org/package, optionally @<range> (acme/money@^1.4).

§alias: Option<String>

The alias to reach it by; defaults to the package segment.

§path: PathBuf

Project directory.

§format: DeployFormatArg

Output format. json prints the entry written on stdout (#2472).

§

Search

Look up a package’s versions on its registry.

Asks the registry its organisation routes to (#2472) for every version its index lists, with the newest usable one. An exact org/package lookup — a registry’s index has no free-text search.

Fields

§package: String

org/package.

§path: PathBuf

The project whose [registries] route the organisation.

§format: DeployFormatArg

Output format. json is for scripts and editors.

§

Deps

List dependencies and their locked versions.

What bynk.lock resolved each of the project’s dependencies to (#2472). Offline.

Fields

§path: PathBuf

Project directory.

§format: DeployFormatArg

Output format. json is for scripts and editors.

§

Publish

Publish this package to its registry.

Publishes to the registry its organisation routes to (#2287): check it, pack it, upload it through the registry’s publish API, and verify the signed line the registry returns.

Fields

§path: PathBuf

The package directory.

§dry_run: bool

Check and pack, and report what would be published, without uploading.

§expect_checksum: Option<String>

Refuse, before uploading anything, unless the package packs to exactly this checksum (the one a --dry-run reported).

§format: DeployFormatArg

Output format. json prints the package, version, registry and file list on stdout (#2472).

§

Yank

Yank a published version.

Yanks through the registry’s publish API (#2287): the version is kept for locked builds, but never newly chosen.

Fields

§package: String

org/package.

§version: String

The version.

§undo: bool

Clear the yank instead.

§path: PathBuf

The project whose [registries] route the organisation.

§

Login

Sign in to a registry.

Signs in to a registry’s accounts (#2378) through GitHub’s device flow, and keeps the account token in the credentials file.

Fields

§

Logout

Sign out of a registry.

Signs out of a registry’s accounts (#2378), here and on the server.

Fields

§

Org

Manage a registry organisation, its members and tokens.

For a registry with accounts (#2378): claim and block an organisation, add and remove members, mint and revoke publish tokens.

Fields

§command: OrgCommand
§

Approve

Approve the npm packages that dependencies bring in.

Reviews and approves the npm packages that git and registry dependencies’ adapters bring into the build (#2296), recording each approval in bynk.lock. With no package, asks about each pending one.

Fields

§package: Option<String>

Approve this npm package’s pending requirements.

§all: bool

Approve every pending requirement without asking.

§list: bool

List pending and approved requirements; change nothing.

§format: DeployFormatArg

With --list: short (default) is one line per requirement; json is one document for tooling (the editor’s review).

§path: PathBuf

Project (or workspace) directory.

§

Registry

Build and maintain a static package registry.

The registry lives in a directory (#2274), served by any static host or read as a file:// index.

Fields

§

Explain

Explain a diagnostic code.

Prints the longer-form “what the rule is, why it exists, and how to fix it” behind a bynk.* error code (#853).

Prints a curated blurb, a minimal before/after example, and a link to the relevant Book concept page. The blurb is offline-complete, so the substance is available without network. Codes without a curated explanation report that gracefully; an unrecognised code exits non-zero. The same explanations back the editor’s clickable diagnostic-code links.

Fields

§code: String

The diagnostic code to explain, e.g. bynk.resolve.unknown_type.

§

Mcp

Serve toolchain answers to an AI agent over MCP.

Read-only answers over the Model Context Protocol (#2466), on stdin/stdout.

Eight tools: diagnostics, a symbol’s type and definition, a unit’s documentation, the project’s architecture, a handler’s wire contract, a diagnostic explanation, a project check, and a search of the Book. Each answers in compact Markdown with path:line:column locations relative to PATH. Nothing is written, and file arguments cannot leave PATH. Point an MCP client at bynk mcp (see the tooling docs for per-client set-up).

Fields

§path: PathBuf

The workspace the tools may read. Defaults to the current directory.

§

Book

Print or search the Bynk Book.

The whole Book, every page in reading order, is embedded in this build (#2463), so it matches the bynk you run and works offline. With no arguments it prints the Book, its first line naming the toolchain version. With --search <QUERY> it prints the best-matching sections instead, each with its page link. Used by the editor’s bynk_search_book language-model tool; a build made without the bundle says so and exits non-zero.

Fields

§search: Option<String>

Print the sections of the Book that best match these words.

§format: BookFormat

With --search: text (Markdown, the default) or json.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<'a, T> FromIn<'a, T> for T

§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [OwoColorize::fg] or a color-specific method, such as [OwoColorize::green], Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [OwoColorize::bg] or a color-specific method, such as [OwoColorize::on_yellow], Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Paint for T
where T: ?Sized,

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.