pub enum Command {
Doctor {
input: PathBuf,
only: Option<CapabilityArg>,
strict: bool,
format: FormatArg,
},
Dev {
path: PathBuf,
contexts: Vec<String>,
base_port: Option<u16>,
inspect: bool,
inspect_port: u16,
env: String,
wrangler_args: Vec<String>,
},
Deploy {
path: PathBuf,
context: Option<String>,
env: String,
dry_run: bool,
format: DeployFormatArg,
yes: bool,
secrets_file: Option<PathBuf>,
secrets: Vec<String>,
force: bool,
prune: bool,
wrangler_args: Vec<String>,
},
New {
path: PathBuf,
name: Option<String>,
},
Check {
input: PathBuf,
format: CheckFormatArg,
},
Fmt {
args: FmtArgs,
},
Test {
args: TestArgs,
},
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 for --inspect, allocated per context exactly
as --base-port is (default 9229).
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.
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).
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.
Fields
args: FmtArgsTest
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
args: TestArgsExplain
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);