Skip to content

A CLI for APIMatic to validate and transform API specs and to create client libraries.

Notifications You must be signed in to change notification settings

apimatic/apimatic-cli

Folders and files

NameName
Last commit message
Last commit date
Mar 17, 2025
Nov 26, 2021
Nov 9, 2021
Mar 17, 2025
Mar 17, 2025
Nov 1, 2021
Oct 11, 2021
Oct 14, 2021
Nov 6, 2021
Sep 28, 2023
Oct 14, 2021
Oct 14, 2021
Mar 17, 2025
Mar 17, 2025
Nov 26, 2021
Mar 17, 2025
Mar 17, 2025
Nov 26, 2021
Mar 17, 2025

Repository files navigation

@apimatic/cli

apimatic is in Alpha.

The official CLI for APIMatic.

oclif Version Downloads/week License

Getting Started

To get started with APIMatic's CLI using a step by step wizard, run the following command:

$ apimatic portal:quickstart

Usage

$ 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
...

Commands

apimatic api:transform

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

apimatic api:validate

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

apimatic auth:login

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

apimatic auth:logout

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

apimatic auth:status

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

apimatic autocomplete [SHELL]

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

apimatic help [COMMAND]

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

apimatic portal:generate

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

apimatic portal:quickstart

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

apimatic portal:serve

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

apimatic sdk:generate

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

About

A CLI for APIMatic to validate and transform API specs and to create client libraries.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages