# 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.

Latest version **1.0.10** (published 2024-12-02) · 0 weekly downloads

## Install

```sh
npm install ado-pat
pnpm add ado-pat
yarn add ado-pat
bun add ado-pat
```

Provides the command `ado-pat`.

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2024-12-02 |
| First published | 2024-05-09 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 582.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | kenotron |

## Links

- npm: https://www.npmjs.com/package/ado-pat
- Repository: https://github.com/kenotron/devops-buddy
- Homepage: https://github.com/kenotron/devops-buddy#readme
- Issues: https://github.com/kenotron/devops-buddy/issues
- npm.io page: https://npm.io/package/ado-pat

## Dependencies (3)

- [open](https://npm.io/package/open.md) ^10.1.0
- [@azure/msal-node](https://npm.io/package/@azure/msal-node.md) ^2.7.0
- [@napi-rs/keyring](https://npm.io/package/@napi-rs/keyring.md) ^1.1.6

## Recent versions

- 1.0.10 (latest) — 2024-12-02
- 1.0.9 — 2024-11-10
- 1.0.8 — 2024-05-09
- 1.0.3 — 2024-05-09

## 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 <tenant id>        Azure AD tenant ID
  -d, --display-name <display name>  Display name for the PAT
  -o, --organization <org>           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,
});
```

---
_Source: https://npm.io/package/ado-pat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
