base library for oclif CLIs
Last release 7 days ago
19 Aug 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
478 releases · first in 2020
Release timeline
478 releases since 2020Releases
- 4.2.421 Jan 2025
Release notes2 sources agree
Open source → - 4.2.314 Jan 2025
Release notes2 sources agree
Open source → - 4.2.27 Jan 2025
- 4.2.16 Jan 2025
- 4.2.020 Dec 2024
- 4.1.119 Dec 2024
Additional notes
Open source →Bug Fixes
- export action from ux (c7fad54)
4.1.0 (2024-12-17)
Features
- add atLeastOne flag property (d4746f3)
- 4.1.017 Dec 2024
- 4.0.3713 Dec 2024
- 4.0.368 Dec 2024
Release notes2 sources agree
Open source →Bug Fixes
- deps: bump lilconfig from 3.1.2 to 3.1.3 (7bdf5f3)
- 4.0.358 Dec 2024
- 4.0.342 Dec 2024
- 4.0.3319 Nov 2024
Release notes2 sources agree
Open source →Bug Fixes
- deps: bump cross-spawn from 7.0.3 to 7.0.6 (dfd138e)
- 4.0.3212 Nov 2024
- 4.0.3128 Oct 2024
Release notes2 sources agree
Open source → - 4.0.3022 Oct 2024
- 4.0.2915 Oct 2024
Release notes2 sources agree
Open source → - 4.0.2811 Oct 2024
Release notes2 sources agree
Open source →Bug Fixes
- remove circular references when colorizing json (de9ed4e)
- 4.0.273 Oct 2024
Release notes2 sources agree
Open source →Bug Fixes
- add respectNoCacheDefault to help options (7320fff)
- 4.0.262 Oct 2024
- 4.0.251 Oct 2024
- 4.0.241 Oct 2024
Release notes2 sources agree
Open source → - 4.0.2323 Sept 2024
Release notes2 sources agree
Open source → - 4.0.2213 Sept 2024
Release notes2 sources agree
Open source →Bug Fixes
- deps: bump path-to-regexp from 6.2.1 to 6.3.0 (d051b64)
- 4.0.217 Sept 2024
- 4.0.204 Sept 2024
- 4.0.1924 Aug 2024
Release notes2 sources agree
Open source →Bug Fixes
- deps: bump micromatch from 4.0.7 to 4.0.8 (eb2aa14)
- 4.0.1821 Aug 2024
Release notes2 sources agree
Open source → - 4.0.1728 Jul 2024
- 4.0.1627 Jul 2024
Release notes2 sources agree
Open source →Bug Fixes
- deps: bump requirejs from 2.3.6 to 2.3.7 (216d8e7)
- 4.0.1526 Jul 2024
- 4.0.1423 Jul 2024
- 4.0.1321 Jul 2024
- 4.0.1213 Jul 2024
- 4.0.1110 Jul 2024
- 4.0.1010 Jul 2024
Release notes2 sources agree
Open source →Bug Fixes
- use colorize to ensure proper TTY detection (8a5d71f)
- 4.0.99 Jul 2024
Release notes2 sources agree
Open source → - 4.0.81 Jul 2024
Release notes2 sources agree
Open source → - 4.0.725 Jun 2024
Release notes2 sources agree
Open source → - 4.0.612 Jun 2024
Release notes2 sources agree
Open source → - 4.0.512 Jun 2024
- 4.0.411 Jun 2024
- 4.0.36 Jun 2024
- 4.0.25 Jun 2024
- 4.0.14 Jun 2024
- 4.0.04 Jun 2024
Release notes
Open source →Slimmer
uxmoduleAs described here, we're removing most of the methods in the
uxmodule. We're simply unable to adequately support the feature set thatuxoffers and think that most people would benefit from using dedicated libraries that are better supported.We are, however, keeping some of the functionality. The new
uxmodule will contain the following:Unchanged
colorizeerrorexitaction- will be unchanged from previous version except that the spinner color will be configurable using themes.warn
Renamed
stdout- rename ofux.logstderr- rename ofux.logToStderr
New
colorizeJson- Apply color theme to arbitrary JSON.
Removed
annotationanykeyconfirmdebugdone(useux.action.stop()instead)flush(still available via@oclif/core/flush)info(useux.stdoutinstead)progresspromptstyledHeaderstyledJSONstyledObjecttabletracetreeurlwait
What you'll need to do
You will need to replace everything that
uxwas doing with dedicated libraries. Here are a few suggestions:- For prompts: inquirer
- For progress bars: cli-progress
- For hyperlinks: hyperlink
- For tables: tty-table, cliui
- For trees: object-treeify
- For notifications: node-notifier
- For links: terminal-link
- For rendering react components: ink
Theme-able spinner and JSON output
The color of the spinner can now be customized using the
spinnerkey in your theme.The JSON output can also now be customized with these keys:
brace bracket colon comma key string number boolean nullCustomizable Logger
In the current major version, we exclusively use debug for debug logs. In the next major, we're going to export a
Loggerinterface that will allow you to provide a custom logger for@oclif/coreto use. This will be useful if you want all the@oclif/coredebug logs to go through your own logger.The default logger will continue to use
debugunder the hood. So if you choose to use the default, you can continue to use theDEBUGenvironment variable to access the debug logs in the console. The only breaking change will be that the namespace for all the logs with be prefixed with a root namespace,oclif.So if you're used to using
DEBUG=config:* my-cli do stuff, you'll need to start doing this instead:DEBUG=oclif:config:* my-cli do stuffInterface
export type Logger = { debug: (formatter: unknown, ...args: unknown[]) => void error: (formatter: unknown, ...args: unknown[]) => void info: (formatter: unknown, ...args: unknown[]) => void trace: (formatter: unknown, ...args: unknown[]) => void warn: (formatter: unknown, ...args: unknown[]) => void child: (namespace: string) => Logger namespace: string }Usage
// oclif-logger.ts import { format } from 'node:util'; import { Interfaces } from '@oclif/core'; import { Logger } from './my-cli-logger'; export const customLogger = (namespace: string): Interfaces.Logger => { const myLogger = new Logger(namespace); return { child: (ns: string, delimiter?: string) => customLogger(`${namespace}${delimiter ?? ':'}${ns}`), debug: (formatter: unknown, ...args: unknown[]) => myLogger.debug(format(formatter, ...args)), error: (formatter: unknown, ...args: unknown[]) => myLogger.error(format(formatter, ...args)), info: (formatter: unknown, ...args: unknown[]) => myLogger.info(format(formatter, ...args)), trace: (formatter: unknown, ...args: unknown[]) => myLogger.trace(format(formatter, ...args)), warn: (formatter: unknown, ...args: unknown[]) => myLogger.warn(format(formatter, ...args)), namespace, }; }; export const logger = customLogger('sf');// bin/run.js #!/usr/bin/env node async function main() { const {execute} = await import('@oclif/core'); const { logger } = await import('../dist/oclif-logger.js'); await oclif.execute({ dir: import.meta.url, loadOptions: { root: import.meta.dirname, logger, }, }); } await main();You can also provide the logger to
Config, in the event that you instantiateConfigbefore callingrunorexecuteimport {Config, run} from '@oclif/core' const config = await config.load({ logger, }); await run(process.argv.slice(2), config)Support for
rcfilesCurrently the configuration for oclif must live inside the
oclifsection of your CLI or plugin's package.json. This can be difficult if you have a large amount of configuration, you want to dynamically change the configuration, or want to ensure that your configuration is correctly typed.To solve this, we can now use lilconfig to read in a variety of rc files.
Despite being able to use an rc file,
@oclif/corewill still be dependent on your package.json to get thename,version, anddependencies. We could ask that you put those value in your rc file, but duplicating that information across two files feels like something people would rather not do.If you choose to use an rc file, one thing you must consider is that there will be a slight performance hit due to needing to search for the rc file in addition to the package.json.
This is the list of supported files. Please feel free to create a PR to add support for other files
.oclifrc .oclifrc.json .oclifrc.js .oclifrc.mjs .oclifrc.cjs oclif.config.js oclif.config.mjs oclif.config.cjsTop level exports
We'll have top level exports for:
argscommandconfigerrorsexecuteflagsflushhandlehelphooksinterfacesloggerperformancerunsettingsutil/idsux
The current way of accessing these looks like this:
import {run, flush, handle} from '@oclif/core'With top level exports, you could access those like this:
import run from '@oclif/core/run' import flush from '@oclif/core/flush' import handle from '@oclif/core/handle'The benefit of this is that you'll be able to import those utilities without also importing everything else that
@oclif/coreexports.As a result of this change, deep imports (e.g.
import {Command} from '@oclif/core/lib/command.js) will no longer work.Bundling support for custom help classes
In case you missed it, we introduced new command discovery strategies that make bundling possible. In order to do that, the location of commands and hooks needed to be configured using a
target(i.e. a file or directory containing the commands or hooks) and anidentifier(i.e. the name of the export inside thetarget).This change originally only worked for commands and hooks but now also works for custom help classes so that those can be bundled as well.
exactOptionalPropertyTypes
We enabled
exactOptionalPropertyTypes(fixes #960) for improved type safetyInterfaces
Interfaces.PJSON
Interfaces.PJSONhas now been simplified to a single type instead ofInterfaces.PJSON.CLIandInterfaces.PJSON.PluginInterfaces.OclifConfiguration
There's a new
Interfaces.OclifConfigurationthat represents everything that could be added to theoclifsection of your package.json (or rc file). This is particularly helpful if you want to use a.oclifrc.tsand ensure that your oclif configuration matches the expected type.Runtime auto-transpilation of linked ESM plugins with
tsxIf your ESM plugin has a devDependency on
tsx, then you oclif can now auto-transpile the code at runtime - 4.0.0-beta.174 Jun 2024pre-release
- 4.0.0-beta.164 Jun 2024pre-release
Release notes
Open source →4.0.0-beta.15 (2024-06-03)
Features
- support tsx for runtime transpilation (a194aa6)
4.0.0-beta.14 (2024-06-03)
Bug Fixes
- check supports-color in colorize (ac32408)
4.0.0-beta.13 (2024-05-24)
Bug Fixes
- allow empty ux.stdout (da1e4cb)
4.0.0-beta.12 (2024-05-24)
Bug Fixes
- update hook type (29664ba)
4.0.0-beta.11 (2024-05-23)
Bug Fixes
- improve types and ProdOnlyCache (e9c7ff7)
4.0.0-beta.10 (2024-05-23)
Bug Fixes
4.0.0-beta.9 (2024-05-23)
Bug Fixes
- clarify types (64b7669)
Features
- remove baseFlags (d062173)
4.0.0-beta.8 (2024-05-20)
Features
4.0.0-beta.7 (2024-05-15)
Bug Fixes
- revert ignoreDuplicates in warn (0e99723)
4.0.0-beta.6 (2024-05-07)
4.0.0-beta.5 (2024-05-06)
Features
4.0.0-beta.4 (2024-04-25)
4.0.0-beta.3 (2024-04-24)
Bug Fixes
- cache child loggers (2a9164d)
Features
4.0.0-beta.2 (2024-04-22)
Features
- 4.0.0-beta.153 Jun 2024pre-release
- 4.0.0-beta.143 Jun 2024pre-release
- 4.0.0-beta.1324 May 2024pre-release
- 4.0.0-beta.1224 May 2024pre-release
- 4.0.0-beta.1123 May 2024pre-release
- 4.0.0-beta.1023 May 2024pre-release
- 4.0.0-beta.923 May 2024pre-release
- 4.0.0-beta.820 May 2024pre-release
- 4.0.0-beta.715 May 2024pre-release
- 4.0.0-beta.67 May 2024pre-release
Release notes
Open source →4.0.0-beta.5 (2024-05-06)
Features
4.0.0-beta.4 (2024-04-25)
4.0.0-beta.3 (2024-04-24)
Bug Fixes
- cache child loggers (2a9164d)
Features
4.0.0-beta.2 (2024-04-22)
Features
- 4.0.0-beta.56 May 2024pre-release
- 4.0.0-beta.425 Apr 2024pre-release
Nothing published for this version
- 4.0.0-beta.324 Apr 2024pre-release