midrun-cli

0.0.17 • Public • Published


A Sample CLI tool manage Midrun APIs.


npm i -g midrun-cli

View documentation for details: https://mid.run/


Usage

~$ midrun --help
              _       _
  _ __ ___   (_)   __| |      _ __   _   _   _ __
 | '_ ` _ \  | |  / _` |     | '__| | | | | | '_ \
 | | | | | | | | | (_| |  _  | |    | |_| | | | | |
 |_| |_| |_| |_|  \__,_| (_) |_|     \__,_| |_| |_|


Usage: midrun -id <projectId>  --client
┌──────────────────────────────────────┐
│                                      │
│                                      │
│   Initialize a Midrun API client,    │
│   keep its spec up to date.          │
│                                      │
│   mid.run/docs                       │
│                                      │
└──────────────────────────────────────┘


Options:
      --version  Show version number                                   [boolean]
      --id       Your Midrun project ID                      [string] [required]
  -s, --subset   Hide some methods in this client, only selected methods (useful
                 for public APIs)                                       [string]
      --output   Path and filename where API settings will be saved     [string]
      --client   Exclude server properties from spec                   [boolean]
      --server   Exclude client properties from spec                   [boolean]
      --prod     Exclude debugging props like colors and descriptions  [boolean]
      --help     Show help                                             [boolean]

Installation

See mid.run/docs for the full documentation.

Run npm i -g midrun-cli to install the CLI globally.

Alternatively, Run npm i -D midrun-cli to install it as a dev dependency. You can then invoke the library from packages.json scripts. ex:

  "scripts": {
    "start": "node index.js",
    "midrun": "midrun --id myApp",
    "dev": "npm run && midrun"

This will automatically update your your API spec on server start.

Potential issues with global installs

⚠️ This might cause an error which can be resolved easily by using sudo with the command, however, using sudo with npm is not recommended because it might cause permission issues later. So instead put the code below in your .bashrc file and then run the above command again.

npm set prefix ~/.npm
PATH="$HOME/.npm/bin:$PATH"
PATH="./node_modules/.bin:$PATH"

Type midrun or midrun --help to get started.


License

MIT © mid.run

/midrun-cli/

    Package Sidebar

    Install

    npm i midrun-cli

    Weekly Downloads

    0

    Version

    0.0.17

    License

    MIT

    Unpacked Size

    105 kB

    Total Files

    5

    Last publish

    Collaborators

    • midrun