CLI tool to trigger Azure DevOps pipelines
Project description
Azure DevOps Pipeline CLI
A command-line tool to trigger and manage Azure DevOps pipelines with ease.
Features
- Trigger Pipelines - Start builds with a single command
- Watch Progress - Real-time build status with progress bar
- Build Management - View status, logs, cancel, compare builds
- Favorites - Save and reuse common build configurations
- Shell Completion - Tab-complete pipeline aliases and branches
- Fuzzy Matching - Suggests corrections for typos
Installation
Homebrew (macOS/Linux)
brew tap SAGARSURI/tap
brew install adop-cli
pip
pip install adop-cli
From Source
git clone https://github.com/SAGARSURI/adop.git
cd adop
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Setup
1. Configure Azure DevOps Connection
ado-pipeline config init
You'll be prompted to enter:
- Organization - Your Azure DevOps organization name
- Project - Your Azure DevOps project name
- PAT - Personal Access Token
Required PAT Permissions:
- Build: Read & execute
- Code: Read
- User Profile: Read (optional, for
--mineflag)
2. Add Pipelines
After configuring, add pipelines you want to manage:
# Import pipelines from Azure DevOps (interactive)
ado-pipeline pipeline import
# Or add manually
ado-pipeline pipeline add my-build "My Pipeline Name" --description "Build description"
# Add with parameters
ado-pipeline pipeline add android-build "Android_Build" \
--param "outputFormat:choice:apk:apk,aab" \
--param "deploy:boolean:false" \
--param "releaseNotes:string:"
3. Enable Shell Completion (Optional)
# Bash - add to ~/.bashrc
eval "$(_ADO_PIPELINE_COMPLETE=bash_source ado-pipeline)"
# Zsh - add to ~/.zshrc
eval "$(_ADO_PIPELINE_COMPLETE=zsh_source ado-pipeline)"
This enables tab-completion for pipeline aliases and git branches.
Quick Start
# List available pipelines
ado-pipeline list
# See what would be triggered (dry-run)
ado-pipeline plan my-build
# Trigger a build
ado-pipeline apply my-build
# Trigger and watch progress
ado-pipeline apply my-build -y -w
# Check build status
ado-pipeline status
# Open build in browser
ado-pipeline open <BUILD_ID>
Commands
Trigger Pipelines
Plan Mode (Dry Run)
Preview what will be triggered without making API calls:
ado-pipeline plan my-build
ado-pipeline plan my-build --branch feature/my-feature
ado-pipeline plan my-build --branch main --deploy
Apply Mode (Trigger)
Actually trigger the pipeline:
# Basic trigger (prompts for confirmation)
ado-pipeline apply my-build
# Skip confirmation
ado-pipeline apply my-build -y
# Skip confirmation and watch progress
ado-pipeline apply my-build -y -w
# With options
ado-pipeline apply my-build --branch main --deploy --output-format aab
Build Management
View Build Status
# Show recent builds
ado-pipeline status
# Show more builds
ado-pipeline status -n 20
# Filter by pipeline
ado-pipeline status -p my-build
# Show only your builds
ado-pipeline status --mine
View Build Logs
# Show logs for a build
ado-pipeline logs <BUILD_ID>
# Stream logs in real-time
ado-pipeline logs <BUILD_ID> -f
Cancel a Build
ado-pipeline cancel <BUILD_ID>
ado-pipeline cancel <BUILD_ID> -y # Skip confirmation
Open Build in Browser
ado-pipeline open <BUILD_ID>
Compare Two Builds
ado-pipeline diff <BUILD_ID_1> <BUILD_ID_2>
Shows side-by-side comparison of pipeline, branch, result, duration, and parameters.
Pipeline Management
List Configured Pipelines
ado-pipeline pipeline list
Add a Pipeline
# Basic
ado-pipeline pipeline add <alias> "<Azure DevOps Pipeline Name>"
# With description
ado-pipeline pipeline add my-build "My_Build_Pipeline" --description "Main build"
# With parameters
ado-pipeline pipeline add my-build "My_Build_Pipeline" \
--param "outputFormat:choice:apk:apk,aab" \
--param "deploy:boolean:false" \
--param "environment:string:dev"
Parameter format: name:type:default[:choices]
- Types:
string,boolean,choice - For choice type, add comma-separated options after default
Import from Azure DevOps
# Interactive import from remote
ado-pipeline pipeline import
This fetches available pipelines from Azure DevOps and lets you add them interactively.
Remove a Pipeline
ado-pipeline pipeline remove <alias>
Favorites
Save frequently used build configurations for quick access.
Save a Favorite
# Save with deploy enabled
ado-pipeline fav add quick-build my-build --deploy
# Save with specific branch
ado-pipeline fav add release-build my-prod --branch main --deploy
List Favorites
ado-pipeline fav list
Run a Favorite
ado-pipeline fav run quick-build
ado-pipeline fav run quick-build -y -w # Skip confirmation + watch
Remove a Favorite
ado-pipeline fav remove quick-build
Configuration
# Initialize or update configuration
ado-pipeline config init
# Show current configuration
ado-pipeline config show
Parameters
Parameters are defined per-pipeline when you add them. Common parameter types:
| Type | Description | Example |
|---|---|---|
string |
Free text input | --release-notes "Bug fixes" |
boolean |
True/false flag | --deploy / --no-deploy |
choice |
Select from options | --output-format apk |
Common Options
| Option | Description |
|---|---|
--branch, -b |
Branch to build (default: current branch) |
--yes, -y |
Skip confirmation prompt |
--watch, -w |
Watch build progress until completion |
Configuration Files
| File | Purpose |
|---|---|
~/.azure-pipeline-cli/config.json |
PAT and organization settings |
~/.azure-pipeline-cli/pipelines.json |
Pipeline definitions |
~/.azure-pipeline-cli/favorites.json |
Saved favorite configurations |
All files have 0600 permissions (owner read/write only) since they may contain sensitive data.
Troubleshooting
"Pipeline not found"
The CLI suggests similar names if you make a typo:
Error: Pipeline 'my-bild' not found. Did you mean: my-build?
Run ado-pipeline pipeline list to see all available aliases.
"No pipelines configured"
Add pipelines first:
ado-pipeline pipeline import # Import from Azure DevOps
# or
ado-pipeline pipeline add <alias> "<pipeline-name>"
"PAT not configured"
Run ado-pipeline config init and enter your credentials.
"Branch not found"
The branch must exist on the remote. Push it first:
git push -u origin <branch>
"Could not determine current user"
The --mine flag requires User Profile read permission on your PAT. The command will continue without filtering if this fails.
Shell completion not working
Make sure you've added the eval command to your shell config and restarted your terminal.
Build stuck or need to cancel
ado-pipeline cancel <BUILD_ID> -y
Development
Setup
git clone https://github.com/SAGARSURI/adop.git
cd adop
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Running Tests
pytest tests/ -v
Project Structure
src/ado_pipeline/
├── __init__.py # Version
├── api.py # Azure DevOps API client
├── cli.py # CLI commands (click)
├── config.py # Configuration management
├── favorites.py # Favorites system
├── pipelines.py # Pipeline definitions
└── plan.py # Execution plan generation
CI/CD
Automated Testing
Tests run automatically on:
- Push to
main - Pull requests to
main
Tests run against Python 3.10, 3.11, and 3.12.
Releasing
Releases are automated via GitHub Actions:
- Update version in
pyproject.toml - Commit and tag:
git add pyproject.toml git commit -m "chore: bump version to X.Y.Z" git tag vX.Y.Z git push origin main --tags
- The release workflow automatically:
- Runs tests
- Publishes to PyPI
- Updates Homebrew tap
Contributing
See CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adop_cli-0.1.2.tar.gz.
File metadata
- Download URL: adop_cli-0.1.2.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d702fb22539ceca84e1e8052e0833f59391ddf31f7484ce53689370988c63889
|
|
| MD5 |
c14c2db090b239caa1d20e99cb8df0f9
|
|
| BLAKE2b-256 |
e0d59d1cd382f64a314c3da479c30370011568d46a0a644a7478dee01a623eba
|
Provenance
The following attestation bundles were made for adop_cli-0.1.2.tar.gz:
Publisher:
release.yml on SAGARSURI/adop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adop_cli-0.1.2.tar.gz -
Subject digest:
d702fb22539ceca84e1e8052e0833f59391ddf31f7484ce53689370988c63889 - Sigstore transparency entry: 849703182
- Sigstore integration time:
-
Permalink:
SAGARSURI/adop@86656700d50ad0cef0b18ec84a175abf7920130a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/SAGARSURI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@86656700d50ad0cef0b18ec84a175abf7920130a -
Trigger Event:
push
-
Statement type:
File details
Details for the file adop_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: adop_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3538cd4af7fc3f076fa4f721868b0f0924f881eccad84a9a3bd5c9fc8f2e89a
|
|
| MD5 |
22d80a876c7d04c6b38eb64e7b529caf
|
|
| BLAKE2b-256 |
de66d9c7d207e0dd3af08700f1d0a346b1d1e67e2605a2cee3774cbe4dc4b172
|
Provenance
The following attestation bundles were made for adop_cli-0.1.2-py3-none-any.whl:
Publisher:
release.yml on SAGARSURI/adop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adop_cli-0.1.2-py3-none-any.whl -
Subject digest:
b3538cd4af7fc3f076fa4f721868b0f0924f881eccad84a9a3bd5c9fc8f2e89a - Sigstore transparency entry: 849703185
- Sigstore integration time:
-
Permalink:
SAGARSURI/adop@86656700d50ad0cef0b18ec84a175abf7920130a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/SAGARSURI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@86656700d50ad0cef0b18ec84a175abf7920130a -
Trigger Event:
push
-
Statement type: