Implement the terminal UI

This commit is contained in:
2026-07-19 21:36:49 +02:00
parent 45cb0cd502
commit 23981ce2ae
16 changed files with 5836 additions and 204 deletions

View File

@@ -6,6 +6,7 @@ license.workspace = true
[dependencies]
bds-core = { workspace = true }
bds-server = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true }
dirs = { workspace = true }

View File

@@ -20,6 +20,27 @@ fn main() -> ExitCode {
}
};
if matches!(cli.command, bds_cli::Command::Tui) {
let data_root = bds_core::util::application_data_dir();
let config = match bds_server::ServerConfig::from_environment(
bds_core::util::application_database_path(),
data_root,
) {
Ok(config) => config,
Err(error) => {
eprintln!("Error: {error:#}");
return ExitCode::from(1);
}
};
return match bds_server::run_headless(bds_server::boot::BootMode::Tui, config) {
Ok(()) => ExitCode::SUCCESS,
Err(error) => {
eprintln!("Error: {error:#}");
ExitCode::from(1)
}
};
}
let json = cli.json;
let needs_stdin = match &cli.command {
bds_cli::Command::Post(args) => args.stdin,