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
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "gaji")]
#[command(author = "gaji contributors")]
#[command(version)]
#[command(about = "Type-safe GitHub Actions workflows in TypeScript", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Initialize a new gaji project
Init {
/// Overwrite existing files
#[arg(long)]
force: bool,
/// Skip example workflow creation
#[arg(long)]
skip_examples: bool,
/// Migrate existing YAML workflows to TypeScript
#[arg(long)]
migrate: bool,
/// Interactive mode
#[arg(short, long)]
interactive: bool,
},
/// Start development mode (one-time scan by default)
Dev {
/// Directory to watch
#[arg(short, long, default_value = "workflows")]
dir: String,
/// Keep watching for changes after the initial scan
#[arg(long)]
watch: bool,
},
/// Build TypeScript workflows to YAML
Build {
/// Input directory containing TypeScript workflows
#[arg(short, long, default_value = "workflows")]
input: String,
/// Output directory for YAML files
#[arg(short, long, default_value = ".github")]
output: String,
/// Preview YAML output without writing files
#[arg(long)]
dry_run: bool,
},
/// Add a new action and generate types
Add {
/// Action reference (e.g., actions/checkout@v5)
action: String,
},
/// Clean generated files
Clean {
/// Also clean cache
#[arg(long)]
cache: bool,
},
}