use std::path::PathBuf;
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub(crate) enum FrontendArg {
React,
Vue,
}
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub(crate) enum OutputFormat {
Human,
Json,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) struct NewOptions {
pub(crate) destination: PathBuf,
pub(crate) frontend: FrontendArg,
pub(crate) no_db: bool,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) enum DbCommand {
Migrate,
Rollback { steps: Option<u32> },
Status,
Fresh { force: bool },
Reset { force: bool },
Refresh { force: bool },
Prepare,
PrepareCheck,
Lint { format: OutputFormat },
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) struct MakeOptions {
pub(crate) kind: String,
pub(crate) name: String,
pub(crate) module: Option<String>,
pub(crate) dry_run: bool,
pub(crate) force: bool,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) enum StubsCommand {
Publish {
dry_run: bool,
force: bool,
},
}
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub(crate) struct McpOptions {
pub(crate) allow_destructive_writes: bool,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) enum ReleaseCommand {
Validate(OutputFormat),
ChangesValidate(OutputFormat),
Graph(OutputFormat),
Version(OutputFormat),
Plan(OutputFormat),
Prepare { format: OutputFormat, dry_run: bool },
PlatformValidate {
format: OutputFormat,
platform: String,
},
Publish { format: OutputFormat, dry_run: bool },
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) struct PackageOptions {
pub no_build: bool,
pub target_label: Option<String>,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) enum CliCommand {
New(NewOptions),
Install,
Dev,
Build,
Package(PackageOptions),
Check(OutputFormat),
Doctor {
format: OutputFormat,
checks_only: bool,
},
Exposure(OutputFormat),
Routes(OutputFormat),
Modules(OutputFormat),
Services(OutputFormat),
Schedule(OutputFormat),
Run {
name: String,
arguments: Vec<String>,
},
Make(MakeOptions),
Stubs(StubsCommand),
Script {
name: String,
arguments: Vec<String>,
},
Db(DbCommand),
Release(ReleaseCommand),
Inspect(InspectTarget),
Mcp(McpOptions),
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub(crate) enum InspectTarget {
App(OutputFormat),
Route { name: String, format: OutputFormat },
Module { name: String, format: OutputFormat },
}