A Sample CLI tool manage Midrun APIs.
npm i -g midrun-cli
View documentation for details: https://mid.run/
~$ 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]
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.
⚠️ This might cause an error which can be resolved easily by usingsudo
with the command, however, usingsudo
withnpm
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.
MIT © mid.run