mr-manager
v0.0.3
Published
Process manager for running stuff
Downloads
6
Readme
Mr. Manager
Generic process monitor/manager for development environments. You can run multiple commands in the same shell, track their state from building to ready (or failure if you made a mistake). Has some nice bonuses like autoreload and more in the works.
Running
Any of the following aliases will work to get mr-manager
up and running:
mr-manager
mr-man
mrm
Command Line Options
You may supply one or more positional arguments to run a subset of the commands defined in your config file e.g.
mrm frontend *-svc backend-*
The following named arguments are supported:
-c
- config file location, if not specified looks formrm.toml
ormrm.yaml
in thecwd
Config File Format
Config files can be specified in either yaml or toml. For the sake of conciseness and familiarity, we'll go with yaml for the example.
version: "exp"
commands:
- name: "backend"
command: "node"
args:
- "index.js"
watch:
- "./backend/*.js"
options:
cwd: "./backend"
ready:
- "Listening on"
install:
- name: 'deps'
command: 'yarn'
args:
- "install"
options:
cwd: "./backend"
- name: "frontend"
command: "yarn"
args:
- "webpack"
building:
- "Compiling"
ready:
- "Compiled"
- "Built at"
failed:
- "Failed to compile"
options:
cwd: "./frontend"
install:
- name: 'deps'
command: 'yarn'
args:
- "install"
options:
cwd: "./frontend"
There are two top level params:
version
- for the time being, always"exp"
to indicate that this is still an in-flux config file formatcommands
- a list of commands thatmr-manager
should run
Each command has the following format:
name
- a human-readable name for the commandcommand
- the command to runargs
- a list of arguments to pass to the commandoptions
- a map of options for running the command, passed directly to node's child_process.spawn methodwatch
- can be a string, an array or a map with the keyspaths
andoptions
. used as arguments to chokidar for autoreloading a command. this is only needed if your command doesn't have some built-in way of auto-reloadingbuilding
- a list of regexes to match against to determine when your process is buildingready
- a list of regexes to match against to determine when your process has built successfully and is readyfailed
- a list of regexes to match against to determine when your process has failed to buildinstall
- a list of commands to run prior to running the parent command, only occurs on the initial run and does not retrigger on subsequent refreshes, usually handles installing dependencies or any other setup, these have the same format and parameters as a top level command
Gotchas
By default, the watch
option will ignore node_modules
directories since including them can cause heavy CPU usage
when starting the watcher. There currently isn't a way to disable this outside of altering the code yourself.
ready
/building
/failed
are always interpreted as regexes. Make sure to include escape characters in them if you
need to.