api-client/packages/hoppscotch-cli
2022-08-12 13:53:40 +05:30
..
bin Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30
src feat: added delay flag in @hoppscotch/cli and related tests (#2527) 2022-08-04 19:19:14 +05:30
.gitignore Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30
.prettierrc Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30
CODE_OF_CONDUCT.md Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30
CONTRIBUTING.md fix: deprecated pnpx usage migrated to pnpm exec 2022-05-03 12:39:56 +05:30
jest.config.ts chore: tests for hoppscotch-cli (#2300) 2022-05-11 15:44:19 +05:30
jest.setup.ts chore: tests for hoppscotch-cli (#2300) 2022-05-11 15:44:19 +05:30
LICENSE Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30
package.json feat: allow quoted key/values for escaping characters and trail/lead whitespaces in raw key value pairs (#2578) 2022-08-12 13:53:40 +05:30
README.md feat: added support for passing env.json file to test cmd (#2373) 2022-06-15 23:53:24 +05:30
tsconfig.json Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30
tsup.config.ts Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30

Hoppscotch CLI ALPHA

A CLI to run Hoppscotch test scripts in CI environments.

Commands:

  • hopp test [options] [file]: testing hoppscotch collection.json file

Usage:

hopp [options or commands] arguments

Options:

  • -v, --ver: see the current version of the CLI
  • -h, --help: display help for command

Command Descriptions:

  1. hopp -v / hopp --ver

    • Prints out the current version of the Hoppscotch CLI
  2. hopp -h / hopp --help

    • Displays the help text
  3. hopp test [options] <file_path>

    • Interactive CLI to accept Hoppscotch collection JSON path
    • Parses the collection JSON and executes each requests
    • Executes pre-request script.
    • Outputs the response of each request.
    • Executes and outputs test-script response.

    Options:

    -e <file_path> / --env <file_path>
    • Accepts path to env.json with contents in below format:

      {
          "ENV1":"value1",
          "ENV2":"value2"
      }
      
    • You can now access those variables using pw.env.get('<var_name>')

        Taking the above example, `pw.env.get("ENV1")` will return `"value1"`
      

Install

Install @hoppscotch/cli from npm by running:

npm i -g @hoppscotch/cli

Developing:

  1. Clone the repository, make sure you've installed latest pnpm.
  2. pnpm install
  3. cd packages/hoppscotch-cli
  4. pnpm run build
  5. sudo pnpm link --global
  6. Test the installation by executing hopp

Contributing:

To get started contributing to the repository, please read CONTRIBUTING.md