Expand description
CLI application scaffolding.
§Entry point
Downstream tools use Application::builder to wire their
metadata, version info, optional assets + features, and the
framework installs:
- a
tracing-subscriberregistry (pretty fmt on TTY, JSON otherwise or when--log-format jsonis set), - the
miettediagnostic + panic hooks (viartb_error::hook), - a
tokio_util::sync::CancellationTokenbound toSIGINTand UnixSIGTERM, - clap-based command parsing with built-in subcommands filtered by
the runtime
rtb_app::features::Featuresset.
ⓘ
use rtb_cli::prelude::*;
#[tokio::main]
async fn main() -> miette::Result<()> {
Application::builder()
.metadata(ToolMetadata::builder().name("mytool").summary("a tool").build())
.version(VersionInfo::from_env())
.build()?
.run()
.await
}See docs/development/specs/2026-04-22-rtb-cli-v0.1.md for the
authoritative contract.
Re-exports§
pub use application::report_to_exit_code;pub use application::Application;pub use application::ApplicationBuilder;pub use health::HealthCheck;pub use health::HealthReport;pub use health::HealthStatus;pub use init::Initialiser;pub use passthrough::parse_passthrough;pub use render::output;pub use render::OutputMode;
Modules§
- application
- The
Applicationentry-point type and its hand-rolled typestate builder. - browser
- URL opening with a scheme allowlist and input hygiene.
- builtins
- Built-in commands shipped with
rtb-cli. - config_
cmd configCLI subtree —show / get / set / schema / validate.- credentials
credentialsCLI subtree —list / add / remove / test / doctor.- health
- Health checks — the
doctorsubcommand’s plug-in point. - init
- Initialisers — the
initsubcommand’s plug-in point. - passthrough
- Argument handling for passthrough subcommands.
- prelude
- Glob-importable convenience prelude for downstream
fn main(). - render
- Output rendering — the seam every v0.4 ops subcommand uses to
honour the global
--output text|jsonflag. - runtime
- Runtime wiring helpers: tracing registry install, signal binding.
- telemetry
telemetryCLI subtree —status / enable / disable / reset.