- LICENSE (MIT) + README truth-pass; docs/cli.md CLI contract - CLI subcommands (src/cli_cmds/) per "TUI for users, CLI for users+AI" - Hub/detail refactor: keymap dispatch, modal split, action enum, BgMsg bus - Fix: org repos were never refreshed (owner==username match); refresh now parallel — 49 repos in ~11s, surfaced 70 previously invisible PRs - Fix: 3 date bugs in detail/git.rs (format-local, Local::now, 1y month math) - Stash indicator + [m] actions, session persistence, gh CLI token fallback - Legacy UI modules removed; plan/ docs (roadmap, audit, debate, handoff)
28 lines
1.1 KiB
Rust
28 lines
1.1 KiB
Rust
//! Top-level command dispatch: loads config, then routes to the TUI hub,
|
|
//! one of the setup subcommands, or the non-interactive CLI surface.
|
|
|
|
use crate::cli::{Cli, Commands};
|
|
use anyhow::Result;
|
|
|
|
/// Dispatches a parsed `Cli` invocation. With no subcommand, this launches
|
|
/// straight into the TUI hub — `vulp` is meant to be used interactively, so
|
|
/// the bare command is the primary entry point rather than a help screen.
|
|
/// Every other subcommand (besides `config`/`auth`) goes to `cli_cmds`,
|
|
/// the machine-friendly non-interactive surface.
|
|
pub async fn run(cli: Cli) -> Result<()> {
|
|
if cli.debug { crate::debug::enable(); }
|
|
let cfg = crate::config::load_config()?;
|
|
|
|
match cli.command {
|
|
// ── no subcommand → TUI hub ──
|
|
None => crate::status::run(&cfg).await,
|
|
|
|
// ── setup, needed before the TUI has anything to show ──
|
|
Some(Commands::Config) => crate::config::run(cfg).await,
|
|
Some(Commands::Auth(args)) => crate::auth::run(args, &cfg).await,
|
|
|
|
// ── everything else: non-interactive CLI ──
|
|
Some(cmd) => crate::cli_cmds::run(cmd, cli.json, &cfg).await,
|
|
}
|
|
}
|