1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use aphid::agent::AgentTool;
use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(name = "aphid", version, about, long_about = None)]
pub struct Cli {
#[arg(short, long, default_value = "aphid.toml", global = true)]
pub config: PathBuf,
#[command(subcommand)]
pub command: Option<Command>,
}
#[derive(Subcommand)]
pub enum Command {
Build {
/// Output directory for the rendered site.
#[arg(short, long, default_value = "dist")]
output: PathBuf,
},
Serve {
#[arg(short, long, default_value_t = 3000)]
port: u16,
},
/// Create a new aphid site in a new directory.
New {
/// Name of the directory to create.
name: String,
/// Also write AI-agent instruction files. Omit the value for a generic AGENTS.md.
#[arg(long, value_name = "TOOL", num_args = 0..=1, default_missing_value = "codex")]
agent: Option<AgentTool>,
},
/// Initialize an aphid site in the current directory.
Init {
/// Directory to initialize (defaults to current directory).
path: Option<PathBuf>,
/// Also write AI-agent instruction files. Omit the value for a generic AGENTS.md.
#[arg(long, value_name = "TOOL", num_args = 0..=1, default_missing_value = "codex")]
agent: Option<AgentTool>,
},
/// Manage blog posts.
Blog {
#[command(subcommand)]
action: BlogAction,
},
/// Manage wiki pages.
Wiki {
#[command(subcommand)]
action: WikiAction,
},
/// Manage standalone pages.
Page {
#[command(subcommand)]
action: PageAction,
},
/// Write AI-agent instruction files for this site.
///
/// Omit the tool argument for a generic AGENTS.md — recognised by Codex, Aider,
/// Goose, and current Cursor.
Agent {
/// Target agent.
#[arg(default_value = "codex")]
tool: AgentTool,
},
}
#[derive(Subcommand)]
pub enum BlogAction {
/// Create a new blog post.
New {
/// Title of the blog post.
title: String,
},
}
#[derive(Subcommand)]
pub enum WikiAction {
/// Create a new wiki page.
New {
/// Title of the wiki page.
title: String,
},
}
#[derive(Subcommand)]
pub enum PageAction {
/// Create a new standalone page.
New {
/// Title of the page.
title: String,
},
}