Registry / devops / anypoint-cli-api-mgr-plugin

anypoint-cli-api-mgr-plugin

JSON →
library1.4.3jsnpmunverified

The Anypoint CLI API Manager Plugin is an oclif-based command-line interface extension for interacting with MuleSoft's Anypoint Platform API Manager. It provides commands to manage APIs, environments, and related resources directly from the terminal, making it suitable for scripting and automation of API lifecycle tasks within the Anypoint Platform ecosystem. The package is currently at version 1.4.3 and appears to be actively maintained, following standard npm release cycles for updates. Its primary differentiator is providing direct, programmatic control over the API Manager via a standardized CLI, integrating seamlessly into CI/CD pipelines and developer workflows that leverage the Anypoint Platform. It ships with TypeScript types, suggesting potential for programmatic interaction for advanced use cases, though its main interface is the command line.

npm install anypoint-cli-api-mgr-plugin
INSTALL
IMPORT
SIG · ANYPOINT-CLI-API-M
A
anypoint-cli-api-mgr-plugin
devopsjavascriptv1.4.3
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.

ApiListCommand
import { ApiListCommand } from '@mulesoft/anypoint-cli-api-mgr-plugin';
This package is primarily a CLI plugin. Direct programmatic imports like this are typically used for advanced scenarios such as testing individual commands or building custom tools that extend its functionality, rather than for general application development. The class structure follows oclif conventions for commands.
ApiManagerApi
import { ApiManagerApi } from '@mulesoft/anypoint-cli-api-mgr-plugin';
Hypothetical type representing an API entity within the API Manager, likely exported given the package ships TypeScript types. Useful for type-checking when programmatically interacting with command outputs or constructing data structures relevant to the plugin's domain.
AnypointEnvironment
import { AnypointEnvironment } from '@mulesoft/anypoint-cli-api-mgr-plugin';
Hypothetical type for an Anypoint environment, useful for strict typing in programmatic contexts. As with other programmatic imports, this is not a typical consumption pattern for this CLI plugin, which is primarily driven via shell commands.

Demonstrates global installation and usage of a command (`api-mgr:api:list`) with environment variables for authentication and target host configuration.

npm install -g @mulesoft/anypoint-cli-api-mgr-plugin # Configure environment variables for authentication and target environment export ANYPOINT_USERNAME='your-anypoint-username' export ANYPOINT_PASSWORD='your-anypoint-password' export ANYPOINT_ENV='Sandbox' export ANYPOINT_HOST='qax.anypoint.mulesoft.com' # Mandatory for non-PROD US environments # List APIs in the configured environment using the installed plugin @mulesoft/anypoint-cli-api-mgr-plugin api-mgr:api:list # Alternatively, for local development (without global install and with rebuild-on-run): # git clone https://github.com/mulesoft/anypoint-cli-api-mgr-plugin.git # cd anypoint-cli-api-mgr-plugin # npm ci # npm run buildAndRun -- api-mgr:api:list --username 'your-anypoint-username' --password 'your-anypoint-password' --environment 'Sandbox' --host 'qax.anypoint.mulesoft.com'
anypoint-cli-api-mgr-plugin --version
Debug
Known issues
gotchaWhen running tests, ensure the `ANYPOINT_HOST` environment variable is unset. Leaving it set can cause test failures due to `nock` mocks being based on the default URI, leading to calls to different URIs than expected.
fix
Before running tests (e.g., `npm run test`), execute `unset ANYPOINT_HOST` in your terminal session.
affects: >=0.4.0
gotchaFor local development, changes to the plugin's source code (`src/`) require a rebuild before they are reflected in command execution. This means running `npm run dev` or `npm run build` after modifications.
fix
Use `npm run buildAndRun -- <command>` to automatically rebuild the code before executing a command, or manually run `npm run build` after each code change.
affects: >=0.4.0
gotchaEnabling source maps for debugging TypeScript files requires manual modification of `tsconfig.json` and `tsconfig.lib.json` files. The default configuration does not generate source maps.
fix
Add `"sourceMap": true` to the `compilerOptions` section of both `tsconfig.json` and `tsconfig.lib.json`.
affects: >=0.4.0
gotchaAuthentication via command-line flags (`--username`, `--password`) can expose credentials in shell history. Using environment variables (`ANYPOINT_USERNAME`, `ANYPOINT_PASSWORD`) is generally a more secure practice to avoid this.
fix
Prefer setting `ANYPOINT_USERNAME` and `ANYPOINT_PASSWORD` environment variables instead of passing credentials directly as command-line arguments.
affects: >=0.4.0
Errors
Common errors & fixes
Error: Missing required flag: --username
The command requires authentication credentials, and the username was not provided either via a flag or an environment variable.
fix
Provide `--username 'your-user'` and `--password 'your-pass'` flags, or set `export ANYPOINT_USERNAME='your-user'` and `export ANYPOINT_PASSWORD='your-pass'`.
Error: Anypoint host must be provided (e.g. --host us.anypoint.mulesoft.com)
Attempted to connect to an Anypoint environment that is not the default PROD US, without specifying the host URL.
fix
Add the `--host` flag with the correct Anypoint host (e.g., `--host qax.anypoint.mulesoft.com`), or set `export ANYPOINT_HOST='your-host.mulesoft.com'`.
Command not found: api-mgr:api:list
The specified command does not exist, is misspelled, or the plugin is not correctly installed/linked.
fix
Verify the command spelling, ensure the plugin is globally installed (`npm install -g @mulesoft/anypoint-cli-api-mgr-plugin`), or if developing locally, ensure `npm run build` has been executed.
Upgrade
Version history
1.4.3latest on npm
Audit
Dependencies
oclifrequiredFramework for building the CLI plugin. Implicit peer dependency.
noderequiredRuntime environment, specifically Node.js >=16.0.0 is required.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources