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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CLI Executable
✓ npx auditboard <command>
✗ node auditboard <command>
The primary interaction with this package is via its command-line executable, typically invoked using `npx` or if installed globally, directly as `auditboard`.
Command Definition File
✓ module.exports = { async command(args) { /* ... */ }, commandOptions: { /* ... */ } };
✗ export default { async command(args) { /* ... */ }, commandOptions: { /* ... */ } };
Custom command files (`ab-cli-commands/*.js`) must use CommonJS `module.exports` syntax to define their structure, not ES module `export` statements.
Accessing Arguments
✓ async command(args) { const requiredParam = args.firstParam; const optionalArg = args.option; }
✗ async command(firstParam, option) { /* ... */ }
All required and optional arguments are injected into the `command` function as properties of a single `args` object, keyed by their defined names.
Demonstrates how to install the CLI, create a custom command, define its arguments, and execute it locally within a project.
// 1. Install auditboard-cli in your project
npm install auditboard-cli
// 2. Create a new command named 'greet'
// Run this in your project's root directory:
npx auditboard make:command greet
// 3. Locate the generated command file: ab-cli-commands/greet.js
// Replace its content with the following:
/*
module.exports = {
async command(args) {
const name = args.name || 'World'; // Access required arg 'name'
const greeting = args.message || 'Hello'; // Access optional arg 'message'
console.log(`${greeting} ${name}!`);
return `Successfully greeted '${name}' with '${greeting}'.`;
},
commandOptions: {
help: 'Greets a person by name, with an optional custom message.',
description: 'A simple greeting command example',
required: [
{
name: 'name',
message: 'A name is required for the greeting.',
},
],
args: {
'--message': String,
'-m': '--message',
},
},
};
*/
// 4. Run your custom 'greet' command
// Example with required 'name' and optional 'message':
npx auditboard greet Alice --message "Hi there"
// Expected output:
// Hi there Alice!
// Successfully greeted 'Alice' with 'Hi there'.
// Example with only the required 'name':
npx auditboard greet Bob
// Expected output:
// Hello Bob!
// Successfully greeted 'Bob' with 'Hello'.
auditboard-cli --version
Errors
Common errors & fixes
Error: Cannot find module 'ab-cli-commands/my-command.js'
The CLI is unable to locate the specified command file. This might happen if the command name doesn't match the file name, or the file is not in the expected `ab-cli-commands` directory (or `~/.ab-cli-commands` for global).
fixVerify the command name matches the file name (e.g., `my:command` for `my-command.js`) and ensure the file is correctly placed in `ab-cli-commands` or `~/.ab-cli-commands`.
ReferenceError: module is not defined
Attempting to define a command file using ES module syntax (e.g., `export default ...`) while the Node.js environment expects CommonJS (`module.exports`).
fixChange the command file's export statement from `export default { ... }` to `module.exports = { ... };` to comply with CommonJS. Something went wrong...
A required argument for the command was not provided during execution. This message is specified in the `message` property of the `required` argument definition.
fixConsult the command's help (e.g., `npx auditboard help my:command`) to identify and provide all necessary required arguments.
Audit
Dependencies
argsrequiredUsed internally by auditboard-cli for parsing optional command-line arguments.