Skip to main content

agent_first_mail/cli/
skill.rs

1use clap::{Args, Subcommand, ValueEnum};
2
3#[derive(Subcommand, Debug, Clone)]
4pub enum SkillAction {
5    /// Show whether the Agent-First Mail skill is installed and valid.
6    Status(SkillTargetArgs),
7    /// Install the Agent-First Mail skill.
8    Install(SkillWriteArgs),
9    /// Remove an afmail-managed Agent-First Mail skill.
10    Uninstall(SkillWriteArgs),
11}
12
13#[derive(Args, Debug, Clone)]
14pub struct SkillTargetArgs {
15    /// Agent to manage. Defaults to all personal skill targets.
16    #[arg(long = "agent", value_enum, default_value_t = SkillAgentSelection::All)]
17    pub agent: SkillAgentSelection,
18    /// Skill scope. Project scope installs under the current project's skill directory.
19    #[arg(long = "scope", value_enum, default_value_t = SkillScope::Personal)]
20    pub scope: SkillScope,
21    /// Directory that contains skill folders. Requires an explicit single --agent.
22    #[arg(long = "skills-dir")]
23    pub skills_dir: Option<String>,
24}
25
26#[derive(Args, Debug, Clone)]
27pub struct SkillWriteArgs {
28    #[command(flatten)]
29    pub target: SkillTargetArgs,
30    /// Overwrite or remove an unmanaged Agent-First Mail skill at the target path.
31    #[arg(long)]
32    pub force: bool,
33}
34
35#[derive(Clone, Copy, Debug, PartialEq, Eq, ValueEnum)]
36pub enum SkillAgentSelection {
37    /// Manage every agent that supports the requested scope.
38    All,
39    /// Manage the Codex skill under $CODEX_HOME/skills or .agents/skills.
40    Codex,
41    /// Manage the Claude Code skill under ~/.claude/skills or .claude/skills.
42    #[value(name = "claude-code", alias = "claude")]
43    ClaudeCode,
44    /// Manage the opencode skill under ~/.config/opencode/skills or .opencode/skills.
45    Opencode,
46}
47
48#[derive(Clone, Copy, Debug, PartialEq, Eq, ValueEnum)]
49pub enum SkillScope {
50    /// Install under the user-level skills directory.
51    Personal,
52    /// Install under the current project's skills directory.
53    Project,
54}