|
| 1 | +use clap::{Args, Subcommand, ValueEnum}; |
| 2 | + |
| 3 | +#[derive(Args)] |
| 4 | +#[command(after_long_help = "\ |
| 5 | +The Keito Skill is the agent UX layer on top of the Keito CLI. The skill |
| 6 | +uses the CLI for authentication and API writes, then installs Claude Code / |
| 7 | +Codex lifecycle hooks so local coding sessions can be logged automatically. |
| 8 | +
|
| 9 | +EXAMPLES: |
| 10 | + keito skill install |
| 11 | + keito skill install --agent codex |
| 12 | + keito skill status --json |
| 13 | + keito skill doctor")] |
| 14 | +pub struct SkillCommand { |
| 15 | + #[command(subcommand)] |
| 16 | + pub command: SkillSubcommand, |
| 17 | +} |
| 18 | + |
| 19 | +#[derive(Subcommand)] |
| 20 | +pub enum SkillSubcommand { |
| 21 | + /// Install the Keito Skill and configure supported agent hooks |
| 22 | + #[command(long_about = "\ |
| 23 | +Install the Keito Skill via the open skills CLI, then run the installed hook |
| 24 | +installer for each selected agent. |
| 25 | +
|
| 26 | +By default this configures both Codex and Claude Code. The skill still needs |
| 27 | +per-repository setup after installation: cd into a client repo and run |
| 28 | +/track-time-keito to select its Keito client, project, and task.")] |
| 29 | + Install { |
| 30 | + /// Skill source for npx skills add |
| 31 | + #[arg( |
| 32 | + long, |
| 33 | + default_value = "keito-ai/keito-skill", |
| 34 | + env = "KEITO_SKILL_SOURCE" |
| 35 | + )] |
| 36 | + source: String, |
| 37 | + |
| 38 | + /// Agent hook target to configure |
| 39 | + #[arg(long, value_enum)] |
| 40 | + agent: Vec<SkillAgent>, |
| 41 | + |
| 42 | + /// Skip running npx skills add and only run hook installers if present |
| 43 | + #[arg(long)] |
| 44 | + skip_skills_add: bool, |
| 45 | + }, |
| 46 | + |
| 47 | + /// Show install/auth/hook status for the Keito Skill |
| 48 | + Status, |
| 49 | + |
| 50 | + /// Run readiness checks and print next actions |
| 51 | + Doctor, |
| 52 | +} |
| 53 | + |
| 54 | +#[derive(Debug, Clone, Copy, ValueEnum, PartialEq, Eq)] |
| 55 | +pub enum SkillAgent { |
| 56 | + Codex, |
| 57 | + ClaudeCode, |
| 58 | +} |
| 59 | + |
| 60 | +impl SkillAgent { |
| 61 | + pub fn skills_cli_name(self) -> &'static str { |
| 62 | + match self { |
| 63 | + SkillAgent::Codex => "codex", |
| 64 | + SkillAgent::ClaudeCode => "claude-code", |
| 65 | + } |
| 66 | + } |
| 67 | + |
| 68 | + pub fn display_name(self) -> &'static str { |
| 69 | + match self { |
| 70 | + SkillAgent::Codex => "Codex", |
| 71 | + SkillAgent::ClaudeCode => "Claude Code", |
| 72 | + } |
| 73 | + } |
| 74 | +} |
0 commit comments