@oclif/config

The legacy base config object and standard component interfaces for the oclif CLI framework.

Library
npm
v1.18.17
24stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
35/100Needs Attention
Development Activity0
Maintenance44
Community24
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
71/100Good
Architecture77
Code Quality74
Innovation70
Learning Curve62

@oclif/config is the configuration layer that older versions of the oclif CLI framework are built on. It defines the central Config object that represents a running CLI, along with the standard interfaces for commands, plugins, hooks, topics, and the cached command manifest, and it handles discovering and loading plugins from the file system.

This package has been replaced by @oclif/core, which merges the previously separate oclif packages into one, and it is no longer maintained. It remains heavily installed as a transitive dependency of oclif v1 CLIs and is documented here for reference and migration purposes.

What You Get

  • A Config object and load helper describing a running oclif CLI and its environment
  • Standard interfaces for commands, plugins, hooks, topics, and the command manifest
  • Plugin discovery and loading from the file system, including TypeScript (ts-node) support
  • Platform and architecture detection plus terminal screen helpers

Common Use Cases

  • Loading and describing an oclif CLI’s plugins, commands, and configuration at runtime
  • Reading the cached command manifest to speed up CLI startup
  • Sharing typed interfaces between oclif components and plugins

Under The Hood

Architecture - src/index.ts re-exports the package’s building blocks: Config/IConfig/load from config.ts, plus the Command, Hook/Hooks, Manifest, PJSON, Plugin/IPlugin, and Topic interfaces from their respective modules. config.ts builds the runtime picture of a CLI, while plugin.ts discovers and instantiates plugins (using globby to walk the file system and ts-node to load TypeScript command sources in development), and manifest.ts reads and writes the cached command manifest that speeds up startup. screen.ts, util.ts, and platform/arch detection round out the environment-awareness surface.

Tech Stack - Written in TypeScript and shipped as CommonJS in lib/. Runtime dependencies include @oclif/errors and @oclif/parser from the same family, plus globby for file globbing, is-wsl for environment detection, debug for diagnostics, and tslib for the TypeScript runtime helpers.

Code Quality - The source is split into small single-responsibility modules, and the test directory is comparatively thorough with config.test.ts, plugin.test.ts, ts-node.test.ts, typescript.test.ts, and fixtures. Everything is typed, and the shared interfaces are the contract the rest of oclif v1 depends on, though the package is now in maintenance-only mode.

API Design - Most of the surface is interfaces and a load entry point rather than a large imperative API, which keeps it declarative and predictable for consumers. The main friction is conceptual: it is one layer of a multi-package framework, so using it well means understanding how config, plugins, and commands fit together — the exact coupling @oclif/core later folded into a single package.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search