nimbus_creator/lib.rs
1use std::path::PathBuf;
2
3use ratatui::{Terminal, backend::Backend};
4
5pub mod app;
6pub mod builder;
7pub mod event;
8pub mod ui;
9
10pub use app::App;
11pub use builder::OriginKind;
12
13/// Runs the vault-creator wizard against an already-initialized `terminal`. The caller owns
14/// terminal setup/teardown (`ratatui::init`/`restore` or equivalent), which is what makes this
15/// embeddable from another app (`nimbus-cli`, `nimbus-tui`) that's already driving its own
16/// terminal, as well as runnable standalone.
17///
18/// Returns `Some(path)` — the path a `vault.toml` was written to — if the wizard was completed,
19/// or `None` if the user cancelled.
20pub fn run<B: Backend>(terminal: &mut Terminal<B>) -> color_eyre::Result<Option<PathBuf>>
21where
22 B::Error: std::error::Error + Send + Sync + 'static,
23{
24 App::new().run(terminal)
25}
26
27#[cfg(test)]
28mod test;