Skip to main content

Module cli

Module cli 

Source
Expand description

The bynkc command-line interface definition.

The clap types live here (rather than in main.rs) so they are the single source of truth for both the binary and the generated CLI reference page site/src/content/docs/docs/cli.md. render_markdown walks the clap command tree; the test tests/cli_reference.rs checks the page is up to date.

Structs§

Cli
FmtArgs
The fmt subcommand’s flags, shared with bynk fmt the same way (#968): one #[derive(Args)] struct both CLIs flatten, rather than two copies to keep in step as formatting options are added. The fmt subcommand’s arguments, flattened by both bynkc::cli and bynk::cli so the two spell one contract rather than two copies of it (the test_runner::TestArgs pattern, findings #40/#72). Field docs here are the CLI help text for both commands’ flags.
TestArgs
v0.59: bynkc test --format selector, and the test subcommand’s flags — bynk_driver::test_runner::TestFormat/TestArgs, re-exported so existing bynkc::cli::TestFormat paths resolve unchanged (Wave 5 §5.4: the test subcommand’s contract, findings #40/#72, is now shared with bynk test rather than a per-command near-duplicate). The test subcommand’s flags — the one contract bynkc test and bynk test both #[command(flatten)] (review findings #40/#72/#20/#21 remainder), replacing four independent hand-spellings (bynkc::cli, bynk::cli, bynk::test::TestArgs, and the argv-literal rebuild that turned the latter back into flags for the bynkc shell-out) with one. Field docs here are the CLI help text for both commands’ flags.

Enums§

CliPlatform
v0.17: the deploy platform that selects the bynk surface binding. Distinct from CliTarget (the emit topology). v0.18 adds node.
CliTarget
Command
DiagFormat
v0.38 (ADR 0071): bynkc check --format selector.
EmitFormat
v0.108 (in-browser track, slice 1): the emitted artefact language. ts (the default and primary output) writes the typed TypeScript modules; js writes the same modules with their types stripped — an emit-then-strip JavaScript artefact (ADR 0137) runnable with no tsc in the loop. Orthogonal to --target (topology) and --platform (binding).
IndentKind
The fmt subcommand’s flags, shared with bynk fmt the same way (#968): one #[derive(Args)] struct both CLIs flatten, rather than two copies to keep in step as formatting options are added. How --indent spells the two IndentStyle variants. The words match the [fmt] indent key in bynk.toml, which the language server already reads, so a project states the same choice the same way in either place.
TestFormat
v0.59: bynkc test --format selector, and the test subcommand’s flags — bynk_driver::test_runner::TestFormat/TestArgs, re-exported so existing bynkc::cli::TestFormat paths resolve unchanged (Wave 5 §5.4: the test subcommand’s contract, findings #40/#72, is now shared with bynk test rather than a per-command near-duplicate). test --format selector, shared by bynkc test and bynk test (review findings #40/#72): one enum both CLIs’ Test subcommand uses, instead of two structurally-identical copies that must be hand-kept in sync.

Functions§

command
The clap [clap::Command] tree for the bynkc CLI.
render_markdown
Render the CLI reference as a Markdown page, walking the clap command tree.