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