Documentation
Use profiles in scripts and CI
Development docs · main. Your installed version may differ.
These steps apply to the CLI. VS Code asks you to choose a profile in its own interface; see Set up Connection Profiles.
Profile resolution order
Section titled “Profile resolution order”When a CLI command needs Azure DevOps credentials, Atomize chooses a profile in this order:
--profile <name>flag on the commandATOMIZE_PROFILEenvironment variable- Default Azure DevOps profile (set via
atomize auth use)
If none of these names a profile, the command stops and tells you to run atomize auth add. ATOMIZE_PAT is not a fallback for connected commands: it only supplies the token when atomize auth add creates a profile.
This order applies to CLI commands that read Azure DevOps, such as a connected generate, Online Validation with validate, fields list, queries list, and grounded AI drafts and improvements. The Copilot Session itself does not use profile resolution: see AI Drafting: Copilot Session. VS Code asks you to choose a profile for each connected command.
Managing multiple profiles
Section titled “Managing multiple profiles”You can have as many profiles as you need: one per organization, project, or environment.
# Two ADO profiles: personal and workatomize auth add personal --org-url https://dev.azure.com/personal-org ...atomize auth add work --org-url https://dev.azure.com/work-org ...
# Switch between them per-runatomize generate template:backend-api --profile personalatomize generate template:backend-api --profile work
# Or change the defaultatomize auth use workSwitching the default
Section titled “Switching the default”atomize auth use # pick interactivelyatomize auth use work-ado # set by nameAzure DevOps is currently the only profile type with a default to set.
Removing a profile
Section titled “Removing a profile”atomize auth remove old-profileatomize auth rm old-profile # aliasIf the removed profile was the default for its platform, Atomize prompts you to assign a new default. In scripts, pass --confirm to skip the confirmation and --new-default <name> to choose the replacement.
CI/CD setup
Section titled “CI/CD setup”For automated environments, inject the PAT via stdin and create a short-lived profile in the job workspace.
- name: Generate Tasks env: AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} run: | echo "$AZURE_DEVOPS_PAT" | atomize auth add ci \ --org-url "${{ secrets.AZURE_DEVOPS_ORG_URL }}" \ --project "${{ secrets.AZURE_DEVOPS_PROJECT }}" \ --team "${{ secrets.AZURE_DEVOPS_TEAM }}" \ --default \ --pat-stdin \ --insecure-storage
atomize generate template:backend-api \ --execute \ --auto-approve \ --continue-on-errorWhy --pat-stdin? Passing the token as a flag (--pat abc123) risks it appearing in process listings (ps aux) or shell history. Reading from stdin keeps it out of both.
If your runner has a working OS keychain, you can omit --insecure-storage. On headless runners, the flag explicitly opts into Atomize's local encrypted file fallback for that job.
You can also provide the PAT through ATOMIZE_PAT while still creating a profile:
- name: Generate Tasks env: ATOMIZE_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} run: | atomize auth add ci \ --org-url "${{ secrets.AZURE_DEVOPS_ORG_URL }}" \ --project "${{ secrets.AZURE_DEVOPS_PROJECT }}" \ --team "${{ secrets.AZURE_DEVOPS_TEAM }}" \ --default \ --insecure-storage
atomize generate template:backend-api --execute --auto-approveNext steps
Section titled “Next steps”Rotate expired tokens with the rotation steps. For machine-readable output, exit codes, and failure handling, see Automate the CLI; every command is in the CLI reference.