| Crates.io | azdocli |
| lib.rs | azdocli |
| version | 0.3.3 |
| created_at | 2025-06-02 17:26:17.25437+00 |
| updated_at | 2025-07-01 15:02:44.665554+00 |
| description | CLI tool for interacting with Azure DevOps |
| homepage | https://christianhelle.com/azdocli |
| repository | https://github.com/christianhelle/azdocli |
| max_upload_size | |
| id | 1698165 |
| size | 317,412 |
CLI tool for interacting with Azure DevOps.
The project command allows you to set and view a default project,
eliminating the need to specify --project for every command:
# Set a default project
azdocli project MyDefaultProject
# View the current default project
azdocli project
# All commands will now use the default project if --project is not specified
azdocli repos list # Uses default project
azdocli pipelines list # Uses default project
azdocli repos list --project Other # Overrides default with "Other"
Default Project Features:
--project to override the default for any commandThe repos clone command allows you to clone all repositories from an Azure DevOps project:
# Set a default project first (optional but recommended)
azdocli project MyProject
# Clone all repositories from the default project (with confirmation prompt)
azdocli repos clone
# Or override with a specific project
azdocli repos clone --project MyProject
# Clone to a specific directory
azdocli repos clone --target-dir ./repos
# Skip confirmation prompt (useful for automation)
azdocli repos clone --yes
# Clone repositories in parallel for faster execution
azdocli repos clone --parallel
# Control the number of concurrent clone operations (default: 4, max: 8)
azdocli repos clone --parallel --concurrency 6
# Combine all options for maximum efficiency
azdocli repos clone --target-dir ./repos --yes --parallel --concurrency 8
Clone Features:
--yes flag for CI/CD scenarios--parallel flag to clone multiple repositories simultaneously--concurrency (1-8)The repos show command displays detailed information about a specific repository:
# Show details of a repository by name (using default project)
azdocli repos show --id MyRepository
# Or specify a project explicitly
azdocli repos show --id MyRepository --project MyProject
Show Features:
The repos delete command allows you to delete repositories from an Azure DevOps project:
# Soft delete a repository by name (using default project) - moves to recycle bin
azdocli repos delete --id MyRepository
# Or specify a project explicitly
azdocli repos delete --id MyRepository --project MyProject
# Hard delete - permanently delete after soft delete (requires manual recycle bin cleanup)
azdocli repos delete --id MyRepository --hard
# Skip confirmation prompt (useful for automation)
azdocli repos delete --id MyRepository --yes
# Combine options for automated hard delete
azdocli repos delete --id MyRepository --hard --yes
Delete Features:
--hard flag for permanent deletion (may require manual cleanup)--yes flag for CI/CD scenariosThe repos pr commands allow you to manage pull requests within repositories:
# List all pull requests for a repository (using default project)
azdocli repos pr list --repo MyRepository
# Or specify a project explicitly
azdocli repos pr list --repo MyRepository --project MyProject
# Show details of a specific pull request (using default project)
azdocli repos pr show --repo MyRepository --id 123
# Or specify a project explicitly
azdocli repos pr show --repo MyRepository --id 123 --project MyProject
# Create a new pull request with source and target branches (using default project)
azdocli repos pr create --repo MyRepository --source "feature/my-feature" --target "main" --title "My Feature" --description "Description"
# Create with minimal information - target defaults to 'main'
azdocli repos pr create --repo MyRepository --source "feature/my-feature" --title "My Feature"
# Or specify a project explicitly
azdocli repos pr create --repo MyRepository --source "feature/my-feature" --target "develop" --title "My Feature" --description "Description" --project MyProject
# Source branch is required, target defaults to 'main' if not specified
azdocli repos pr create --repo MyRepository --source "bugfix/fix-login"
# Show commits in a specific pull request (using default project)
azdocli repos pr commits --repo MyRepository --id 123
# Or specify a project explicitly
azdocli repos pr commits --repo MyRepository --id 123 --project MyProject
Pull Request Features:
The pipelines list command allows you to list all pipelines in an Azure DevOps project:
# List all pipelines in the default project
azdocli pipelines list
# Or specify a project explicitly
azdocli pipelines list --project MyProject
List Features:
The pipelines runs command shows all builds (runs) of a specified pipeline:
# Show all runs for a pipeline (using default project)
azdocli pipelines runs --id 42
# Or specify a project explicitly
azdocli pipelines runs --id 42 --project MyProject
Runs Features:
The pipelines show command displays detailed information about a specific pipeline build:
# Show details of a specific pipeline build (using default project)
azdocli pipelines show --id 42 --build-id 123
# Or specify a project explicitly
azdocli pipelines show --id 42 --project MyProject --build-id 123
Show Features:
The pipelines run command starts a new pipeline run:
# Run a pipeline (using default project)
azdocli pipelines run --id 42
# Or specify a project explicitly
azdocli pipelines run --id 42 --project MyProject
Run Features:
The boards work-item commands allow you to manage work items in an Azure DevOps project:
# List work items assigned to me (using default project)
azdocli boards work-item list
# List work items with filters
azdocli boards work-item list --state "Active" --work-item-type "Bug" --limit 20
# Or specify a project explicitly
azdocli boards work-item list --project MyProject
# Show details of a specific work item (using default project)
azdocli boards work-item show --id 123
# Open work item directly in web browser
azdocli boards work-item show --id 123 --web
# Or specify a project explicitly
azdocli boards work-item show --id 123 --project MyProject
# Create a new work item (using default project)
# Supported types: bug, task, user-story, feature, epic
azdocli boards work-item create bug --title "Fix login issue" --description "Users cannot login after password change"
# Update a work item (using default project)
azdocli boards work-item update --id 123 --title "New title" --state "Active" --priority 2
# Delete a work item permanently (using default project)
azdocli boards work-item delete --id 123
# Soft delete a work item by changing state to "Removed"
azdocli boards work-item delete --id 123 --soft-delete
Work Item Features:
--web optionCLI tool for interacting with Azure DevOps
USAGE:
azdocli [SUBCOMMAND]
OPTIONS:
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
boards Manage Azure DevOps boards
help Print this message or the help of the given subcommand(s)
login Login to Azure DevOps with a Personal Access Token (PAT)
logout Logout from Azure DevOps
pipelines Manage Azure DevOps pipelines
repos Manage Azure DevOps repos
Linux and macOS:
curl -sSL https://christianhelle.com/azdocli/install | bash
Windows (PowerShell):
iwr -useb https://christianhelle.com/azdocli/install.ps1 | iex
These one-liner commands will automatically download and install the latest release for your platform.
You can also install azdocli using Cargo:
cargo install azdocli
This will install the azdocli binary, which you can use immediately.
On Linux systems with Snap support, you can install azdocli directly from the Snap Store:
snap install azdocli
This will install the latest stable version and automatically handle updates.
You can also download pre-built binaries from the GitHub Releases page:
windows-x64.zip or windows-arm64.zipmacos-x64.zip or macos-arm64.ziplinux-x64.zip or linux-arm64.zipExtract the binary and add it to your PATH.
Before using the CLI, you need to create a Personal Access Token (PAT) in Azure DevOps:
Navigate to Azure DevOps:
https://dev.azure.com/{yourorganization})Create New Token:
Configure Required Scopes:
Save Your Token:
Security Best Practices:
First, login to Azure DevOps using the PAT you created:
# Login with your Personal Access Token
azdocli login
# You'll be prompted for:
# - Organization name (e.g., "mycompany" from https://dev.azure.com/mycompany)
# - Personal Access Token (the PAT you created above)
# Set a default project (optional but recommended)
azdocli project MyProject
# Repository management
azdocli repos list # List all repositories
azdocli repos show --id MyRepo # Show repository details
azdocli repos clone # Clone all repositories
# Pull request management
azdocli repos pr list --repo MyRepo # List pull requests for a repository
azdocli repos pr show --repo MyRepo --id 123 # Show pull request details
azdocli repos pr create --repo MyRepo --source "feature/my-feature" --title "My Feature" # Create a new pull request
# Pipeline management
azdocli pipelines list # List all pipelines
azdocli pipelines runs --id 42 # Show pipeline runs
azdocli pipelines show --id 42 --build-id 123 # Show build details
For detailed examples and features, see the respective sections below.
# Clone the repository
git clone https://github.com/christianhelle/azdocli.git
cd azdocli
# Build the project
cargo build
# Run tests
cargo test
# Run the CLI
cargo run -- <command>
The project includes integration tests that verify the core repository management functionality against a real Azure DevOps instance.
To run the integration tests, you need to create a test configuration file with your Azure DevOps credentials:
Copy the template file:
cp test_config.json.template test_config.json
Edit test_config.json with your Azure DevOps details:
{
"organization": "your-organization-name",
"pat": "your-personal-access-token",
"project": "your-test-project-name"
}
Make sure you have:
The integration tests are marked with #[ignore] by default to prevent accidental execution without proper configuration.
# Run all tests including integration tests
cargo test -- --ignored
# Run only the repository smoke tests
cargo test test_create_show_clone_delete_repository -- --ignored
# Run the repository listing test
cargo test test_list_repositories -- --ignored
# Run regular unit tests only (currently none)
cargo test
The integration tests cover the following repository operations:
⚠️ Important: The tests create and delete actual repositories in your Azure DevOps project. Make sure to use a test project and not a production environment.
test_config.json file is automatically ignored by Git to prevent accidental credential commitsContributions are welcome! Please read our Contributing Guidelines for details on:
Please ensure your PR descriptions are verbose and follow the guidelines in CONTRIBUTING.md.