@stoplight/prism-cli
[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) [![Version](https://img.shields.io/npm/v/prism-cli.svg)](https://npmjs.org/package/@stoplight/prism-cli) [![Downloads/week](https://img.shields.io/npm/dw/prism-cli.svg)](
Last updated 4 days ago by marbemac .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @stoplight/prism-cli 
SYNC missed versions from official npm registry.

prism-cli

oclif Version Downloads/week License

Usage

$ npm install -g @stoplight/prism-cli
$ prism COMMAND
running command...
$ prism (-v|--version|version)
@stoplight/prism-cli/3.0.0-beta.6 darwin-x64 node-v12.6.0
$ prism --help [COMMAND]
USAGE
  $ prism COMMAND
...

Commands

prism help [COMMAND]

display help for prism

USAGE
  $ prism help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

prism mock SPEC

Start a mock server with the given spec file

USAGE
  $ prism mock SPEC

ARGUMENTS
  SPEC  Path to a spec file. Can be both a file or a fetchable resource on the web

OPTIONS
  -d, --dynamic       Dynamically generate examples.
  -h, --host=host     [default: 127.0.0.1] Host that Prism will listen to.
  -m, --multiprocess  Fork the http server from the CLI
  -p, --port=port     (required) [default: 4010] Port that Prism will run on.

See code: dist/commands/mock.ts

Running in production

When running in development mode (which happens when the NODE_ENV environment variable is not set to production) or the -m flag is set to false, both the HTTP Server and the CLI (which is responsible of parsing and showing the received logs on the screen) will run within the same process.

Processing logs slows down the process significantly. If you're planning to use the CLI in production (for example in a Docker Container) we recommend to run the CLI with the -m flag or set the NODE_ENV variable to production. In this way, the CLI and the HTTP server will run on two different processes, so that logs processing, parsing and printing does not slow down the http requests processing.

Development

Debugging

  1. yarn cli:debug mock file.oas.yml
  2. Run your preferred debugger on the newly created process. If you're into VSCoode, you can create .vscode/launch.json and put this content inside:
{
  "type": "node",
  "request": "attach",
  "name": "Attach",
  "port": 9229
},
  1. Enjoy the breakpoints :)

Current Tags

  • 3.0.0-alpha.11                                ...           alpha (2 months ago)
  • 3.0.0-beta.6                                ...           latest (4 days ago)

27 Versions

  • 3.0.0-beta.6                                ...           4 days ago
  • 3.0.0-beta.5                                ...           8 days ago
  • 3.0.0-beta.4                                ...           11 days ago
  • 3.0.0-beta.3                                ...           15 days ago
  • 3.0.0-beta.2                                ...           24 days ago
  • 3.0.0-beta.1                                ...           a month ago
  • 3.0.0-beta.0                                ...           a month ago
  • 3.0.0-alpha.16                                ...           a month ago
  • 3.0.0-alpha.15                                ...           a month ago
  • 3.0.0-alpha.14                                ...           a month ago
  • 3.0.0-alpha.13                                ...           a month ago
  • 3.0.0-alpha.12                                ...           a month ago
  • 3.0.0-alpha.11                                ...           2 months ago
  • 3.0.0-alpha.10                                ...           2 months ago
  • 3.0.0-alpha.9                                ...           2 months ago
  • 3.0.0-alpha.8                                ...           2 months ago
  • 3.0.0-alpha.7                                ...           2 months ago
  • 3.0.0-alpha.6                                ...           2 months ago
  • 3.0.0-alpha.5                                ...           2 months ago
  • 3.0.0-alpha.4                                ...           2 months ago
  • 3.0.0-alpha.3                                ...           2 months ago
  • 3.0.0-alpha.2                                ...           2 months ago
  • 3.0.0-alpha.1                                ...           2 months ago
  • 3.0.0-alpha.0                                ...           2 months ago
  • 3.0.0-pre.2                                ...           3 months ago
  • 3.0.0-pre.1                                ...           3 months ago
  • 3.0.0-pre.0                                ...           3 months ago
Downloads
Today 0
This Week 27
This Month 88
Last Day 27
Last Week 29
Last Month 143
Dependencies (9)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |