anesis 0.12.5

CLI for scaffolding projects from remote templates and extending them with project addons
Documentation
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
use clap::Subcommand;

use crate::completions::CompletionShell;

#[derive(Subcommand)]
pub enum AddonCommands {
  #[command(alias = "i", about = "Install and cache an addon (anesis addon i)")]
  Install {
    #[arg(help = "Addon id to install (omit to pick interactively)")]
    addon_id: Option<String>,
  },

  #[command(about = "Validate a local directory and cache it as an addon for local testing")]
  Link {
    #[arg(help = "Path to the addon directory (defaults to the current directory)")]
    path: Option<String>,

    #[arg(
      short,
      long,
      help = "Overwrite an existing cached addon without asking"
    )]
    force: bool,
  },

  #[command(alias = "l", about = "List installed addons (anesis addon l)")]
  List {
    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(
    about = "Show an addon's manifest: description, version, variants, commands, inputs and steps"
  )]
  Info {
    #[arg(help = "Addon id to inspect")]
    addon_id: String,

    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(about = "Dry-run an addon command on a throwaway copy of a project and show the diff")]
  Test {
    #[arg(help = "Addon id to test")]
    addon_id: String,

    #[arg(help = "Command to run")]
    command: String,

    #[arg(
      long,
      value_name = "PATH",
      help = "Fixture project to test on (defaults to the addon's bundled test-fixture/)"
    )]
    project: Option<String>,
  },

  #[command(alias = "r", about = "Remove a cached addon (anesis addon r)")]
  Remove { addon_id: String },

  #[command(
    alias = "p",
    about = "Publish a GitHub repository as an Anesis addon (anesis addon p)"
  )]
  Publish {
    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
    addon_url: String,

    #[arg(
      long,
      value_name = "VISIBILITY",
      help = "Visibility: public, private, org-private (default: public)"
    )]
    visibility: Option<String>,

    #[arg(
      long,
      value_name = "UUID",
      help = "Credential ID for private GitHub repositories"
    )]
    credential_id: Option<String>,

    #[arg(long, value_name = "UUID", help = "Organization ID to publish under")]
    org_id: Option<String>,
  },

  #[command(
    alias = "u",
    about = "Update a GitHub repository as an Anesis addon (anesis addon u)"
  )]
  Update {
    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
    addon_url: String,

    #[arg(
      long,
      value_name = "VISIBILITY",
      help = "Visibility: public, private, org-private"
    )]
    visibility: Option<String>,

    #[arg(
      long,
      value_name = "UUID",
      help = "Credential ID for private GitHub repositories"
    )]
    credential_id: Option<String>,

    #[arg(long, value_name = "UUID", help = "Organization ID")]
    org_id: Option<String>,
  },
}

#[derive(Subcommand)]
pub enum TemplateCommands {
  #[command(
    alias = "i",
    about = "Download and cache a template locally (anesis template i)"
  )]
  Install {
    #[arg(help = "Name of the template to install (omit to pick interactively)")]
    template_name: Option<String>,
  },

  #[command(about = "Validate a local directory and cache it as a template for local testing")]
  Link {
    #[arg(help = "Path to the template directory (defaults to the current directory)")]
    path: Option<String>,

    #[arg(
      short,
      long,
      help = "Overwrite an existing cached template without asking"
    )]
    force: bool,
  },

  #[command(
    alias = "l",
    about = "List all locally installed templates (anesis template l)"
  )]
  List {
    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(about = "Show a template's manifest: description, version and repository")]
  Info {
    #[arg(help = "Name of the template to inspect")]
    template_name: String,

    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(
    alias = "r",
    about = "Remove an installed template from the local cache (anesis template r)"
  )]
  Remove {
    #[arg(help = "Name of the template to remove")]
    template_name: String,
  },

  #[command(
    alias = "p",
    about = "Publish a GitHub repository as an Anesis template (anesis template p)"
  )]
  Publish {
    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
    template_url: String,

    #[arg(
      long,
      value_name = "VISIBILITY",
      help = "Visibility: public, private, org-private (default: public)"
    )]
    visibility: Option<String>,

    #[arg(
      long,
      value_name = "UUID",
      help = "Credential ID for private GitHub repositories"
    )]
    credential_id: Option<String>,

    #[arg(long, value_name = "UUID", help = "Organization ID to publish under")]
    org_id: Option<String>,
  },

  #[command(
    alias = "u",
    about = "Update a GitHub repository as an Anesis template (anesis template u)"
  )]
  Update {
    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
    template_url: String,

    #[arg(
      long,
      value_name = "VISIBILITY",
      help = "Visibility: public, private, org-private"
    )]
    visibility: Option<String>,

    #[arg(
      long,
      value_name = "UUID",
      help = "Credential ID for private GitHub repositories"
    )]
    credential_id: Option<String>,

    #[arg(long, value_name = "UUID", help = "Organization ID")]
    org_id: Option<String>,
  },
}

#[derive(Subcommand)]
pub enum StackCommands {
  #[command(
    alias = "i",
    about = "Download and cache a stack from the registry (anesis stack i)"
  )]
  Install {
    #[arg(help = "Stack id to install")]
    stack_id: String,
  },

  #[command(alias = "l", about = "List locally installed stacks (anesis stack l)")]
  List {
    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(about = "Show a stack's composition: template and addons")]
  Info {
    #[arg(help = "Stack id to inspect")]
    stack_id: String,

    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(alias = "r", about = "Remove a locally cached stack (anesis stack r)")]
  Remove {
    #[arg(help = "Stack id to remove")]
    stack_id: String,
  },

  #[command(
    alias = "p",
    about = "Publish a GitHub repository as an Anesis stack (anesis stack p)"
  )]
  Publish {
    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
    stack_url: String,

    #[arg(
      long,
      value_name = "VISIBILITY",
      help = "Visibility: public, private (default: public)"
    )]
    visibility: Option<String>,

    #[arg(
      long,
      value_name = "UUID",
      help = "Credential ID for private GitHub repositories"
    )]
    credential_id: Option<String>,

    #[arg(long, value_name = "UUID", help = "Organization ID to publish under")]
    org_id: Option<String>,
  },

  #[command(
    alias = "u",
    about = "Republish a stack from its GitHub repository (anesis stack u)"
  )]
  Update {
    #[arg(help = "GitHub repository URL (e.g. https://github.com/owner/repo)")]
    stack_url: String,

    #[arg(long, value_name = "VISIBILITY", help = "Visibility: public, private")]
    visibility: Option<String>,

    #[arg(
      long,
      value_name = "UUID",
      help = "Credential ID for private GitHub repositories"
    )]
    credential_id: Option<String>,

    #[arg(long, value_name = "UUID", help = "Organization ID")]
    org_id: Option<String>,
  },
}

#[derive(Subcommand)]
pub enum Commands {
  #[command(alias = "n", about = "Create a new project from a template (anesis n)")]
  New {
    #[arg(help = "Name of the project directory to create")]
    name: String,

    #[arg(help = "Name of the template to use (omit to pick interactively)")]
    template_name: Option<String>,

    #[arg(
      long,
      value_name = "PATH",
      help = "Scaffold from a stack manifest (anesis.stack.json): template + ordered addons"
    )]
    stack: Option<String>,

    #[arg(short, long, help = "Pick only from already-downloaded templates")]
    installed: bool,

    #[arg(short, long, help = "Accept all defaults, skip confirmation prompts")]
    yes: bool,

    #[arg(
      long,
      value_name = "NAME=VALUE",
      help = "Provide an input value non-interactively (repeatable)"
    )]
    input: Vec<String>,
  },

  #[command(alias = "t", about = "Manage templates (anesis t)")]
  Template {
    #[command(subcommand)]
    command: TemplateCommands,
  },

  #[command(alias = "in", about = "Log in to your Anesis account (anesis in)")]
  Login,

  #[command(alias = "out", about = "Log out of your Anesis account (anesis out)")]
  Logout,

  #[command(about = "Show information about the currently logged-in account")]
  Account {
    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(alias = "a", about = "Manage addons (anesis a)")]
  Addon {
    #[command(subcommand)]
    command: AddonCommands,
  },

  #[command(
    alias = "s",
    about = "Manage stacks: template + ordered addons (anesis s)"
  )]
  Stack {
    #[command(subcommand)]
    command: StackCommands,
  },

  #[command(
    about = "Run an addon command in the current project (anesis use [ADDON_ID] [COMMAND])"
  )]
  Use {
    #[arg(help = "Addon id (omit to pick interactively)")]
    addon_id: Option<String>,

    #[arg(help = "Command to run (omit to list the addon's commands)")]
    command: Option<String>,

    #[arg(short, long, help = "Pick only from already-downloaded addons")]
    installed: bool,

    #[arg(short, long, help = "Accept all defaults, skip confirmation prompts")]
    yes: bool,

    #[arg(
      long,
      value_name = "NAME=VALUE",
      help = "Provide an input value non-interactively (repeatable)"
    )]
    input: Vec<String>,

    #[arg(
      long,
      help = "Show the plan (variant, inputs, steps) without changing any files"
    )]
    dry_run: bool,
  },

  #[command(about = "Revert an applied addon's changes in the current project")]
  Undo {
    #[arg(help = "Addon id to revert")]
    addon_id: String,

    #[arg(short = 'y', long, help = "Skip the confirmation prompt")]
    yes: bool,
  },

  #[command(about = "List applied addons that have a newer version in the registry")]
  Outdated,

  #[command(about = "Upgrade an applied addon to the registry's latest version")]
  Update {
    #[arg(help = "Addon id to update")]
    addon_id: String,

    #[arg(
      short = 'y',
      long,
      help = "Accept all defaults, skip confirmation prompts"
    )]
    yes: bool,
  },

  #[command(about = "Download and install the latest Anesis release")]
  Upgrade,

  #[command(
    about = "Run an MCP (Model Context Protocol) stdio server so AI agents can drive Anesis"
  )]
  Mcp,

  #[command(about = "Install shell tab completion for anesis")]
  Completions {
    #[arg(value_enum, help = "Shell to install completions for")]
    shell: CompletionShell,
  },

  #[command(about = "Interactively search the registry for templates and addons")]
  Search {
    #[arg(help = "Pre-fill the filter (optional; you can also type in the picker)")]
    query: Option<String>,

    #[arg(
      long,
      help = "Output matching results as JSON instead of opening the picker"
    )]
    json: bool,
  },

  #[command(
    alias = "doctor",
    about = "Show CLI version, data paths and login status"
  )]
  Info {
    #[arg(long, help = "Output as JSON")]
    json: bool,
  },

  #[command(about = "Show this project's template and applied addons (anesis status)")]
  Status {
    #[arg(long, help = "Output as JSON")]
    json: bool,
  },
}