{"id":12805,"library":"anypoint-cli-api-mgr-plugin","title":"Anypoint CLI API Manager Plugin","description":"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.","status":"active","version":"1.4.3","language":"javascript","source_language":"en","source_url":"https://github.com/mulesoft/anypoint-cli-api-mgr-plugin","tags":["javascript","oclif-plugin","typescript"],"install":[{"cmd":"npm install anypoint-cli-api-mgr-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add anypoint-cli-api-mgr-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add anypoint-cli-api-mgr-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Framework for building the CLI plugin. Implicit peer dependency.","package":"oclif","optional":false},{"reason":"Runtime environment, specifically Node.js >=16.0.0 is required.","package":"node","optional":false}],"imports":[{"note":"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.","symbol":"ApiListCommand","correct":"import { ApiListCommand } from '@mulesoft/anypoint-cli-api-mgr-plugin';"},{"note":"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.","symbol":"ApiManagerApi","correct":"import { ApiManagerApi } from '@mulesoft/anypoint-cli-api-mgr-plugin';"},{"note":"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.","symbol":"AnypointEnvironment","correct":"import { AnypointEnvironment } from '@mulesoft/anypoint-cli-api-mgr-plugin';"}],"quickstart":{"code":"npm install -g @mulesoft/anypoint-cli-api-mgr-plugin\n\n# Configure environment variables for authentication and target environment\nexport ANYPOINT_USERNAME='your-anypoint-username'\nexport ANYPOINT_PASSWORD='your-anypoint-password'\nexport ANYPOINT_ENV='Sandbox'\nexport ANYPOINT_HOST='qax.anypoint.mulesoft.com' # Mandatory for non-PROD US environments\n\n# List APIs in the configured environment using the installed plugin\n@mulesoft/anypoint-cli-api-mgr-plugin api-mgr:api:list\n\n# Alternatively, for local development (without global install and with rebuild-on-run):\n# git clone https://github.com/mulesoft/anypoint-cli-api-mgr-plugin.git\n# cd anypoint-cli-api-mgr-plugin\n# npm ci\n# npm run buildAndRun -- api-mgr:api:list --username 'your-anypoint-username' --password 'your-anypoint-password' --environment 'Sandbox' --host 'qax.anypoint.mulesoft.com'","lang":"bash","description":"Demonstrates global installation and usage of a command (`api-mgr:api:list`) with environment variables for authentication and target host configuration."},"warnings":[{"fix":"Before running tests (e.g., `npm run test`), execute `unset ANYPOINT_HOST` in your terminal session.","message":"When 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.","severity":"gotcha","affected_versions":">=0.4.0"},{"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.","message":"For 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.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Add `\"sourceMap\": true` to the `compilerOptions` section of both `tsconfig.json` and `tsconfig.lib.json`.","message":"Enabling 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.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Prefer setting `ANYPOINT_USERNAME` and `ANYPOINT_PASSWORD` environment variables instead of passing credentials directly as command-line arguments.","message":"Authentication 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.","severity":"gotcha","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Provide `--username 'your-user'` and `--password 'your-pass'` flags, or set `export ANYPOINT_USERNAME='your-user'` and `export ANYPOINT_PASSWORD='your-pass'`.","cause":"The command requires authentication credentials, and the username was not provided either via a flag or an environment variable.","error":"Error: Missing required flag: --username"},{"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'`.","cause":"Attempted to connect to an Anypoint environment that is not the default PROD US, without specifying the host URL.","error":"Error: Anypoint host must be provided (e.g. --host us.anypoint.mulesoft.com)"},{"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.","cause":"The specified command does not exist, is misspelled, or the plugin is not correctly installed/linked.","error":"Command not found: api-mgr:api:list"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null}