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
use anyhow::Result;
use clap::Subcommand;
pub mod add;
pub mod allocation;
pub mod app;
pub mod build;
pub mod chart;
pub mod deploy;
pub mod dialeto;
pub mod ephemeral;
pub mod ephemeral_runtime;
pub mod fmt;
pub mod init;
pub mod lint;
pub mod load;
pub mod lock;
pub mod nix;
pub mod pool;
pub mod publish;
pub mod resolve;
pub mod tofu;
#[derive(Subcommand)]
pub enum Command {
/// Scaffold a new caixa in a new or existing (empty) directory.
Init(init::Init),
/// Add a dependency to the caixa.lisp in CWD.
Add(add::Add),
/// Resolve deps + write lacre.lisp (git-cloning sources, transitive).
Resolve(resolve::Resolve),
/// Legacy: stub-resolve deps (no git). Kept as an escape hatch — in
/// phase 1.B the default `feira lock` delegates to `feira resolve`.
Lock(lock::Lock),
/// Validate caixa.lisp + layout + every :bibliotecas entry parses.
Build(build::Build),
/// Format a caixa.lisp / lacre.lisp / .lisp source in place (via caixa-fmt).
Fmt(fmt::Fmt),
/// Lint a caixa.lisp source (via caixa-lint, Nord-themed output).
Lint(lint::Lint),
/// Classify every caixa manifest in a tree by dialect, and fail on an
/// unclassifiable or wrong-dialect manifest. Default-on, hard.
Dialeto(dialeto::Dialeto),
/// Emit a flake.nix for the caixa.
Nix(nix::Nix),
/// Render a per-program lareira-<name> Helm chart (via caixa-helm).
Chart(chart::Chart),
/// Deploy a caixa Servico to a target cluster (upserts the entry into
/// k8s/clusters/<cluster>/programs.yaml; FluxCD picks it up).
Deploy(deploy::Deploy),
/// `feira app …` — composition verbs for `:kind Aplicacao` caixas
/// (graph, deploy). See `theory/MESH-COMPOSITION.md`.
App(app::App),
/// `feira ephemeral …` — verbs for `(defephemeral …)` Lisp forms:
/// compile + lower to a Process CR YAML for review or apply.
Ephemeral(ephemeral::Ephemeral),
/// `feira pool …` — manage EphemeralPool CRs (list/scale/delete/apply/status).
Pool(pool::Pool),
/// `feira allocation …` — manage EphemeralAllocation CRs (request/release/list/status).
Allocation(allocation::Allocation),
/// Tag + push the current caixa's versao to its Git origin.
Publish(publish::Publish),
/// End-to-end: Lisp → teia → arch proof → HCL → tofu plan/apply/destroy.
Tofu(tofu::Tofu),
}
impl Command {
pub fn run(self) -> Result<()> {
match self {
Self::Init(c) => c.run(),
Self::Add(c) => c.run(),
Self::Resolve(c) => c.run(),
Self::Lock(c) => c.run(),
Self::Build(c) => c.run(),
Self::Fmt(c) => c.run(),
Self::Lint(c) => c.run(),
Self::Dialeto(c) => c.run(),
Self::Nix(c) => c.run(),
Self::Chart(c) => c.run(),
Self::Deploy(c) => c.run(),
Self::App(c) => c.run(),
Self::Ephemeral(c) => c.run(),
Self::Pool(c) => c.run(),
Self::Allocation(c) => c.run(),
Self::Publish(c) => c.run(),
Self::Tofu(c) => c.run(),
}
}
}