invoice_cli/commands/
mod.rs1use crate::cli::{Cli, Commands};
2use crate::error::Result;
3use crate::output::Ctx;
4
5pub mod agent_info;
6pub mod clients;
7pub mod config;
8pub mod doctor;
9pub mod issuers;
10pub mod invoices;
11pub mod products;
12pub mod skill;
13pub mod template;
14pub mod update;
15
16pub fn dispatch(cli: Cli, ctx: Ctx) -> Result<()> {
17 crate::config::ensure_dirs()?;
18 crate::typst_assets::ensure_extracted()?;
19
20 match cli.command {
21 Commands::Issuers(cmd) => issuers::run(cmd, ctx),
22 Commands::Clients(cmd) => clients::run(cmd, ctx),
23 Commands::Products(cmd) => products::run(cmd, ctx),
24 Commands::Invoices(cmd) => invoices::run(cmd, ctx),
25 Commands::Template(cmd) => template::run(cmd, ctx),
26 Commands::Config(cmd) => config::run(cmd, ctx),
27 Commands::AgentInfo => agent_info::run(ctx),
28 Commands::Skill(cmd) => skill::run(cmd, ctx),
29 Commands::Doctor => doctor::run(ctx),
30 Commands::Update { check } => update::run(ctx, check),
31 }
32}