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. Workspace scope installs under the current workspace'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 .codex/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    /// Manage the Hermes skill under $HERMES_HOME/skills or ~/.hermes/skills.
47    Hermes,
48}
49
50#[derive(Clone, Copy, Debug, PartialEq, Eq, ValueEnum)]
51pub enum SkillScope {
52    /// Install under the user-level skills directory.
53    Personal,
54    /// Install under the current workspace's skills directory.
55    Workspace,
56}