Gathering detailed insights and metrics for @oclif/core
Gathering detailed insights and metrics for @oclif/core
Gathering detailed insights and metrics for @oclif/core
Gathering detailed insights and metrics for @oclif/core
Node.js Open CLI Framework. Built by Salesforce.
npm install @oclif/core
Typescript
Module System
Min. Node Version
Node Version
NPM Version
88.8
Supply Chain
98.5
Quality
94.6
Maintenance
100
Vulnerability
99.6
License
TypeScript (99.14%)
JavaScript (0.86%)
Total Downloads
277,717,565
Last Day
151,078
Last Week
3,014,151
Last Month
12,934,571
Last Year
134,396,174
MIT License
245 Stars
1,648 Commits
77 Forks
6 Watchers
8 Branches
62 Contributors
Updated on Jun 30, 2025
Latest Version
4.4.0
Package Id
@oclif/core@4.4.0
Unpacked Size
397.92 kB
Size
99.35 kB
File Count
161
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jun 17, 2025
Cumulative downloads
Total Downloads
Last Day
1.9%
151,078
Compared to previous day
Last Week
-5.4%
3,014,151
Compared to previous week
Last Month
5.1%
12,934,571
Compared to previous month
Last Year
40.4%
134,396,174
Compared to previous year
18
39
This is a framework for building CLIs in Node.js. This framework was built out of the Salesforce CLI but generalized to build any custom CLI. It's designed both for single-file CLIs with a few flag options (like cat
or ls
), or for very complex CLIs that have subcommands (like git
or heroku
).
See the docs for more information.
The Getting Started tutorial is a step-by-step guide to introduce you to oclif. If you have not developed anything in a command line before, this tutorial is a great place to get started.
--help
to the CLI to get help such as flag options and argument information. This information is also automatically placed in the README whenever the npm package of the CLI is published. See the hello-world CLI examplets-node
to run the plugins enabling you to use TypeScript with minimal-to-no boilerplate needed for any oclif CLI.$ heroku info --app=<tab><tab> # will complete with all the Heroku apps a user has in their account
Currently, Node 18+ is supported. We support the LTS versions of Node. You can add the node package to your CLI to ensure users are running a specific version of Node.
See the v3 migration guide for an overview of breaking changes that occurred between v2 and v3.
See the v2 migration guide for an overview of breaking changes that occurred between v1 and v2.
Migrating from @oclif/config
and @oclif/command
? See the v1 migration guide.
The official oclif website, oclif.io, contains all the documentation you need for developing a CLI with oclif.
If there's anything you'd like to see in the documentation, please submit an issue on the oclif.github.io repo.
We strongly encourage you generate an oclif CLI using the oclif cli. The generator will generate an npm package with @oclif/core
as a dependency.
You can, however, use @oclif/core
in a standalone script like this:
1#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning 2 3import * as fs from 'fs' 4import {Command, Flags, flush, handle} from '@oclif/core' 5 6class LS extends Command { 7 static description = 'List the files in a directory.' 8 static flags = { 9 version: Flags.version(), 10 help: Flags.help(), 11 dir: Flags.string({ 12 char: 'd', 13 default: process.cwd(), 14 }), 15 } 16 17 async run() { 18 const {flags} = await this.parse(LS) 19 const files = fs.readdirSync(flags.dir) 20 for (const f of files) { 21 this.log(f) 22 } 23 } 24} 25 26LS.run(process.argv.slice(2), { 27 root: import.meta.dirname, 28 // Tell oclif what the contents of the package.json are. 29 // You could also set these in your package.json but specifying 30 // them here is useful if you're attempting to bundle your CLI 31 // without a package.json 32 pjson: { 33 name: 'ls', 34 version: '0.0.1', 35 oclif: { 36 // Tell oclif that this is a single command CLI 37 // See: https://oclif.io/docs/command_discovery_strategies 38 commands: { 39 strategy: 'single', 40 target: 'index.js', 41 }, 42 }, 43 }, 44}).then( 45 async () => { 46 await flush() 47 }, 48 async (err) => { 49 await handle(err) 50 }, 51)
Then run it like this:
1$ ts-node myscript.ts 2...files in current dir...
You can also use oclif's Parser
separately:
1// index.js 2import {Args, Flags, Parser} from '@oclif/core' 3 4const {args, flags} = await Parser.parse(process.argv.slice(2), { 5 args: { 6 name: Args.string({required: true}), 7 }, 8 flags: { 9 from: Flags.string({char: 'f', default: 'oclif'}), 10 }, 11}) 12 13console.log(`hello ${args.name} from ${flags.from}`)
$ node index.js world --from oclif
hello world from oclif
NOTE If you're using the Parser
class, you will not be able to use the builtin help
and version
flags since those require the context of an oclif project.
🚀 Contributing
See the contributing guide.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/8 approved changesets -- score normalized to 2
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More