Skip to main content

ane/frontend/
cli.rs

1use std::path::PathBuf;
2
3use clap::{Parser, Subcommand};
4
5#[derive(Parser, Debug)]
6#[command(name = "ane", version, about = "Agent Native Editor")]
7pub struct Cli {
8    #[command(subcommand)]
9    pub command: Option<Command>,
10
11    /// File or directory to open in the TUI
12    #[arg(default_value = ".")]
13    pub path: PathBuf,
14}
15
16#[derive(Subcommand, Debug)]
17pub enum Command {
18    /// Execute a chord on a file or directory (no TUI, outputs diff)
19    Exec {
20        /// The chord to execute (e.g. "cala 5 new text")
21        #[arg(short, long)]
22        chord: String,
23
24        /// Target file path
25        #[arg()]
26        path: PathBuf,
27    },
28    /// Initialize ane skill for a code agent (writes skill file to agent's directory)
29    Init {
30        /// Agent name (claude, codex, gemini, opencode, cline, maki, charm)
31        #[arg()]
32        agent: String,
33    },
34}
35
36pub fn parse() -> Cli {
37    Cli::parse()
38}