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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
use clap::{Parser, Subcommand, ValueEnum};
#[derive(Debug, Parser)]
#[command(
name = "shipflow",
version,
about = "Track lightweight intentions and celebrate what you ship",
long_about = "shipflow is a local-first, git-aware CLI for tracking what you intend to ship \
and generating reflective reports of what you actually shipped.",
after_help = "EXAMPLES:
shipflow add \"Fix login bug\" --tags rust,auth
shipflow list --status open
shipflow done fix-login
shipflow report week --format md
shipflow status
shipflow board
shipflow completions fish > ~/.config/fish/completions/shipflow.fish"
)]
pub struct Cli {
/// Enable verbose logging (sets RUST_LOG=shipflow=debug)
#[arg(long, global = true)]
pub verbose: bool,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
/// Add a new task to track
Add {
/// Task title
title: String,
/// Comma-separated tags
#[arg(long, value_delimiter = ',')]
tags: Vec<String>,
/// Optional note
#[arg(long)]
note: Option<String>,
/// Store in global config instead of current repo
#[arg(long)]
global: bool,
},
/// List tasks
List {
/// Filter by status
#[arg(long, value_enum, default_value = "all")]
status: ListStatus,
/// Filter by tags (AND semantics)
#[arg(long, value_delimiter = ',')]
tags: Vec<String>,
/// Use global storage
#[arg(long)]
global: bool,
},
/// Mark a task as done
Done {
/// Task ID prefix or partial title
query: String,
/// Link a specific git commit SHA
#[arg(long)]
commit: Option<String>,
/// Skip git commit linking
#[arg(long)]
no_link: bool,
/// Use global storage
#[arg(long)]
global: bool,
},
/// Generate a \"What I shipped\" report
Report {
/// Time period
#[arg(value_enum, default_value = "week")]
period: ReportPeriodArg,
/// Output format
#[arg(long, value_enum, default_value = "text")]
format: ReportFormatArg,
/// Use global storage
#[arg(long)]
global: bool,
},
/// Show overview and git context
Status {
/// Use global storage
#[arg(long)]
global: bool,
},
/// Interactive kanban board (requires `tui` feature)
#[cfg(feature = "tui")]
Board {
/// Use global storage
#[arg(long)]
global: bool,
},
/// Generate shell completions
Completions {
/// Shell to generate completions for
shell: clap_complete::Shell,
},
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum ListStatus {
Open,
Done,
All,
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum ReportPeriodArg {
Today,
Week,
Month,
All,
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum ReportFormatArg {
Text,
Md,
}