npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@impart-security/impart-cli

v0.4.4

Published

Use Impart from the command line

Downloads

88

Readme

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.4 linux-x64 node-v20.13.1
$ 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