pub mod config;
pub mod dashboard;
pub mod doctor;
pub mod init;
pub mod mcp;
pub mod plan;
#[cfg(unix)]
pub mod pod;
pub mod run;
pub mod ship;
pub mod start;
pub mod status;
pub mod sync;
pub mod uat;
pub mod uninstall;
pub mod verify;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "forge",
version = concat!(env!("CARGO_PKG_VERSION"), " (stage: ", env!("FORGE_STAGE"), ")"),
about = "NXTG-Forge Orchestrator — Universal orchestration engine for AI-powered development",
long_about = "Forge orchestrates Claude Code, Codex CLI, Gemini CLI, and future AI tools \
as a coordinated team with governance, knowledge capture, and conflict prevention."
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
#[arg(long, global = true, default_value = ".")]
pub project: String,
}
#[derive(Subcommand)]
pub enum Commands {
Init {
#[arg(short, long)]
name: Option<String>,
},
Plan {
#[arg(short, long)]
generate: bool,
#[arg(short, long)]
spec: Option<String>,
#[arg(long)]
from_findings: bool,
},
Status {
#[arg(short, long, default_value = "5")]
events: usize,
#[arg(long)]
budget: bool,
#[arg(long)]
json: bool,
#[arg(long)]
all: bool,
},
Run {
#[arg(short, long)]
task: Option<String>,
#[arg(short, long)]
agent: Option<String>,
#[arg(short, long, default_value = "3")]
parallel: usize,
#[arg(long)]
dry_run: bool,
},
Start {
#[arg(short, long)]
agent: Option<String>,
#[arg(short, long, alias = "ceo")]
r#loop: bool,
#[arg(long = "i-accept-subscription-risk", default_value_t = false)]
accept_subscription_risk: bool,
},
Sync,
Mcp,
Dashboard {
#[arg(short, long)]
watch: bool,
#[arg(short, long, default_value = "3")]
parallel: usize,
#[arg(long = "i-accept-subscription-risk", default_value_t = false)]
accept_subscription_risk: bool,
#[arg(long)]
pty: bool,
},
Doctor {
#[arg(long)]
strict: bool,
#[arg(long)]
json: bool,
},
Pod {
#[command(subcommand)]
verb: PodVerb,
},
Verify,
Uat {
#[arg()]
finding: Option<String>,
},
Ship {
#[arg(long)]
auto: bool,
#[arg(long)]
dry_run: bool,
},
Uninstall {
#[arg(long)]
force: bool,
},
Config {
#[arg()]
key: Option<String>,
#[arg()]
value: Option<String>,
},
}
#[derive(Subcommand, Debug)]
pub enum PodVerb {
Start {
name: String,
#[arg(long)]
force: bool,
#[arg(long)]
attach: bool,
},
Stop {
name: String,
},
List,
Validate {
name: String,
},
Show {
name: String,
},
#[command(alias = "hud")]
State,
Ps,
Gc,
Reload {
name: String,
#[arg(long)]
force: bool,
},
Completions {
shell: clap_complete::Shell,
},
Preflight {
pod: Option<String>,
#[arg(long)]
against: Option<String>,
},
Adopt {
#[arg(long, conflicts_with = "abort")]
repair: bool,
#[arg(long)]
abort: bool,
},
Unadopt,
#[command(name = "_pane-recover", hide = true)]
PaneRecover {
session: String,
},
#[command(name = "_after-detach", hide = true)]
AfterDetach {
session: String,
},
}