The official CLI for APIMatic.
$ npm install -g @apimatic/[email protected]
$ apimatic COMMAND
running command...
$ apimatic (-v|--version|version)
@apimatic/cli/0.0.0-alpha.3 linux-x64 node-v16.13.0
$ 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 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
OPTIONS
-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.
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
OPTIONS
--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.
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
OPTIONS
--auth-key=auth-key Set authentication key for all commands
EXAMPLES
$ apimatic auth:login
Please enter your registered email: [email protected]
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
EXAMPLE
$ apimatic auth:logout
Logged out
See code: src/commands/auth/logout.ts
View current authentication state
USAGE
$ apimatic auth:status
EXAMPLE
$ apimatic auth:status
Currently logged in as [email protected]
See code: src/commands/auth/status.ts
display autocomplete installation instructions
USAGE
$ apimatic autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying 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
OPTIONS
--all see all commands in CLI
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
OPTIONS
-f, --force overwrite if a portal 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] path to the downloaded portal
--folder=folder [default: ./] path to the input directory containing API specifications and config files
--zip download the generated portal as a .zip archive
EXAMPLE
$ apimatic portal:generate --folder="./portal/" --destination="D:/"
Your portal has been generated at D:/
See code: src/commands/portal/generate.ts
Generate SDK for your APIs
USAGE
$ apimatic sdk:generate
OPTIONS
-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
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