Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kenotron/ado-pat

A CLI and library to retrieve ADO PAT
https://github.com/kenotron/ado-pat

Last synced: 7 days ago
JSON representation

A CLI and library to retrieve ADO PAT

Awesome Lists containing this project

README

        

# ado-pat

`ado-pat` is a CLI and a library to help tool authors get a functioning user PAT for Azure DevOps. The package wraps the `msal-node` and `msal-node-extension` packages to do its work of retrieving an Entra ID access token with cached persistence.

## Installation

Globally

```
$ npm install --global ado-pat
```

Locally

```
$ npm install ado-pat
```

## Usage as CLI

Get help from the tool

```
$ ado-pat --help

Usage: ado-pat [options]

Options:
-t, --tenant-id Azure AD tenant ID
-d, --display-name Display name for the PAT
-o, --organization Azure DevOps organization name
-h, --help display help for command
```

## Usage as Node.js API

(for now, this is a CommonJS package)

```js
const { getPAT, acquireEntraIdToken } = require("ado-pat");
const token = await acquireEntraIdToken();
const pat = await getPAT({
organization: "your org",
token: token.accessToken,
});
```