The `@mulesoft/anypoint-cli-command` package provides the foundational `Core` class for developing custom commands within the Anypoint CLI version 4 and later ecosystem. It extends `@oclif/core`, inheriting its robust command-line interface framework while adding Anypoint-specific functionalities. Developers leverage this library to gain convenient access to common CLI parameters, a standardized logging mechanism, output formatting utilities, and support for Anypoint platform features like scratch orgs. The current stable version, 1.6.8, is closely aligned with the Anypoint CLI's development cycle, receiving updates as part of the broader toolset's evolution. Its key differentiator is the deep integration with Anypoint platform concepts, streamlining the creation of purpose-built Anypoint CLI extensions.
npm install anypoint-cli-commandVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating a new CLI command by extending the `Core` class, parsing flags, and using the built-in logger.
Ensure your installed Anypoint CLI version is 4.0.0 or higher by running `anypoint-cli-v4 --version` and updating if necessary.
Rely on the public GitHub repository's README for essential usage information or consult external oclif documentation if specific Anypoint CLI library docs are missing.
Update your Node.js environment to version 16.0.0 or later using a tool like nvm or your preferred package manager.
Consult the official `@oclif/core` documentation for best practices and advanced usage, as this package primarily adds Anypoint-specific wrappers.
Upgrade your Anypoint CLI to version 4.0.0 or later: `npm update -g @mulesoft/anypoint-cli-v4` or reinstall with the latest version.
Ensure both `@mulesoft/anypoint-cli-command` and `@oclif/core` are installed in your project: `npm install @mulesoft/anypoint-cli-command @oclif/core` and that imports are correct.
Install the package: `npm install @mulesoft/anypoint-cli-command` (and `@oclif/core`). If using TypeScript, ensure `tsconfig.json` includes `"moduleResolution": "node"` or appropriate settings.