git_adr/cli/
mod.rs

1//! CLI command definitions and handlers.
2//!
3//! This module defines the command-line interface using clap derive macros.
4
5use clap::{Parser, Subcommand};
6
7pub mod artifacts;
8pub mod attach;
9pub mod ci;
10pub mod config;
11pub mod convert;
12pub mod edit;
13pub mod export;
14pub mod hooks;
15pub mod import;
16pub mod init;
17pub mod link;
18pub mod list;
19pub mod log;
20pub mod metrics;
21pub mod new;
22pub mod onboard;
23pub mod report;
24pub mod rm;
25pub mod search;
26pub mod show;
27pub mod stats;
28pub mod supersede;
29pub mod sync;
30pub mod templates;
31
32#[cfg(feature = "ai")]
33pub mod ai;
34
35#[cfg(feature = "wiki")]
36pub mod wiki;
37
38/// Architecture Decision Records management using git notes.
39///
40/// git-adr stores ADRs in git notes, keeping your working tree clean while
41/// maintaining full git history and sync capabilities.
42#[derive(Parser, Debug)]
43#[command(name = "git-adr")]
44#[command(author, version, about, long_about = None)]
45#[command(propagate_version = true)]
46pub struct Cli {
47    /// Subcommand to execute.
48    #[command(subcommand)]
49    pub command: Commands,
50}
51
52/// Available commands.
53#[derive(Subcommand, Debug)]
54pub enum Commands {
55    /// Initialize git-adr in the repository.
56    Init(init::Args),
57
58    /// Create a new ADR.
59    #[command(alias = "n")]
60    New(new::Args),
61
62    /// List all ADRs.
63    #[command(alias = "l")]
64    List(list::Args),
65
66    /// Show an ADR.
67    #[command(alias = "s")]
68    Show(show::Args),
69
70    /// Edit an existing ADR.
71    #[command(alias = "e")]
72    Edit(edit::Args),
73
74    /// Remove an ADR.
75    Rm(rm::Args),
76
77    /// Search ADRs.
78    Search(search::Args),
79
80    /// Sync ADRs with remote.
81    Sync(sync::Args),
82
83    /// Manage configuration.
84    Config(config::Args),
85
86    /// Link ADR to commits.
87    Link(link::Args),
88
89    /// Create a superseding ADR.
90    Supersede(supersede::Args),
91
92    /// Show git log with ADR annotations.
93    Log(log::Args),
94
95    /// Show ADR statistics.
96    Stats(stats::Args),
97
98    /// Convert ADR between formats.
99    Convert(convert::Args),
100
101    /// Attach a file to an ADR.
102    Attach(attach::Args),
103
104    /// List artifacts attached to an ADR.
105    Artifacts(artifacts::Args),
106
107    /// Export ADRs to various formats.
108    Export(export::Args),
109
110    /// Import ADRs from files.
111    Import(import::Args),
112
113    /// Manage git hooks for ADR workflows.
114    Hooks(hooks::Args),
115
116    /// Generate CI/CD workflows for ADR integration.
117    Ci(ci::Args),
118
119    /// Generate project templates with ADR integration.
120    Templates(templates::Args),
121
122    /// Generate ADR analytics report.
123    Report(report::Args),
124
125    /// Export ADR metrics as JSON.
126    Metrics(metrics::Args),
127
128    /// Interactive onboarding wizard for new team members.
129    Onboard(onboard::Args),
130
131    /// AI-assisted ADR operations.
132    #[cfg(feature = "ai")]
133    Ai(ai::Args),
134
135    /// Wiki synchronization.
136    #[cfg(feature = "wiki")]
137    Wiki(wiki::Args),
138}