pub mod handler;
pub mod handlers;
use clap::{Parser, Subcommand, ValueEnum};
#[derive(Debug, Clone, ValueEnum)]
pub enum CompletionType {
Tasks,
Todos,
Links,
Repos,
}
#[derive(Parser)]
#[command(name = "track")]
#[command(about = "WorkTracker CLI - Manage your development tasks and context", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
New {
name: String,
#[arg(short, long)]
description: Option<String>,
#[arg(short, long)]
ticket: Option<String>,
#[arg(long)]
ticket_url: Option<String>,
#[arg(long)]
template: Option<String>,
},
List {
#[arg(short, long)]
all: bool,
},
Switch {
task_ref: String,
},
Status {
id: Option<String>,
#[arg(short, long)]
json: bool,
#[arg(short, long)]
all: bool,
},
Desc {
description: Option<String>,
#[arg(short, long)]
task: Option<i64>,
},
Ticket {
ticket_id: String,
url: String,
#[arg(long)]
task: Option<i64>,
},
Archive {
task_ref: Option<String>,
},
#[command(subcommand)]
Todo(TodoCommands),
#[command(subcommand)]
Link(LinkCommands),
#[command(subcommand)]
Scrap(ScrapCommands),
Sync,
#[command(subcommand)]
Repo(RepoCommands),
#[command(subcommand)]
Alias(AliasCommands),
LlmHelp,
Completion {
#[arg(value_enum)]
shell: clap_complete::Shell,
#[arg(short, long)]
dynamic: bool,
},
#[command(hide = true)]
#[command(name = "_complete")]
Complete {
#[arg(value_enum)]
completion_type: CompletionType,
},
#[command(subcommand)]
Config(ConfigCommands),
Webui {
#[arg(short, long, default_value = "3000")]
port: u16,
#[arg(short, long)]
open: bool,
},
}
#[derive(Subcommand)]
pub enum TodoCommands {
Add {
text: String,
#[arg(short, long)]
worktree: bool,
},
List,
Update {
id: i64,
status: String,
},
Done {
id: i64,
},
Workspace {
id: i64,
#[arg(long)]
recreate: bool,
#[arg(short, long)]
force: bool,
#[arg(long)]
all: bool,
},
Delete {
id: i64,
#[arg(short, long)]
force: bool,
},
Next {
id: i64,
},
}
#[derive(Subcommand)]
pub enum LinkCommands {
Add {
url: String,
title: Option<String>,
},
List,
Delete {
index: usize,
},
}
#[derive(Subcommand)]
pub enum ScrapCommands {
Add {
content: String,
},
List,
}
#[derive(Subcommand)]
pub enum RepoCommands {
Add {
path: Option<String>,
#[arg(short, long)]
base: Option<String>,
},
List,
Remove {
id: i64,
},
}
#[derive(Subcommand)]
pub enum AliasCommands {
Set {
alias: String,
#[arg(short, long)]
task: Option<i64>,
#[arg(short, long)]
force: bool,
},
Remove {
#[arg(short, long)]
task: Option<i64>,
},
}
#[derive(Subcommand)]
pub enum ConfigCommands {
Set {
key: String,
value: String,
},
SetCalendar {
calendar_id: String,
},
Show,
}