0.4.1 • Published 12 days ago

@impart-security/impart-cli v0.4.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
12 days ago

impart-cli

Use Impart from the command line.

Linting

The Impart CLI includes an API Specification Linter that ensures your API specifications meet the high quality standards and also remain free from security vulnerabilities. This is achieved with static analysis of your API specification with different rulesets designed for quality and security. The Impart CLI can be configured entirely from the command line, making it easy to integrate into any CI/CD Pipeline.

The API Quality ruleset lints API specifications for conformance with Open API Specifications. The Impart CLI defaults to this ruleset.

The API Security ruleset lints API specifications for OWASP API Security 10 vulnerabilities and misconfigurations. The Impart CLI can be configured to enable this ruleset from the command line.

Usage

$ npm install -g @impart-security/impart-cli
$ impart COMMAND
running command...
$ impart (--version)
@impart-security/impart-cli/0.4.1 linux-x64 node-v20.12.2
$ impart --help [COMMAND]
USAGE
  $ impart COMMAND
...

Usage in CI/CD workflows

impart-cli can be called from within an NPM project or directly via npx.

Example usage in a GitHub action using npx:

jobs:
  spec-update:
    runs-on: ubuntu-latest
    steps:
      - name: checkout code
        uses: actions/checkout@v3
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: "20"
      - name: Update specification
        run: npx @impart-security/impart-cli specs update --specId {YOUR_SPEC_ID} --specPath {PATH_TO_SPEC_FILE} --force
        env:
          IMPART_ACCESS_TOKEN: ${{ secrets.SPEC_UPDATE_TOKEN }}

Commands

impart autocomplete [SHELL]

Display autocomplete installation instructions.

USAGE
  $ impart autocomplete [SHELL] [-r]

ARGUMENTS
  SHELL  (zsh|bash|powershell) Shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  Display autocomplete installation instructions.

EXAMPLES
  $ impart autocomplete

  $ impart autocomplete bash

  $ impart autocomplete zsh

  $ impart autocomplete powershell

  $ impart autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

impart config

View configuration for impart-cli

USAGE
  $ impart config

ALIASES
  $ impart config show

impart config init

Initialize a new configuration for impart-cli

USAGE
  $ impart config init

impart specs

Manage specifications for an organization

USAGE
  $ impart specs

impart specs lint

Lint a specification file

USAGE
  $ impart specs lint [-p <value> | -s <value>] [-r <value>] [--failSeverity error|warn|info|hint]
    [--displayOnlyFailures] [--format json|stylish|junit|html|text|teamcity|pretty]

FLAGS
  -p, --specPath=<value>
      A path or URL to a specification file (YAML or JSON, Swagger2.0 or OpenAPI3.0).

      Examples:
      impart specs lint --specPath ./openapi.yaml
      impart specs lint --specPath https://example.com/openapi.yaml

  -r, --rulesetPath=<value>
      Path to a Spectral ruleset file.

      Example:
      impart specs lint --specPath ./openapi.yaml --rulesetPath ./my-ruleset.yaml

  -s, --specId=<value>
      ID of the specification to lint. An access token is required to lint specifications in the Impart system:
      https://console.impartsecurity.net/orgs/_/settings/tokens

      Example:
      impart specs lint --specId 1234-5678-9012-3456

  --displayOnlyFailures
      Only output results equal to or greater than --failSeverity

      Example:
      impart specs lint --specPath ./openapi.yaml --displayOnlyFailures

  --failSeverity=<option>
      [default: error]
      Results of this level or above will trigger a failure exit code.

      Example:
      impart specs lint --specPath ./openapi.yaml --failSeverity warn

      <options: error|warn|info|hint>

  --format=<option>
      [default: pretty]
      Format to use for outputting results.

      Example:
      impart specs lint --specPath ./openapi.yaml --format json

      <options: json|stylish|junit|html|text|teamcity|pretty>

DESCRIPTION
  Lint a specification file

  By default, linting is run against the OAS ruleset from Spectral.

  If you want to modify, disable or add new rules then you can provide your own ruleset file.

  See https://meta.stoplight.io/docs/spectral for more information on how to use Spectral.

impart specs update

Update a specification for an organization

USAGE
  $ impart specs update -p <value> [-s <value>] [-n <value>] [-f]

FLAGS
  -f, --force             Force update of specification without confirmation (useful for scripting).

                          Example:
                          impart specs update --specId 1234-5678-9012-3456 --specPath ./openapi.yaml --force
  -n, --name=<value>      Specification name.

                          Example:
                          impart specs update --specId 1234-5678-9012-3456 --name "My API"
  -p, --specPath=<value>  (required)
                          Path to the specification file (YAML or JSON, Swagger2.0 or OpenAPI3.0).

                          Example:
                          impart specs update --specId 1234-5678-9012-3456 --specPath ./openapi.yaml
  -s, --specId=<value>    ID of the specification to update. If not provided, you will be prompted to select a
                          specification from a list.

                          Example:
                          impart specs update --specId 1234-5678-9012-3456
0.4.1

12 days ago

0.4.0

1 month ago

0.3.9

3 months ago

0.3.8

4 months ago

0.2.30

9 months ago

0.3.0

8 months ago

0.2.29

10 months ago

0.3.6

7 months ago

0.3.5

7 months ago

0.3.7

5 months ago

0.3.2

8 months ago

0.3.1

8 months ago

0.3.4

7 months ago

0.3.3

7 months ago

0.2.27

12 months ago

0.2.26

1 year ago

0.2.28

12 months ago

0.2.25

1 year ago

0.2.24

1 year ago

0.2.23

1 year ago

0.2.22

1 year ago

0.2.21

1 year ago

0.2.20

1 year ago

0.2.19

1 year ago

0.2.18

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.17

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago