# @oclif/parser

> arg and flag parser for oclif

Latest version **3.8.17** (published 2023-08-19) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @oclif/parser
pnpm add @oclif/parser
yarn add @oclif/parser
bun add @oclif/parser
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.8.17 |
| Published | 2023-08-19 |
| First published | 2018-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 4 |
| Unpacked size | 35.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Salesforce |
| Maintainers | rodesp, mdonnalley, rasphilco, dickeyxxx, amphro, chadian, salesforce-releases |
| Keywords | oclif |

## Links

- npm: https://www.npmjs.com/package/@oclif/parser
- Repository: https://github.com/oclif/parser
- Issues: https://github.com/oclif/parser/issues
- npm.io page: https://npm.io/package/@oclif/parser

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [tslib](https://npm.io/package/tslib.md) ^2.6.2
- [@oclif/errors](https://npm.io/package/@oclif/errors.md) ^1.3.6
- [@oclif/linewrap](https://npm.io/package/@oclif/linewrap.md) ^1.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 3.8.17 (latest) — 2023-08-19
- 3.8.16 — 2023-07-29
- 3.8.15 — 2023-07-19
- 3.8.14 — 2023-07-11
- 3.8.13 — 2023-07-01
- 3.8.12 — 2023-06-03
- 3.8.11 — 2023-05-20
- 3.8.10 — 2023-01-28
- 3.8.9 — 2022-11-05
- 3.8.8 — 2022-10-01
- 3.8.7 — 2022-02-25
- 3.8.6 — 2021-11-18
- 3.8.5 — 2020-05-15
- 3.8.4 — 2019-08-02
- 3.8.3 — 2019-07-12
- … 29 more at https://npm.io/package/@oclif/parser/versions

## README

@oclif/parser
=============

**This library has been replaced by [@oclif/core](https://github.com/oclif/core) and is now in maintenance mode. We will only consider PRs that address security concerns.**

arg and flag parser for oclif

[![Version](https://img.shields.io/npm/v/@oclif/parser.svg)](https://npmjs.org/package/@oclif/parser)
[![CircleCI](https://circleci.com/gh/oclif/parser/tree/main.svg?style=svg)](https://circleci.com/gh/oclif/parser/tree/main)
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/oclif/parser?branch=main&svg=true)](https://ci.appveyor.com/project/heroku/parser/branch/main)
[![Known Vulnerabilities](https://snyk.io/test/npm/@oclif/parser/badge.svg)](https://snyk.io/test/npm/@oclif/parser)
[![Downloads/week](https://img.shields.io/npm/dw/@oclif/parser.svg)](https://npmjs.org/package/@oclif/parser)
[![License](https://img.shields.io/npm/l/@oclif/parser.svg)](https://github.com/oclif/parser/blob/main/package.json)

CLI flag parser.

Usage:

```js
const CLI = require('cli-flags')

const {flags, args} = CLI.parse({
  flags: {
    'output-file': CLI.flags.string({char: 'o'}),
    force: CLI.flags.boolean({char: 'f'})
  },
  args: [
    {name: 'input', required: true}
  ]
})

if (flags.force) {
  console.log('--force was set')
}

if (flags['output-file']) {
  console.log(`output file is: ${flags['output-file']}`)
}

console.log(`input arg: ${args.input}`)

// $ node example.js -f myinput --output-file=myexample.txt
// --force was set
// output file is: myexample.txt
// input arg: myinput
```

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