1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
use clap::{Args, Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(
name = "ai-igniter",
about = "Lightning-fast, extensible workspace & service orchestrator for AI dev worktrees",
version
)]
pub struct Cli {
/// Workspace / Worktree directory (defaults to current git worktree or current directory)
#[arg(short, long, global = true)]
pub dir: Option<PathBuf>,
/// Source checkout directory (defaults to the main git checkout or workspace directory)
#[arg(short, long, global = true)]
pub root: Option<PathBuf>,
/// Base port for services & app (defaults to config base_port or dynamically derived from the workspace path)
#[arg(short, long, global = true)]
pub port: Option<u16>,
/// Path to configuration file (defaults to ai-igniter.toml)
#[arg(short, long, global = true)]
pub config: Option<PathBuf>,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
/// Interactively initialize ai-igniter for this project (fast service selection)
Init(InitArgs),
/// Start workspace services and keep them running (stops Docker when interrupted)
#[command(alias = "up")]
Dev(DevArgs),
/// Teardown workspace: remove containers, volumes, orphans and generated files
#[command(alias = "archive", alias = "down")]
Teardown,
/// Display service health, running containers, and port mappings
Status,
/// Compute and display or write workspace environment variables
Env(EnvArgs),
/// Check for updates and update ai-igniter to the latest version
#[command(alias = "upgrade")]
Update(UpdateArgs),
}
#[derive(Args, Debug)]
pub struct InitArgs {
/// Project name (defaults to current directory name)
#[arg(short, long)]
pub name: Option<String>,
/// Non-interactive mode using defaults
#[arg(long)]
pub non_interactive: bool,
/// Overwrite an existing ai-igniter.toml without asking
#[arg(long)]
pub force: bool,
}
#[derive(Args, Debug)]
pub struct DevArgs {
/// Wipe volumes and recreate services from scratch before starting
#[arg(long)]
pub reset: bool,
/// Do not run the dev_command configured in ai-igniter.toml
#[arg(long)]
pub no_command: bool,
/// Optional command to run instead of dev_command from ai-igniter.toml (e.g. `ai-igniter dev -- bun run dev`)
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
pub command: Vec<String>,
}
#[derive(Args, Debug)]
pub struct EnvArgs {
/// Write the evaluated variables to env_file
#[arg(short, long)]
pub write: bool,
}
#[derive(Args, Debug)]
pub struct UpdateArgs {
/// Only check if an update is available without downloading or replacing the binary
#[arg(long)]
pub check: bool,
/// Force update via cargo (`cargo install ai-igniter --force`) instead of GitHub Releases
#[arg(long)]
pub cargo: bool,
}