apimatic is in Alpha.
The official CLI for APIMatic.
To get started with APIMatic's CLI using a step by step wizard, run the following command:
$ apimatic portal:quickstart
$ npm install -g @apimatic/cli
$ apimatic COMMAND
running command...
$ apimatic (--version)
@apimatic/cli/0.0.0-alpha.0 win32-x64 node-v20.18.3
$ apimatic --help [COMMAND]
USAGE
$ apimatic COMMAND
...
apimatic api:transform
apimatic api:validate
apimatic auth:login
apimatic auth:logout
apimatic auth:status
apimatic autocomplete [SHELL]
apimatic help [COMMAND]
apimatic portal:generate
apimatic portal:quickstart
apimatic portal:serve
apimatic sdk:generate
Transform API specifications from one format to another. Supports 10+ different formats including OpenApi/Swagger, RAML, WSDL and Postman Collections.
USAGE
$ apimatic api:transform --format <value> [--file <value>] [--url <value>] [--destination <value>] [-f]
[--auth-key <value>]
FLAGS
-f, --force overwrite if same file exist in the destination
--auth-key=auth-key override current authentication state with an authentication key
--destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] directory to download
transformed file to
--file=file path to the API specification file to transform
--format=format (required) specification format to transform API specification into
APIMATIC|WADL2009|WSDL|SWAGGER10|SWAGGER20|SWAGGERYAML|OAS3|OPENAPI3YAML|APIBLUEPRINT|RAML|
RAML10|POSTMAN10|POSTMAN20|GRAPHQLSCHEMA
--url=url URL to the API specification file to transform. Can be used in place of the --file option
if the API specification is publicly available.
DESCRIPTION
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.
EXAMPLES
$ apimatic api:transform --format="OpenApi3Json" --file="./specs/sample.json" --destination="D:/"
Success! Your transformed file is located at D:/Transformed_OpenApi3Json.json
$ apimatic api:transform --format=RAML --url="https://petstore.swagger.io/v2/swagger.json" --destination="D:/"
Success! Your transformed file is located at D:/swagger_raml.yaml
See code: src/commands/api/transform.ts
Validate the syntactic and semantic correctness of an API specification
USAGE
$ apimatic api:validate [--file <value>] [--url <value>] [--auth-key <value>]
FLAGS
--auth-key=auth-key override current authentication state with an authentication key
--file=file Path to the API specification file to validate
--url=url URL to the specification file to validate. Can be used in place of the --file option if the API
specification is publicly available.
DESCRIPTION
Validate the syntactic and semantic correctness of an API specification
EXAMPLES
$ apimatic api:validate --file="./specs/sample.json"
Specification file provided is valid
$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json
Specification file provided is valid
See code: src/commands/api/validate.ts
Login using your APIMatic credentials or an API Key
USAGE
$ apimatic auth:login [--auth-key <value>]
FLAGS
--auth-key=auth-key Set authentication key for all commands
DESCRIPTION
Login using your APIMatic credentials or an API Key
EXAMPLES
$ apimatic auth:login
Please enter your registered email: apimatic-user@gmail.com
Please enter your password: *********
You have successfully logged into APIMatic
$ apimatic auth:login --auth-key=xxxxxx
Authentication key successfully set
See code: src/commands/auth/login.ts
Clear local login credentials
USAGE
$ apimatic auth:logout
DESCRIPTION
Clear local login credentials
EXAMPLES
$ apimatic auth:logout
Logged out
See code: src/commands/auth/logout.ts
View current authentication state
USAGE
$ apimatic auth:status
DESCRIPTION
View current authentication state
EXAMPLES
$ apimatic auth:status
Currently logged in as apimatic-client@gmail.com
See code: src/commands/auth/status.ts
Display autocomplete installation instructions.
USAGE
$ apimatic autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
Display autocomplete installation instructions.
EXAMPLES
$ apimatic autocomplete
$ apimatic autocomplete bash
$ apimatic autocomplete zsh
$ apimatic autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
Display help for apimatic.
USAGE
$ apimatic help [COMMAND]
ARGUMENTS
COMMAND command to show help for
DESCRIPTION
Display help for apimatic.
See code: @oclif/plugin-help
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
USAGE
$ apimatic portal:generate [--folder <value>] [--destination <value>] [-f] [--zip] [--auth-key <value>]
FLAGS
-f, --force overwrite if a portal exists in the destination
DESCRIPTION
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://docs.apimatic.io/platfo
rm-api/#/http/guides/generating-on-prem-api-portal/build-file-reference)
EXAMPLES
$ apimatic portal:generate --folder="./portal/" --destination="D:/"
Your portal has been generated at D:/
See code: src/commands/portal/generate.ts
Create your first API Portal using APIMatic’s Docs as Code offering.
USAGE
$ apimatic portal:quickstart
DESCRIPTION
Create your first API Portal using APIMatic’s Docs as Code offering.
EXAMPLES
$ apimatic portal:quickstart
See code: src/commands/portal/quickstart.ts
Generate and deploy a Docs as Code portal with hot reload.
USAGE
$ apimatic portal:serve [-p <value>] [-d <value>] [-s <value>] [-o] [--no-reload] [-i <value>] [--auth-key <value>]
FLAGS
-d, --destination=<value> [default: ./api-portal] Directory to store and serve the generated portal.
-i, --ignore=<value> Comma-separated list of files/directories to ignore.
-o, --open Open the portal in the default browser.
-p, --port=<value> [default: 3000] Port to serve the portal.
-s, --source=<value> [default: ./] Source directory containing specs, content, and build file. By default, the
current directory is used.
--auth-key=<value> Override current authentication state with an authentication key.
--no-reload Disable hot reload.
DESCRIPTION
Generate and deploy a Docs as Code portal with hot reload.
EXAMPLES
$ apimatic portal:serve --source="./" --destination="./api-portal" --port=3000 --open --no-reload
See code: src/commands/portal/serve.ts
Generate SDK for your APIs
USAGE
$ apimatic sdk:generate --platform <value> [--file <value>] [--url <value>] [--destination <value>] [-f] [--zip] [--auth-key <value>]
FLAGS
-f, --force overwrite if an SDK already exists in the destination
--auth-key=auth-key override current authentication state with an authentication key
--destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] directory to download the
generated SDK to
--file=file path to the API specification to generate SDKs for
--platform=platform (required) language platform for sdk
Simple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT
Legacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LIB|
JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|
TS_GENERIC_LIB
--url=url URL to the API specification to generate SDKs for. Can be used in place of the --file
option if the API specification is publicly available.
--zip download the generated SDK as a .zip archive
DESCRIPTION
Generate SDK for your APIs
EXAMPLES
$ apimatic sdk:generate --platform="CSHARP" --file="./specs/sample.json"
Generating SDK... done
Downloading SDK... done
Success! Your SDK is located at swagger_sdk_csharp
$ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
Generating SDK... done
Downloading SDK... done
Success! Your SDK is located at swagger_sdk_csharp
See code: src/commands/sdk/generate.ts