Registry / devops / base-cli-process

base-cli-process

JSON →
library0.1.19jsnpmunverified

base-cli-process is a utility package designed to normalize command-line arguments (`argv`) for applications built on the `base` framework. It functions as a `base` plugin, pre-processing the input object with `base-cli-schema` before invoking the `.process()` method from `base-cli`. This package, currently at version 0.1.19, helps structure and standardize CLI input, offering commands for configuration management (`--config`), current working directory (`--cwd`), data definition (`--data`), option setting (`--option`), and plugin loading (`--plugins`). It is part of an older ecosystem and has not seen recent development. Given its low version number and lack of recent updates, it operates under a pre-1.0 development model where API stability is not guaranteed across minor versions.

npm install base-cli-process
INSTALL
IMPORT
SIG · BASE-CLI-PROCESS
B
base-cli-process
devopsjavascriptv0.1.19
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
const cli = require('base-cli-process');
This package is CommonJS-only. The main export is a function that returns a base plugin.
Base
const Base = require('base');
The core 'base' framework class, typically imported to instantiate the application object before using this plugin.
pluginUsage
app.use(cli());
The primary way to integrate base-cli-process into a 'base' application is by registering it as a plugin.

Demonstrates how to initialize a `base` application, register `base-cli-process` as a plugin, and then simulate processing command-line arguments to affect `app.options` and `app.config`.

const Base = require('base'); const cli = require('base-cli-process'); // A mock package.json content for demonstration const pkg = { name: 'my-cli-app', version: '1.0.0', description: 'A simple CLI application', scripts: { test: 'echo \"Error: no test specified\" && exit 1' }, config: { myApp: { defaultSetting: true } } }; const app = new Base(); // Register the base-cli-process plugin app.use(cli()); // Simulate a CLI call with some arguments // For example, running `node app.js --config=myApp.newSetting:value --data=user:guest --help` const simulatedArgv = { config: 'myApp.newSetting:value', data: 'user:guest', help: true, _: [] // minimist usually adds an empty array for non-flag args }; console.log('--- Before CLI processing ---'); console.log('App options:', app.options); console.log('App config:', app.config); // Process the simulated CLI arguments app.cli.process(simulatedArgv, function(err) { if (err) { console.error('CLI processing error:', err); return; } console.log('\n--- After CLI processing ---'); console.log('App options after processing:', app.options); console.log('App config after processing:', app.config); if (app.cache.get && app.cache.get.help) { console.log('Help was requested!'); } console.log('Simulated command-line arguments processed successfully.'); });
Debug
Known issues
breakingThe package `base-cli-process` is unmaintained and has not seen updates since at least 2017. It depends on an older `base` ecosystem, and its API is subject to change without strict semantic versioning due to being pre-1.0.
fix
Consider migrating to a modern, actively maintained CLI parsing library. If continued use is necessary, pin to the exact version and be aware of potential breaking changes if upstream 'base' packages are updated.
affects: <1.0.0
gotchaThis package is exclusively CommonJS (`require`) and will not work directly in a pure ECMAScript Modules (ESM) environment without transpilation or specific loader configurations (e.g., dual packages, top-level await imports, or tools like `esbuild`/`webpack`).
fix
Ensure your project is configured for CommonJS, or use tools to transpile/bundle if integrating into an ESM project. For new projects, prefer ESM-first alternatives.
affects: >=0.1.0
gotchaThe functionality of `base-cli-process` relies heavily on `base-cli` and `base-cli-schema`. Misconfigurations or outdated versions of these peer/runtime dependencies can lead to unexpected behavior or errors during CLI processing.
fix
Always install `base`, `base-cli`, and `base-cli-schema` alongside `base-cli-process`. Refer to their respective documentations for compatibility and usage.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: app.cli.process is not a function
The `base-cli-process` plugin was not correctly registered with the `base` application instance, or the `base-cli` plugin (which adds the `.cli` property) was not used.
fix
Ensure `app.use(cli())` is called *after* initializing `app = new Base()`. Also, verify that `base-cli` is installed and registered if it provides the `.cli` property directly to your `base` instance.
Error [ERR_REQUIRE_ESM]: require() of ES module not supported
Attempting to `require()` `base-cli-process` in a JavaScript environment configured for pure ESM, which does not support synchronous `require` for ESM modules.
fix
This package is CommonJS. If you must use it in an ESM project, consider using a build tool that handles CJS-to-ESM conversion, or if running Node.js, wrap the import in an async `import()` call (though direct `require` is usually the issue here).
Upgrade
Version history
0.1.19latest on npm
Audit
Dependencies
baserequiredCore framework for building pluggable applications; base-cli-process functions as a plugin for it.
base-clirequiredProvides the core CLI processing logic that base-cli-process hooks into.
base-cli-schemarequiredUsed for pre-processing and normalizing argv values before they are passed to base-cli.
Agent activity
7 hits · last 30 days
node
6
Resources
base-cli-process — npm install base-cli-process · libregistry