npm.io
3.22.9 • Published 21h agoCLI

anypoint-cli-v3

Licence
SEE LICENSE IN LICENSE.txt
Version
3.22.9
Deps
34
Size
553 kB
Vulns
22
Weekly
0

Anypoint CLI v3

npm version Documentation

Note: This is Anypoint CLI v3 (legacy). For the latest version, see Anypoint CLI v4.

Display and interact with the MuleSoft Anypoint Platform from the command line. Supports interactive shell and standard CLI modes.

Installation

npm install -g anypoint-cli-v3

Requirements: Node.js >= 8.12.0

Usage

anypoint-cli [options] [command]

Omitting command starts the interactive shell mode.

Authentication

The CLI supports three authentication methods (in order of precedence):

Method Parameters
Bearer token --bearer <token>
Username/Password --username <user> --password <pass>
Connected App (Client Credentials) --client_id <id> --client_secret <secret>
Credentials file

Parameters are loaded from ~/.anypoint/credentials:

{
  "default": {
    "username": "",
    "password": ""
  },
  "otherProfile": {
    "username": "",
    "password": "",
    "organization": "",
    "environment": "",
    "host": ""
  },
  "connAppProfile": {
    "client_id": "",
    "client_secret": "",
    "organization": "",
    "environment": "",
    "host": ""
  }
}

The default profile is used unless the ANYPOINT_PROFILE environment variable is set.

Environment variables

Environment variables override credentials file values:

Variable Description
ANYPOINT_USERNAME Username
ANYPOINT_PASSWORD Password
ANYPOINT_CLIENT_ID Connected App client ID
ANYPOINT_CLIENT_SECRET Connected App client secret
ANYPOINT_BEARER Bearer token
ANYPOINT_ORG Organization
ANYPOINT_ENV Environment
ANYPOINT_HOST Anypoint Platform host (default: anypoint.mulesoft.com)
ANYPOINT_OUTPUT Output format (table or json)
ANYPOINT_FIELDS Fields to display (comma-separated)
ANYPOINT_PROFILE Profile name from credentials file
Precedence

Command-line flags > Environment variables > Credentials file

Additional notes
  • If password is omitted but username is provided, you will be prompted for the password.
  • bearer can only be set via environment variable or command-line flag (not in the credentials file).
  • If the CLI cannot determine which credentials to use, it exits with an error.

Global options

Option Description
--organization Business group (by name or ID)
--environment Environment (by name or ID)
--host Anypoint Platform host
--output Output format: table (default) or json
--fields Comma-separated list of fields to display

Global options --output and --fields can also be set in ~/.anypoint/defaults:

{
  "default": {
    "output": "json",
    "fields": "ID,Name"
  },
  "otherProfile": {
    "output": "table"
  }
}

Commands

Context
Command Description
use business-group <name> Switch business group
use environment <name> Switch environment
Account
Command Description
account business-group list List business groups
account business-group describe <name> Describe a business group
account environment list List environments
account environment create <name> Create an environment
account environment delete <name> Delete an environment
account environment describe <name> Describe an environment
account user describe Describe the current user
API Manager
Command Description
api-mgr api list List API instances
api-mgr api describe <id> Describe an API instance
api-mgr api manage Create an API instance
api-mgr api delete <id> Delete an API instance
api-mgr api deploy <id> Deploy an API proxy
api-mgr api redeploy <id> Redeploy an API proxy
api-mgr api edit <id> Edit an API instance
api-mgr api deprecate <id> Deprecate an API instance
api-mgr api undeprecate <id> Undeprecate an API instance
api-mgr api download-proxy <id> Download API proxy
api-mgr api promote <id> Promote an API instance
api-mgr api classify <id> Classify an API instance
api-mgr api change-specification <id> Change API specification
api-mgr api autodiscovery <id> Get autodiscovery info
api-mgr policy list <api-id> List policies
api-mgr policy describe <api-id> <policy-id> Describe a policy
api-mgr policy apply <api-id> Apply a policy
api-mgr policy edit <api-id> <policy-id> Edit a policy
api-mgr policy remove <api-id> <policy-id> Remove a policy
api-mgr policy enable <api-id> <policy-id> Enable a policy
api-mgr policy disable <api-id> <policy-id> Disable a policy
api-mgr tier list <api-id> List SLA tiers
api-mgr tier add <api-id> Add an SLA tier
api-mgr tier copy <source-api-id> <target-api-id> Copy SLA tiers
api-mgr tier delete <api-id> <tier-id> Delete an SLA tier
api-mgr alert list <api-id> List API alerts
api-mgr alert add <api-id> Add an API alert
api-mgr contract list <api-id> List contracts
api-mgr contract delete <api-id> <contract-id> Delete a contract
Runtime Manager — CloudHub
Command Description
runtime-mgr cloudhub-application list List CloudHub applications
runtime-mgr cloudhub-application describe <name> Describe an application
runtime-mgr cloudhub-application describe-json <name> Describe in JSON format
runtime-mgr cloudhub-application deploy <name> Deploy an application
runtime-mgr cloudhub-application modify <name> Modify an application
runtime-mgr cloudhub-application delete <name> Delete an application
runtime-mgr cloudhub-application stop <name> Stop an application
runtime-mgr cloudhub-application start <name> Start an application
runtime-mgr cloudhub-application restart <name> Restart an application
runtime-mgr cloudhub-application download-logs <name> Download logs
runtime-mgr cloudhub-application tail-logs <name> Tail logs
runtime-mgr cloudhub-application copy <source> <target> Copy an application
runtime-mgr cloudhub-application copy-replace <source> <target> Copy and replace
runtime-mgr cloudhub-application revert-runtime <name> Revert runtime version
runtime-mgr cloudhub-alert list List CloudHub alerts
runtime-mgr cloudhub-alert-history describe <id> Describe alert history
Runtime Manager — CloudHub 2.0
Command Description
runtime-mgr cloudhub2-application list List CH2 applications
runtime-mgr cloudhub2-application describe <name> Describe a CH2 application
runtime-mgr cloudhub2-application deploy <name> Deploy a CH2 application
runtime-mgr cloudhub2-application modify <name> Modify a CH2 application
runtime-mgr cloudhub2-application delete <name> Delete a CH2 application
runtime-mgr cloudhub2-application stop <name> Stop a CH2 application
runtime-mgr cloudhub2-application start <name> Start a CH2 application
runtime-mgr cloudhub2-application restart <name> Restart a CH2 application
runtime-mgr cloudhub2-application download-logs <name> Download logs
Runtime Manager — Standalone (Hybrid)
Command Description
runtime-mgr standalone-application list List standalone applications
runtime-mgr standalone-application describe <name> Describe an application
runtime-mgr standalone-application describe-json <name> Describe in JSON format
runtime-mgr standalone-application deploy <name> Deploy an application
runtime-mgr standalone-application modify <name> Modify an application
runtime-mgr standalone-application delete <name> Delete an application
runtime-mgr standalone-application stop <name> Stop an application
runtime-mgr standalone-application start <name> Start an application
runtime-mgr standalone-application restart <name> Restart an application
runtime-mgr standalone-application copy <source> <target> Copy an application
runtime-mgr standalone-application artifact <name> Get application artifact
runtime-mgr standalone-alert list List alerts
runtime-mgr standalone-alert describe <id> Describe an alert
runtime-mgr standalone-alert create Create an alert
runtime-mgr standalone-alert modify <id> Modify an alert
runtime-mgr server list List servers
runtime-mgr server describe <id> Describe a server
runtime-mgr server modify <id> Modify a server
runtime-mgr server delete <id> Delete a server
runtime-mgr server token Get server registration token
runtime-mgr serverGroup list List server groups
runtime-mgr serverGroup describe <id> Describe a server group
runtime-mgr serverGroup create <name> Create a server group
runtime-mgr serverGroup modify <id> Modify a server group
runtime-mgr serverGroup delete <id> Delete a server group
runtime-mgr serverGroup add server <group-id> <server-id> Add server to group
runtime-mgr serverGroup remove server <group-id> <server-id> Remove server from group
runtime-mgr cluster list List clusters
runtime-mgr cluster describe <id> Describe a cluster
runtime-mgr cluster create <name> Create a cluster
runtime-mgr cluster modify <id> Modify a cluster
runtime-mgr cluster delete <id> Delete a cluster
runtime-mgr cluster add server <cluster-id> <server-id> Add server to cluster
runtime-mgr cluster remove server <cluster-id> <server-id> Remove server from cluster
Runtime Manager — Runtime Fabric
Command Description
runtime-mgr rtf list List Runtime Fabrics
Runtime Manager — PCF
Command Description
runtime-mgr pcf-application list List PCF applications
runtime-mgr pcf-application describe <name> Describe a PCF application
runtime-mgr pcf-application describe-json <name> Describe in JSON format
runtime-mgr pcf-application deploy <name> Deploy a PCF application
runtime-mgr pcf-application modify <name> Modify a PCF application
runtime-mgr pcf-application delete <name> Delete a PCF application
runtime-mgr pcf-application stop <name> Stop a PCF application
runtime-mgr pcf-application start <name> Start a PCF application
runtime-mgr pcf-application restart <name> Restart a PCF application
CloudHub Networking
Command Description
cloudhub region list List CloudHub regions
cloudhub runtime list List CloudHub runtimes
cloudhub vpc list List VPCs
cloudhub vpc describe <name> Describe a VPC
cloudhub vpc describe-json <name> Describe a VPC in JSON
cloudhub vpc create <name> Create a VPC
cloudhub vpc delete <name> Delete a VPC
cloudhub vpc environments add <vpc> <env> Add environment to VPC
cloudhub vpc environments remove <vpc> <env> Remove environment from VPC
cloudhub vpc business-groups add <vpc> <bg> Add business group to VPC
cloudhub vpc business-groups remove <vpc> <bg> Remove business group from VPC
cloudhub vpc dns-servers set <vpc> Set DNS servers
cloudhub vpc dns-servers unset <vpc> Unset DNS servers
cloudhub vpc firewall-rules describe <vpc> Describe firewall rules
cloudhub vpc firewall-rules add <vpc> Add firewall rule
cloudhub vpc firewall-rules remove <vpc> <index> Remove firewall rule
cloudhub load-balancer list List load balancers
cloudhub load-balancer describe <name> Describe a load balancer
cloudhub load-balancer describe-json <name> Describe in JSON
cloudhub load-balancer create <name> Create a load balancer
cloudhub load-balancer delete <name> Delete a load balancer
cloudhub load-balancer start <name> Start a load balancer
cloudhub load-balancer stop <name> Stop a load balancer
cloudhub load-balancer dynamic-ips enable <name> Enable dynamic IPs
cloudhub load-balancer dynamic-ips disable <name> Disable dynamic IPs
cloudhub load-balancer ssl-endpoint add <name> Add SSL endpoint
cloudhub load-balancer ssl-endpoint describe <name> Describe SSL endpoint
cloudhub load-balancer ssl-endpoint remove <name> Remove SSL endpoint
cloudhub load-balancer ssl-endpoint set-default <name> Set default SSL endpoint
cloudhub load-balancer mappings add <name> Add URL mapping
cloudhub load-balancer mappings describe <name> Describe URL mappings
cloudhub load-balancer mappings remove <name> <index> Remove URL mapping
cloudhub load-balancer allowlist add <name> Add to allowlist
cloudhub load-balancer allowlist remove <name> Remove from allowlist
Design Center
Command Description
designcenter project list List Design Center projects
designcenter project create <name> Create a project
designcenter project delete <name> Delete a project
designcenter project download <name> Download a project
designcenter project upload <name> Upload a project
designcenter project publish <name> Publish a project to Exchange
Exchange
Command Description
exchange asset list List Exchange assets
exchange asset describe <group>/<asset>/<version> Describe an asset
exchange asset upload Upload an asset
exchange asset uploadv2 Upload an asset (v2)
exchange asset download <group>/<asset>/<version> Download an asset
exchange asset copy <group>/<asset>/<version> Copy an asset
exchange asset delete <group>/<asset>/<version> Delete an asset
exchange asset deprecate <group>/<asset>/<version> Deprecate an asset
exchange asset undeprecate <group>/<asset>/<version> Undeprecate an asset
exchange asset modify <group>/<asset>/<version> Modify an asset
exchange asset mutableDataUpload <group>/<asset>/<version> Upload mutable data
exchange asset page list <group>/<asset>/<version> List asset pages
exchange asset page upload <group>/<asset>/<version> Upload a page
exchange asset page update <group>/<asset>/<version> Update a page
exchange asset page download <group>/<asset>/<version> Download a page
exchange asset page delete <group>/<asset>/<version> Delete a page
exchange asset page modify <group>/<asset>/<version> Modify a page
Datagraph
Command Description
datagraph describe Describe Datagraph config
datagraph scale Scale Datagraph
datagraph schema-download Download Datagraph schema
datagraph sources list List Datagraph sources
datagraph sources get <name> Get a Datagraph source
datagraph sources delete <name> Delete a Datagraph source
datagraph validate asset <group>/<asset>/<version> Validate asset for Datagraph
datagraph load-balancer-config add Add LB config
datagraph load-balancer-config describe Describe LB config
datagraph load-balancer-config remove Remove LB config
Governance
Command Description
governance ruleset init Initialize a governance ruleset
governance ruleset validate <path> Validate a ruleset
governance ruleset clone <id> Clone a ruleset
governance ruleset info <id> Get ruleset info
governance profile list List governance profiles
governance profile info <id> Get profile info
governance profile create Create a profile
governance profile update <id> Update a profile
governance profile delete <id> Delete a profile
governance api validate <path> Validate an API spec
governance api evaluate <path> Evaluate an API spec
governance api inspect <path> Inspect an API spec
governance document <path> Generate documentation

Analytics

To improve the Anypoint CLI experience, anonymized usage data is collected by default. You can opt out by setting collectMetrics to false in your ~/.anypoint/credentials file:

{
  "default": {
    "username": "",
    "password": "",
    "collectMetrics": false
  }
}

Or set the environment variable: COLLECT_METRICS=false

Development

Setup
git clone git@github.com:mulesoft-emu/anypoint-cli.git
cd anypoint-cli
npm install
Running tests
npm run cover          # Unit tests with coverage
npm run test-unit      # Unit tests only
Running locally
node src/app.js --username <user> --password <pass> [command]

Publishing

This package is published to npm as anypoint-cli-v3 via GitHub Actions OIDC trusted publishing.

Publishing is triggered manually via the GitHub Actions "Publish npm package" workflow on the master branch.

License

SEE LICENSE IN LICENSE.txt

Keywords