@sppg2001/atomize 1.2.4 → 2.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,962 @@
1
+ # Atomize CLI Reference
2
+
3
+ Complete command-line interface documentation for Atomize v2.0.0-alpha.0.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Installation](#installation)
8
+ - [Global Options](#global-options)
9
+ - [Commands Overview](#commands-overview)
10
+ - [Command Reference](#command-reference)
11
+ - [auth](#auth)
12
+ - [generate](#generate)
13
+ - [fields](#fields)
14
+ - [validate](#validate)
15
+ - [template create](#template-create)
16
+ - [template list](#template-list)
17
+ - [template install](#template-install)
18
+ - [template remove](#template-remove)
19
+ - [template resolve](#template-resolve)
20
+ - [queries list](#queries-list)
21
+ - [Configuration](#configuration)
22
+ - [Interactive Prompts & Navigation](#interactive-prompts--navigation)
23
+ - [Examples](#examples)
24
+ - [Troubleshooting](#troubleshooting)
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ # Global installation (recommended)
32
+ npm install -g @sppg2001/atomize
33
+
34
+ # Install the alpha
35
+ npm install -g @sppg2001/atomize@alpha
36
+
37
+ # Verify installation
38
+ atomize --version
39
+
40
+ # Show help
41
+ atomize --help
42
+ ```
43
+
44
+ **Aliases:** Both `atomize` and `atom` work as the CLI command.
45
+
46
+ ---
47
+
48
+ ## Global Options
49
+
50
+ These options work with any command:
51
+
52
+ | Option | Description |
53
+ |--------|-------------|
54
+ | `--version` | Print the installed version |
55
+ | `--help` | Show help for a command |
56
+ | `--env-file <path>` | Load environment variables from a file before running the command (shell environment takes precedence over file values) |
57
+
58
+ ---
59
+
60
+ ## Commands Overview
61
+
62
+ | Command | Alias | Description |
63
+ |---------|-------|-------------|
64
+ | `auth` | - | Manage named connection profiles |
65
+ | `auth add` | - | Add a new connection profile |
66
+ | `auth list` | `auth ls` | List all saved profiles |
67
+ | `auth use` | - | Set a profile as the default |
68
+ | `auth remove` | `auth rm` | Remove a profile |
69
+ | `auth test` | - | Test connectivity for a profile |
70
+ | `auth rotate` | - | Replace the PAT for a profile |
71
+ | `generate` | `gen` | Generate tasks from user stories using a template |
72
+ | `fields` | - | Browse Azure DevOps work item fields |
73
+ | `fields list` | `fields ls` | List available fields for the current project or work item type |
74
+ | `validate` | - | Validate a template file |
75
+ | `template` | `tpl` | Template management commands |
76
+ | `template create` | - | Create a new template interactively or with AI |
77
+ | `template list` | `template ls` | List available templates and mixins from the catalog |
78
+ | `template install` | - | Install a template or mixin from a local file or HTTPS URL |
79
+ | `template remove` | `template rm` | Remove a user-installed template or mixin |
80
+ | `template resolve` | - | Resolve a composed template and print the merged result |
81
+ | `queries` | - | Browse Azure DevOps saved queries |
82
+ | `queries list` | `queries ls` | List saved queries with paths and IDs |
83
+
84
+ ---
85
+
86
+ ## Command Reference
87
+
88
+ ### auth
89
+
90
+ Manage named connection profiles. Profiles store your credentials in the OS keychain when available. If the keychain is unavailable, `--insecure-storage` opts into an insecure local file fallback at `~/.atomize/`.
91
+
92
+ Two profile types are supported:
93
+ - **Azure DevOps** — for `generate`, `validate`, `fields list`, and `queries list`
94
+ - **GitHub Models (AI)** — for AI-assisted template generation (`template create --ai`)
95
+
96
+ #### auth add
97
+
98
+ Add a new connection profile.
99
+
100
+ ```bash
101
+ atomize auth add [name] [options]
102
+ ```
103
+
104
+ | Option | Description |
105
+ |--------|-------------|
106
+ | `--org-url <url>` | Organization URL (e.g. `https://dev.azure.com/myorg`) — Azure DevOps only |
107
+ | `--project <name>` | Project name — Azure DevOps only |
108
+ | `--team <name>` | Team name — Azure DevOps only |
109
+ | `--default` | Set this profile as the default for its platform |
110
+ | `--pat-stdin` | Read the PAT from stdin instead of `ATOMIZE_PAT` (preferred in CI) |
111
+ | `--insecure-storage` | Allow storing the token in an insecure local file fallback when the OS keychain is unavailable |
112
+
113
+ When run interactively, `auth add` first asks which platform to configure:
114
+
115
+ ```
116
+ ? Platform:
117
+ ● Azure DevOps
118
+ ○ GitHub Models (AI template generation)
119
+ ```
120
+
121
+ **Adding an Azure DevOps profile:**
122
+ ```bash
123
+ atomize auth add work-ado
124
+ # Prompts for org URL, project, team, and PAT
125
+ ```
126
+
127
+ **Adding a GitHub Models (AI) profile:**
128
+ ```bash
129
+ atomize auth add my-ai
130
+ # Prompts for a GitHub personal access token with Models access
131
+ ```
132
+
133
+ **Non-interactive (Azure DevOps, CI/CD):**
134
+ ```bash
135
+ echo "$AZURE_DEVOPS_PAT" | atomize auth add work-ado \
136
+ --org-url https://dev.azure.com/myorg \
137
+ --project MyProject \
138
+ --team MyTeam \
139
+ --default \
140
+ --pat-stdin
141
+ ```
142
+
143
+ Profile names may contain letters, numbers, hyphens, and underscores.
144
+
145
+ ---
146
+
147
+ #### auth list
148
+
149
+ List all saved connection profiles.
150
+
151
+ ```bash
152
+ atomize auth list
153
+ atomize auth ls # alias
154
+ ```
155
+
156
+ **Output:**
157
+ ```
158
+ work-ado (Azure DevOps · default)
159
+ URL: https://dev.azure.com/myorg
160
+ Project: MyProject
161
+ Team: MyTeam
162
+ Token: [keychain]
163
+ Created: 1/3/2026, 10:00:00 AM
164
+
165
+ my-ai (GitHub Models (AI) · default)
166
+ Token: [keychain]
167
+ Created: 1/3/2026, 10:05:00 AM
168
+ ```
169
+
170
+ ---
171
+
172
+ #### auth use
173
+
174
+ Set a profile as the default for its platform. Each platform (`azure-devops`, `github-models`) can have its own independent default.
175
+
176
+ ```bash
177
+ atomize auth use [name]
178
+ ```
179
+
180
+ ```bash
181
+ atomize auth use work-ado # sets default Azure DevOps profile
182
+ atomize auth use my-ai # sets default GitHub Models (AI) profile
183
+ atomize auth use # pick interactively
184
+ ```
185
+
186
+ ---
187
+
188
+ #### auth remove
189
+
190
+ Remove a saved connection profile.
191
+
192
+ ```bash
193
+ atomize auth remove [name]
194
+ atomize auth rm [name] # alias
195
+ ```
196
+
197
+ ---
198
+
199
+ #### auth test
200
+
201
+ Test connectivity for a profile. Automatically detects whether the profile is an Azure DevOps or GitHub Models (AI) profile and runs the appropriate check.
202
+
203
+ - **Azure DevOps** — executes a WIQL query against your project to verify credentials and project access
204
+ - **GitHub Models (AI)** — calls the models listing endpoint to verify the token
205
+
206
+ ```bash
207
+ atomize auth test [name]
208
+ ```
209
+
210
+ ```bash
211
+ atomize auth test work-ado # test a specific profile
212
+ atomize auth test my-ai # test an AI provider profile
213
+ atomize auth test # pick interactively (shows profile type next to each name)
214
+ ```
215
+
216
+ ---
217
+
218
+ #### auth rotate
219
+
220
+ Replace the stored PAT for a profile (e.g. after a token expires).
221
+
222
+ ```bash
223
+ atomize auth rotate [name]
224
+ ```
225
+
226
+ ---
227
+
228
+ ### generate
229
+
230
+ Generate tasks from user stories using a template. By default runs as a dry run (preview only). Use `--execute` to actually create tasks.
231
+
232
+ #### Usage
233
+
234
+ ```bash
235
+ atomize generate [template] [options]
236
+ atomize gen [template] [options] # alias
237
+ ```
238
+
239
+ #### Arguments
240
+
241
+ | Argument | Description |
242
+ |----------|-------------|
243
+ | `[template]` | Path to a YAML template file or catalog ref (e.g. `template:backend-api`). If omitted, you will be prompted. |
244
+
245
+ #### Options
246
+
247
+ | Option | Type | Default | Description |
248
+ |--------|------|---------|-------------|
249
+ | `-p, --platform <platform>` | string | `azure-devops` | Platform to use. Options: `azure-devops`, `mock` |
250
+ | `--profile <name>` | string | - | Named connection profile to use (see `auth add`) |
251
+ | `--execute` | flag | - | Actually create tasks (default is dry-run preview) |
252
+ | `--auto-approve` | flag | - | Required with `--execute` in non-interactive mode to acknowledge live task creation |
253
+ | `--continue-on-error` | flag | - | Keep processing other stories if one fails |
254
+ | `--story <ids...>` | string[] | - | Target specific work items by ID, bypassing the template filter. `excludeIfHasTasks` still applies. |
255
+ | `--story-concurrency <n>` | number | `3` | Max stories processed in parallel (max: 10) |
256
+ | `--task-concurrency <n>` | number | `5` | Max tasks created in parallel per story (max: 20) |
257
+ | `--dependency-concurrency <n>` | number | `5` | Max dependency links created in parallel (max: 10) |
258
+ | `--limit <n>` | number | - | Cap the number of work items processed (useful for testing before a full `--execute` run) |
259
+ | `-v, --verbose` | flag | - | Show detailed output including per-task breakdown |
260
+ | `-o, --output <file>` | string | - | Write a JSON report to this file path (for CI/CD) |
261
+ | `--include-sensitive-report-data` | flag | - | Include descriptions, custom fields, and platform-specific work item data in the JSON report (`--output` only) |
262
+ | `-q, --quiet` | flag | - | Suppress non-essential output |
263
+
264
+ #### Examples
265
+
266
+ **Dry run (default — no --execute):**
267
+ ```bash
268
+ atomize generate template:backend-api
269
+ ```
270
+
271
+ **Execute for real:**
272
+ ```bash
273
+ atomize generate template:backend-api --execute
274
+ ```
275
+
276
+ **Target specific stories by ID (bypasses filter):**
277
+ ```bash
278
+ atomize generate template:backend-api --story STORY-123 STORY-456
279
+ ```
280
+
281
+ Use `--story` to skip the template's `filter` criteria and process explicit work items directly. Useful for:
282
+ - Re-running a generation that failed partway through
283
+ - Processing a one-off story that does not match the template's usual filter
284
+ - Testing the template against a known story before a full run
285
+
286
+ `excludeIfHasTasks` still applies — stories that already have tasks are skipped unless you remove that flag from the template.
287
+
288
+ **Execute for real in CI/non-interactive mode:**
289
+ ```bash
290
+ atomize generate template:backend-api --execute --auto-approve
291
+ ```
292
+
293
+ **Mock platform (no credentials needed):**
294
+ ```bash
295
+ atomize generate template:backend-api --platform mock
296
+ ```
297
+
298
+ **Test against a subset of items before a full run:**
299
+ ```bash
300
+ atomize generate template:backend-api --limit 5
301
+ ```
302
+
303
+ **CI/CD with JSON report:**
304
+ ```bash
305
+ atomize generate template:backend-api \
306
+ --execute \
307
+ --output report.json \
308
+ --quiet
309
+ ```
310
+
311
+ By default the JSON report omits story descriptions, custom field values, and raw platform payloads to avoid accidentally writing sensitive data to disk or log collectors. Pass `--include-sensitive-report-data` to include them:
312
+
313
+ ```bash
314
+ atomize generate template:backend-api \
315
+ --execute \
316
+ --output report.json \
317
+ --include-sensitive-report-data
318
+ ```
319
+
320
+ When to use `--include-sensitive-report-data`:
321
+ - Debugging unexpected task output (custom field values, description interpolation)
322
+ - Auditing exactly what was sent to the platform
323
+ - Internal tooling that processes the full report programmatically
324
+
325
+ Do not use it in shared CI pipelines where the report artifact may be visible to other users.
326
+
327
+ #### Exit Codes
328
+
329
+ | Code | Meaning |
330
+ |------|---------|
331
+ | `0` | All stories processed successfully |
332
+ | `1` | One or more stories failed |
333
+
334
+ ---
335
+
336
+ ### validate
337
+
338
+ Validate a template file for correctness and completeness.
339
+
340
+ #### Usage
341
+
342
+ ```bash
343
+ atomize validate <template> [options]
344
+ ```
345
+
346
+ #### Arguments
347
+
348
+ | Argument | Description |
349
+ |----------|-------------|
350
+ | `<template>` | Path to a YAML template file or HTTPS URL. **Required.** |
351
+
352
+ #### Options
353
+
354
+ | Option | Type | Default | Description |
355
+ |--------|------|---------|-------------|
356
+ | `-s, --strict` | flag | - | Use strict mode: warnings are treated as errors |
357
+ | `-q, --quiet` | flag | - | Suppress non-essential output |
358
+ | `--profile <name>` | string | - | Connect to ADO using a named profile for live saved-query and custom-field validation |
359
+
360
+ > See [Validation Modes](./Validation-Modes.md) for a full explanation of strict vs lenient behavior.
361
+
362
+ **Validation modes for ADO-backed features:**
363
+ - Without `--profile`, validation runs offline and checks template structure only
364
+ - With `--profile`, Atomize connects to ADO to validate task `customFields`, custom fields referenced in task conditions, and `filter.savedQuery`
365
+ - In interactive terminals, if ADO-backed validation is needed, Atomize can prompt you to choose offline vs online validation
366
+ - In `--strict` mode, offline custom-field verification warnings are promoted to errors
367
+
368
+ #### Examples
369
+
370
+ ```bash
371
+ atomize validate template:backend-api
372
+ atomize validate template:backend-api --strict
373
+ atomize validate template:backend-api --profile work-ado
374
+ atomize validate https://example.com/templates/shared.yaml
375
+ ```
376
+
377
+ #### Exit Codes
378
+
379
+ | Code | Meaning |
380
+ |------|---------|
381
+ | `0` | Template is valid |
382
+ | `1` | Template validation failed |
383
+
384
+ ---
385
+
386
+ ### fields
387
+
388
+ Browse Azure DevOps work item fields available to the current profile.
389
+
390
+ #### fields list
391
+
392
+ ```bash
393
+ atomize fields list [options]
394
+ atomize fields ls # alias
395
+ ```
396
+
397
+ | Option | Description |
398
+ |--------|-------------|
399
+ | `--type <WorkItemType>` | Scope results to a specific work item type such as `Task` or `Bug` |
400
+ | `--custom-only` | Show only custom fields (`Custom.*`) |
401
+ | `--profile <name>` | Named connection profile to use (uses default if omitted) |
402
+ | `--json` | Print results as JSON to stdout; progress messages go to stderr |
403
+
404
+ **Examples:**
405
+
406
+ ```bash
407
+ atomize fields list
408
+ atomize fields list --type Task
409
+ atomize fields list --type Task --custom-only
410
+ atomize fields list --type Task --json > task-fields.json
411
+ ```
412
+
413
+ ---
414
+
415
+ ### template create
416
+
417
+ Create a new template or mixin using one of several methods.
418
+
419
+ #### Usage
420
+
421
+ ```bash
422
+ atomize template create [options]
423
+ atomize tpl create [options] # alias
424
+ ```
425
+
426
+ #### Options
427
+
428
+ | Option | Type | Description |
429
+ |--------|------|-------------|
430
+ | `--type <type>` | string | Create a `template` or a `mixin` (prompted if omitted) |
431
+ | `--from <name>` | string | Start from an existing catalog template |
432
+ | `--from-stories <ids>` | string | Learn template from multiple stories (comma-separated IDs) |
433
+ | `--scratch` | flag | Jump directly to the interactive wizard (skips mode selection) |
434
+ | `--ai` | flag | Use AI-assisted generation — describe the template in natural language |
435
+ | `--ground` | flag | Ground AI generation with patterns from your Azure DevOps workspace |
436
+ | `--ai-profile <name>` | string | AI provider profile to use (uses default GitHub Models profile if omitted) |
437
+ | `--save-as <name>` | string | Name to save the template under in the catalog |
438
+ | `--profile <name>` | string | Named ADO profile for `--from-stories` and field suggestions (uses default if omitted) |
439
+ | `-p, --platform <platform>` | string | Platform for `--from-stories` (default: `azure-devops`) |
440
+ | `-q, --quiet` | flag | Suppress non-essential output |
441
+
442
+ #### Creation Modes
443
+
444
+ **1. From Catalog Template**
445
+
446
+ Start from a built-in or previously installed template.
447
+
448
+ ```bash
449
+ atomize template create --from backend-api
450
+ atomize template create --from my-custom-template
451
+ ```
452
+
453
+ Use `atomize template list` to see available names.
454
+
455
+ ---
456
+
457
+ **2. AI-Assisted Generation**
458
+
459
+ Describe the template you need in plain language and let AI generate it.
460
+
461
+ ```bash
462
+ # Basic AI generation
463
+ atomize template create --ai
464
+
465
+ # Ground with real patterns from your ADO workspace
466
+ atomize template create --ai --ground --profile work-ado
467
+
468
+ # Specify which AI profile to use
469
+ atomize template create --ai --ai-profile my-ai
470
+ ```
471
+
472
+ Requires a GitHub Models profile (`atomize auth add` → select GitHub Models).
473
+
474
+ ---
475
+
476
+ **3. Learn from Multiple Stories**
477
+
478
+ Analyze existing stories to detect patterns and build a higher-confidence template.
479
+
480
+ ```bash
481
+ atomize template create --from-stories STORY-1,STORY-2,STORY-3
482
+
483
+ atomize template create \
484
+ --from-stories STORY-123,STORY-456,STORY-789 \
485
+ --save-as api-pattern
486
+ ```
487
+
488
+ See [Story Learner](./Story-Learner.md) for details.
489
+
490
+ ---
491
+
492
+ **4. Interactive Wizard (From Scratch)**
493
+
494
+ Step-by-step guided builder for full control.
495
+
496
+ ```bash
497
+ atomize template create --scratch
498
+ ```
499
+
500
+ The wizard walks through basic information, filter configuration, task configuration (including composition — inheritance and mixins), estimation settings, validation rules, and metadata.
501
+
502
+ ---
503
+
504
+ #### Creating Mixins
505
+
506
+ A mixin is a reusable group of tasks that can be mixed into multiple templates via the `mixins:` field. Use `--type mixin` to create one.
507
+
508
+ ```bash
509
+ atomize template create --type mixin
510
+ atomize template create --type mixin --save-as security-review-tasks
511
+ ```
512
+
513
+ See [Template Reference — Composition](./Template-Reference.md#composition) for how to use mixins.
514
+
515
+ ---
516
+
517
+ ### template list
518
+
519
+ List available templates and mixins from the catalog (built-in and user-installed).
520
+
521
+ #### Usage
522
+
523
+ ```bash
524
+ atomize template list [options]
525
+ atomize template ls # alias
526
+ atomize tpl ls # alias
527
+ ```
528
+
529
+ #### Options
530
+
531
+ | Option | Description |
532
+ |--------|-------------|
533
+ | `--type <type>` | Filter by type: `template` or `mixin` |
534
+
535
+ #### Output
536
+
537
+ ```
538
+ Built-in Templates
539
+
540
+ backend-api
541
+ Backend API Development
542
+ Standard backend API development with database integration
543
+
544
+ feature
545
+ Feature Template
546
+ Foundation for feature templates
547
+
548
+ bug
549
+ Bug Template
550
+ Foundation for bug-fix templates
551
+
552
+ custom
553
+ Custom Example
554
+ Example template with custom fields
555
+
556
+ User Templates
557
+
558
+ my-api-template
559
+ My API Template
560
+ (no description)
561
+
562
+ Use with: atomize generate template:<name>
563
+ atomize template create --from <name>
564
+ ```
565
+
566
+ ---
567
+
568
+ ### template install
569
+
570
+ Install a template or mixin from a local file or HTTPS URL into the catalog.
571
+
572
+ #### Usage
573
+
574
+ ```bash
575
+ atomize template install <source> [options]
576
+ ```
577
+
578
+ #### Arguments
579
+
580
+ | Argument | Description |
581
+ |----------|-------------|
582
+ | `<source>` | Path to a local YAML file or an HTTPS URL |
583
+
584
+ #### Options
585
+
586
+ | Option | Description |
587
+ |--------|-------------|
588
+ | `--type <type>` | Force type: `template` or `mixin` (auto-detected from file content if omitted) |
589
+ | `--overwrite` | Overwrite if a template with the same name already exists |
590
+ | `--scope <scope>` | Installation scope: `user` (default, `~/.atomize`) or `project` (`.atomize` in current directory) |
591
+
592
+ #### Examples
593
+
594
+ ```bash
595
+ # Install from a local file
596
+ atomize template install ./templates/my-api.yaml
597
+
598
+ # Install from a URL (shared team template)
599
+ atomize template install https://example.com/templates/security-review.yaml
600
+
601
+ # Install as project-scoped (stored in .atomize/ next to your code)
602
+ atomize template install ./templates/sprint-tasks.yaml --scope project
603
+
604
+ # Overwrite an existing template
605
+ atomize template install ./templates/backend-api.yaml --overwrite
606
+ ```
607
+
608
+ **Scopes:**
609
+ - `user` (default) — installed to `~/.atomize/templates/`, available across all projects
610
+ - `project` — installed to `.atomize/templates/` in the current directory, scoped to this repo
611
+
612
+ ---
613
+
614
+ ### template remove
615
+
616
+ Remove a user-installed template or mixin from the catalog. Built-in templates cannot be removed.
617
+
618
+ #### Usage
619
+
620
+ ```bash
621
+ atomize template remove <name> [options]
622
+ atomize template rm <name> [options] # alias
623
+ ```
624
+
625
+ #### Arguments
626
+
627
+ | Argument | Description |
628
+ |----------|-------------|
629
+ | `<name>` | Template ref (`template:<name>` or `mixin:<name>`) or bare name |
630
+
631
+ #### Options
632
+
633
+ | Option | Description |
634
+ |--------|-------------|
635
+ | `--type <type>` | Restrict to a specific type: `template` or `mixin` |
636
+ | `-f, --force` | Skip confirmation prompt |
637
+
638
+ #### Examples
639
+
640
+ ```bash
641
+ atomize template remove my-api-template
642
+ atomize template remove mixin:security-tasks
643
+ atomize template remove my-api-template --force
644
+ ```
645
+
646
+ ---
647
+
648
+ ### template resolve
649
+
650
+ Resolve a composed template (one that uses `extends` or `mixins`) and print the fully merged YAML. Useful for debugging composition and verifying the final template before use.
651
+
652
+ #### Usage
653
+
654
+ ```bash
655
+ atomize template resolve <template> [options]
656
+ ```
657
+
658
+ #### Arguments
659
+
660
+ | Argument | Description |
661
+ |----------|-------------|
662
+ | `<template>` | Template ref (`template:<name>`) or path to a YAML file |
663
+
664
+ #### Options
665
+
666
+ | Option | Description |
667
+ |--------|-------------|
668
+ | `--validate` | Also run schema validation on the resolved template |
669
+ | `-q, --quiet` | Print only the resolved YAML, no decorative output |
670
+
671
+ #### Examples
672
+
673
+ ```bash
674
+ # Resolve and preview a composed template
675
+ atomize template resolve template:my-api
676
+
677
+ # Resolve from a file
678
+ atomize template resolve ./templates/composed.yaml
679
+
680
+ # Resolve, validate, and pipe to a file
681
+ atomize template resolve template:my-api --quiet > resolved.yaml
682
+
683
+ # Resolve and validate in one step
684
+ atomize template resolve template:my-api --validate
685
+ ```
686
+
687
+ ---
688
+
689
+ ### queries
690
+
691
+ Browse Azure DevOps saved queries — discover query paths and IDs without leaving the terminal.
692
+
693
+ #### queries list
694
+
695
+ ```bash
696
+ atomize queries list [options]
697
+ atomize queries ls # alias
698
+ ```
699
+
700
+ | Option | Description |
701
+ |--------|-------------|
702
+ | `--folder <path>` | Scope results to queries under this folder path prefix |
703
+ | `--profile <name>` | Named connection profile to use (uses default if omitted) |
704
+ | `--json` | Print results as JSON to stdout; progress messages go to stderr |
705
+
706
+ **Examples:**
707
+
708
+ ```bash
709
+ atomize queries list
710
+ atomize queries list --folder "Shared Queries/Teams/Backend"
711
+ atomize queries list --json | jq '.[] | select(.isPublic) | .path'
712
+ ```
713
+
714
+ ---
715
+
716
+ ## Configuration
717
+
718
+ ### Connection Profiles
719
+
720
+ Credentials are managed as named profiles. Each platform has its own independent default profile.
721
+
722
+ ```bash
723
+ # Add an Azure DevOps profile
724
+ atomize auth add work-ado
725
+ atomize auth use work-ado # set as default ADO profile
726
+
727
+ # Add a GitHub Models (AI) profile
728
+ atomize auth add my-ai
729
+ atomize auth use my-ai # set as default AI profile
730
+
731
+ # Test both
732
+ atomize auth test work-ado
733
+ atomize auth test my-ai
734
+ ```
735
+
736
+ ### Environment Variables
737
+
738
+ **Authentication:**
739
+
740
+ ```bash
741
+ export ATOMIZE_PAT="your-personal-access-token" # Used by auth add
742
+ ```
743
+
744
+ **Profile selection:**
745
+
746
+ ```bash
747
+ export ATOMIZE_PROFILE="work-ado" # Azure DevOps profile
748
+ export ATOMIZE_AI_PROFILE="my-ai" # GitHub Models (AI) profile
749
+ ```
750
+
751
+ Profile resolution order for ADO commands (`generate`, `fields list`, `queries list`, `validate --profile`):
752
+ 1. `--profile <name>` flag
753
+ 2. `ATOMIZE_PROFILE` environment variable
754
+ 3. Default ADO profile (set via `atomize auth use`)
755
+
756
+ Profile resolution order for AI commands (`template create --ai`):
757
+ 1. `--ai-profile <name>` flag
758
+ 2. `ATOMIZE_AI_PROFILE` environment variable
759
+ 3. Default GitHub Models profile (set via `atomize auth use`)
760
+
761
+ **Logging:**
762
+
763
+ ```bash
764
+ export LOG_LEVEL="info" # debug, info, warn, error
765
+ ```
766
+
767
+ ### .env File
768
+
769
+ No `.env` file is loaded automatically. Use the global `--env-file` flag to load one explicitly:
770
+
771
+ ```bash
772
+ atomize --env-file .env.work generate template:backend-api
773
+ atomize --env-file /etc/atomize/ci.env generate template:backend-api --execute --auto-approve
774
+ ```
775
+
776
+ Shell environment variables always take precedence over values in the file.
777
+
778
+ Example `.env` file:
779
+
780
+ ```bash
781
+ ATOMIZE_PROFILE=work-ado
782
+ ```
783
+
784
+ ---
785
+
786
+ ## Interactive Prompts & Navigation
787
+
788
+ | Key | Action |
789
+ |-----|--------|
790
+ | `↑` / `↓` | Navigate between options in a list |
791
+ | `Enter` | Confirm selection or submit input |
792
+ | `Space` | Toggle selection (in multi-select prompts) |
793
+ | `Ctrl+C` | Cancel the current operation and exit |
794
+
795
+ ---
796
+
797
+ ## Examples
798
+
799
+ ### Complete Workflow: Azure DevOps
800
+
801
+ ```bash
802
+ # 1. Save your Azure DevOps credentials
803
+ atomize auth add work-ado
804
+ atomize auth use work-ado
805
+
806
+ # 2. Verify the connection
807
+ atomize auth test work-ado
808
+
809
+ # 3. Browse available templates
810
+ atomize template list
811
+
812
+ # 4. Start from a catalog template
813
+ atomize template create --from backend-api --save-as my-backend
814
+
815
+ # 5. Validate it
816
+ atomize validate my-backend.yaml
817
+
818
+ # 6. Preview (dry run)
819
+ atomize generate my-backend.yaml
820
+
821
+ # 7. Execute
822
+ atomize generate my-backend.yaml --execute
823
+ ```
824
+
825
+ ### AI-Assisted Template Creation
826
+
827
+ ```bash
828
+ # 1. Add a GitHub Models profile
829
+ atomize auth add my-ai
830
+ atomize auth use my-ai
831
+
832
+ # 2. Describe your template to the AI
833
+ atomize template create --ai
834
+
835
+ # 3. Optionally ground it with real ADO patterns
836
+ atomize template create --ai --ground --profile work-ado
837
+ ```
838
+
839
+ ### Multi-Story Learning
840
+
841
+ ```bash
842
+ atomize template create \
843
+ --from-stories STORY-1,STORY-2,STORY-3,STORY-4,STORY-5 \
844
+ --platform azure-devops
845
+ ```
846
+
847
+ ### Using Composed Templates
848
+
849
+ ```bash
850
+ # Install a shared mixin from a URL
851
+ atomize template install https://example.com/mixins/security-review.yaml
852
+
853
+ # Resolve and inspect a composed template
854
+ atomize template resolve template:my-api
855
+
856
+ # Validate a composed template
857
+ atomize template resolve template:my-api --validate
858
+ ```
859
+
860
+ ### Target Specific Stories
861
+
862
+ ```bash
863
+ # Run only against specific story IDs (bypasses filter)
864
+ atomize generate template:backend-api --story STORY-101 STORY-102 STORY-103
865
+ ```
866
+
867
+ ### CI/CD Integration
868
+
869
+ ```yaml
870
+ # .github/workflows/generate-tasks.yml
871
+ jobs:
872
+ generate:
873
+ runs-on: ubuntu-latest
874
+ steps:
875
+ - uses: actions/checkout@v4
876
+
877
+ - name: Install Atomize
878
+ run: npm install -g @sppg2001/atomize@alpha
879
+
880
+ - name: Save connection profile
881
+ run: |
882
+ echo "${{ secrets.AZURE_DEVOPS_PAT }}" | atomize auth add ci \
883
+ --org-url "${{ secrets.AZURE_DEVOPS_ORG_URL }}" \
884
+ --project "${{ secrets.AZURE_DEVOPS_PROJECT }}" \
885
+ --team "${{ secrets.AZURE_DEVOPS_TEAM }}" \
886
+ --default \
887
+ --pat-stdin \
888
+ --insecure-storage
889
+
890
+ - name: Validate Templates
891
+ run: |
892
+ for template in templates/*.yaml; do
893
+ atomize validate "$template" --strict --quiet
894
+ done
895
+
896
+ - name: Generate Tasks
897
+ run: |
898
+ atomize generate template:backend-api \
899
+ --execute \
900
+ --auto-approve \
901
+ --output task-report.json \
902
+ --continue-on-error
903
+ ```
904
+
905
+ ---
906
+
907
+ ## Troubleshooting
908
+
909
+ ### "Not authenticated" error
910
+
911
+ ```bash
912
+ atomize auth list
913
+ atomize auth add work-ado
914
+ atomize auth test work-ado
915
+ atomize auth use work-ado
916
+ ```
917
+
918
+ ### "Template validation failed"
919
+
920
+ ```bash
921
+ atomize validate template:my-template --strict
922
+ ```
923
+
924
+ ### "No matching stories found"
925
+
926
+ ```bash
927
+ # Test with mock platform first
928
+ atomize generate templates/my-template.yaml --platform mock
929
+ ```
930
+
931
+ ### AI template generation fails
932
+
933
+ ```bash
934
+ # Verify the AI profile is working
935
+ atomize auth test my-ai
936
+
937
+ # Make sure a GitHub Models profile exists
938
+ atomize auth list
939
+
940
+ # Specify it explicitly
941
+ atomize template create --ai --ai-profile my-ai
942
+ ```
943
+
944
+ ### Enable debug logging
945
+
946
+ ```bash
947
+ export LOG_LEVEL="debug"
948
+ atomize generate template:backend-api --verbose
949
+ ```
950
+
951
+ ---
952
+
953
+ ## See Also
954
+
955
+ - [Auth Guide](./Auth-Guide.md) - Credential storage, profile resolution, and CI/CD setup
956
+ - [Template Reference](./Template-Reference.md) - Complete template schema including composition
957
+ - [Validation Modes](./Validation-Modes.md) - Strict vs lenient validation explained
958
+ - [Common Validation Errors](./Common-Validation-Errors.md) - Fix specific validation errors
959
+ - [Platform Guide](./Platform-Guide.md) - Platform setup and configuration
960
+ - [Story Learner](./Story-Learner.md) - Generate templates from existing work items
961
+ - [Template Wizard Guide](./template-wizard-guide.md) - Interactive wizard walkthrough
962
+ - [Examples](../examples/) - Real-world template examples