
Pattrick is a command line tool for managing Personal Access Tokens (PAT) in Azure DevOps.
It allows you to:
- 🐣 create
- 📖 list
- 🔎 show
- ⚰️ delete
PATs without having to go to the web interface.
Installation
On MacOs, you can install Pattrick with Homebrew:
On Linux, you can install Pattrick by executing the following commands:
|
Usage
Pattrick looks for Azure CLI credentials to fetch an access token for authentication with Azure DevOps. You can get one locally by logging in to Azure with:
If pattrick cannot find a valid access token, it will try to log you in automatically (by using the az login command under the hood). It will also try to automatically figure out the DevOps organization to connect to. If you have access to multiple DevOps organization, you can specify the organization you want to manage PAT tokens for via the environment variable DEVOPS_ORGANIZATION.
You can then start using pattrick to manage your PAT tokens:
By default, pattrick writes newly created token to stdout. However, you can also tell pattrick to write the token to your .netrc file (useful for e.g. installing Python packages from Azure DevOps Artifacts), or to a local .env file:
)
To get an overview of the other commands and options available, run:
Usage as standalone library
You can also use Pattrick as a standalone library. This is useful if you want to manage PATS programmatically in your own codebase.
use ;
use get_ad_token_for_devops;
let pat_manager = new;
let pat_tokens = pat_manager.list_pat_tokens.await?;
For more information, check out the pattrick documentation at docs.rs