pub enum Command {
Show 19 variants
Doctor {
input: PathBuf,
only: Option<CapabilityArg>,
strict: bool,
format: FormatArg,
},
Dev {
path: PathBuf,
lock: LockArgs,
contexts: Vec<String>,
base_port: Option<u16>,
inspect: bool,
inspect_port: u16,
env: String,
local_workers: Vec<String>,
format: DevFormatArg,
ready_json: Option<PathBuf>,
wrangler_args: Vec<String>,
},
Deploy {Show 13 fields
path: PathBuf,
lock: LockArgs,
context: Option<String>,
env: String,
dry_run: bool,
format: DeployFormatArg,
yes: bool,
secrets_file: Option<PathBuf>,
secrets: Vec<String>,
force: bool,
prune: bool,
confirm_delete: Vec<String>,
wrangler_args: Vec<String>,
},
New {
path: PathBuf,
name: Option<String>,
},
Check {
input: PathBuf,
format: CheckFormatArg,
lock: LockArgs,
},
Fmt {
args: FmtArgs,
},
Test {
args: TestArgs,
lock: LockArgs,
allow_skew: bool,
},
Fetch {
path: PathBuf,
lock: LockArgs,
},
Update {
names: Vec<String>,
path: PathBuf,
},
Migrate {
command: MigrateCommand,
},
Add {
package: String,
alias: Option<String>,
path: PathBuf,
},
Publish {
path: PathBuf,
dry_run: bool,
},
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,
path: PathBuf,
},
Registry {
command: RegistryCommand,
},
Explain {
code: String,
},
}Variants§
Doctor
Check whether your machine is ready to compile, test, and deploy Bynk — and print the exact remedy for anything missing.
Bare bynk doctor is informational: it surveys every capability and
exits 0 unless bynkc 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: PathBufProject 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.
Dev
Build the project and serve it locally with wrangler dev, 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.
Fields
path: PathBufProject 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: boolServe 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: u16First inspector port, allocated per context exactly as --base-port
is (default 9229). Used under --inspect, and also whenever several
contexts are served, so their always-on inspectors do not collide.
env: StringWhich 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: DevFormatArgOutput 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.
Deploy
Provision each context’s Cloudflare resources and deploy its Worker.
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
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.
env: StringTarget 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: boolPrint the provisioning and deploy plan without changing Cloudflare
or writing bynk.deploy.lock.
format: DeployFormatArgPlan output format. short is line-oriented; json is for CI.
yes: boolSkip 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: boolOverwrite 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: boolDelete 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.
New
Scaffold a new project: 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 bynkc, 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
Check
Type-check a .bynk file or project without writing output — the
bynkc check behaviour through the driver’s compiler resolution (v0.138).
Runs the compiler pipeline in-process (no bynkc binary required); with
BYNK_BYNKC set, the pinned compiler is shelled instead so an
externally-managed bynkc still governs the result.
Fields
format: CheckFormatArgDiagnostic 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.
Fmt
Format .bynk source files in place — the bynkc fmt behaviour through
the driver (v0.138). Passing - reads from stdin and writes to stdout.
Runs the formatter in-process (no bynkc binary required); with
BYNK_BYNKC set, the pinned compiler is shelled instead — the style
flags are forwarded to it either way.
--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.
Test
Discover and run test declarations in a project — the bynkc test
behaviour through the driver (v0.138).
Delegates to the bynkc the driver resolves (BYNK_BYNKC → PATH →
sibling-of-bynk), so an editor or developer inherits the driver’s
richer compiler resolution instead of locating bynkc themselves.
Requires tsc (with Node.js) or tsx on PATH, exactly as bynkc test.
Fields
Fetch
Resolve the project’s dependencies, fetch the git ones missing from the
store, and write 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].
Update
Re-resolve git dependencies’ revisions — a branch that moved upstream —
and rewrite bynk.lock (#2240). Name aliases or packages to update only
those; with none, every git dependency is re-resolved.
Fields
Migrate
Where each agent class’s stored state stands, and the sweep that
migrates every stored instance so old migrate steps can retire.
Fields
command: MigrateCommandAdd
Add a registry dependency to bynk.toml (#2274): the highest version
its registry offers (or one matching @<range>), written as
<alias> = { package = "…", version = "^…" }, then resolved and locked.
Fields
Publish
Publish this package 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
Yank
Yank a published version through its registry’s publish API (#2287): kept for locked builds, never newly chosen.
Fields
Login
Sign in to a registry’s accounts (#2378) through GitHub’s device flow, and keep the account token in the credentials file.
Fields
target: AccountTargetLogout
Sign out of a registry’s accounts (#2378), here and on the server.
Fields
target: AccountTargetOrg
Manage an organisation on a registry with accounts (#2378): claim and block it, add and remove members, mint and revoke publish tokens.
Fields
command: OrgCommandApprove
Review and approve 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
Registry
Build and maintain a static package registry in a directory (#2274) —
served by any static host, or read as a file:// index.
Fields
command: RegistryCommandExplain
Explain a diagnostic code — 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.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
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>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
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);