Commands
All commands are run through the dev-pm binary. The examples below assume the
recommended alias dpm (see Getting Started); you can also use
npx dev-pm directly.
Targeting processes
Most commands accept a [patterns...] argument that selects which processes to act on.
A pattern can be:
| Pattern | Matches |
|---|---|
name | A process by its name. |
alias | A process by one of its alias values. |
@group | Every process in the named group. |
id | A process by its numeric daemon-assigned id. |
all | Every configured process. |
| (omitted) | Every process (same as all). |
You can pass multiple patterns, separated by spaces or commas:
dpm start api worker
dpm logs api,worker
start
Start one or all processes.
dpm start [options] [patterns...]
Options
--follow— follow logs after starting. The started process will not be stopped when you stop thisstartcommand (Ctrl-C only detaches from the logs).
dpm start all
dpm start api --follow
dpm start @frontend
stop
Stop running processes.
dpm stop [patterns...]
dpm stop api
dpm stop @backend
dpm stop all
restart
Restart previously started processes.
dpm restart [options] [patterns...]
Options
--follow— follow logs after restarting (seestart).
dpm restart api
dpm restart @frontend --follow
status
List running processes and their state. Aliases: list, ls, st.
dpm status [options] [patterns...]
Options
-i, --interval [seconds]— keep the status view open and refresh it periodically at the given interval (defaults to1second when the flag is given without a value).
dpm status
dpm status --interval # refresh every second
dpm status -i 5 # refresh every 5 seconds
Each process reports one of the following statuses: started, stopping, stopped,
waiting (blocked on a waitOn resource) or backoff
(waiting between automatic restart attempts after a crash).
logs
Print logs of a specific process or of all running processes in real time. Alias:
log.
dpm logs [options] [patterns...]
Options
-n, --lines <number>— print the last n log lines and exit instead of streaming.
dpm logs # stream logs of all running processes
dpm logs api # stream logs of a single process
dpm logs api -n 50 # print the last 50 lines and exit
shutdown
Stop all running processes and shut down the dev-pm daemon. Alias: halt.
dpm shutdown
start-daemon
Start the dev-pm daemon. This is normally done automatically by other commands, so you rarely need to call it directly.
dpm start-daemon
--version
Print the installed version.
dpm --version