Getting Started with APIMatic CLI
In this guide, we will walk you through the commands used within APIMatic CLI. Most of the commands require authentication and for that, you will need to create an APIMatic account on our website.
Signing up is free! Take a free trial by signing in to create an APIMatic account.
Authentication
APIMatic CLI supports authentication via different methods explained below.
Authentication via APIMatic Credentials
APIMatic CLI supports authentication using the APIMatic credentials through which you signed in to your account. Use the apimatic auth:login
command to authenticate via APIMatic credentials.
$ apimatic auth:login
Please enter your registered email: apimatic-user@gmail.com
Please enter your password: *********
You have successfully logged into APIMatic
Authentication via Auth Keys
Use the --auth-key
option with the login command to authenticate using the API key. You can generate an API key by visiting the Get API Authentication Keys Docs.
$ apimatic auth:login --auth-key=xxxxxx
Authentication key successfully set
Overriding Auth Keys in API Calls
APIMatic CLI allows providing an API key for each individual command that requires authentication using the --auth-key
option. This is useful when you need to override the authentication state of the CLI for a specific command.
$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json --auth-key=xxxx
Specification file provided is valid
Using APIMatic CLI Help Command
Run apimatic help
to display a list of commands supported by APIMatic.
$ apimatic help
The official CLI for APIMatic.
VERSION
@apimatic/cli/0.0.0-alpha.3 win32-x64 node-v14.17.5
USAGE
$ apimatic [COMMAND]
TOPICS
api Transform API specifications from one format to another. Supports [10+ different
formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman Collections.
auth Login using your APIMatic credentials or an API Key
portal Generate and download a static API Documentation portal. Requires an input directory containing API
specifications, a config file and optionally, markdown guides. For details, refer to the
[documentation](https://portal-api-docs.apimatic.io/#/http/generating-api-portal/build-file)
sdk Generate SDK for your APIs
COMMANDS
autocomplete display autocomplete installation instructions
help display help for apimatic
Related commands are grouped together into topics.To view the commands included in each topic, run apimatic [topic] help
. For instance, to view the commands included in the topic api
, run apimatic api help
.
Each topic may have multiple commands associated with it. Run apimatic [topic]:[command]
to display help for each command associated with a topic.
$ apimatic auth:login --help
login to your APIMatic account
USAGE
$ apimatic auth:login
OPTIONS
--auth-key=auth-key Set authentication key for all commands
EXAMPLE
$ apimatic auth:login
Please enter your registered email: apimatic-user@gmail.com
Please enter your password: *********
You have successfully logged into APIMatic