Commands
This page will show you all of the available commands and options for the LMK CLI. The primary function of the LMK CLI is to allow you to monitor, notify yourself, and interrupt command-line processes remotely.
Common options
The following common options can be passed with any of the other commands:
Usage: lmk [OPTIONS] COMMAND [ARGS]...
The LMK Command Line Interface. This allows you to monitor command-line
processes remotely via the LMK web app.
Options:
-l, --log-level TEXT Log level, defaults to WARN
-b, --base-path TEXT Path to the LMK configuration directory; defaults to
~/.lmk
Commands
login
Usage: lmk login [OPTIONS]
Authenticate with the LMK API. This should typically be the first command
you run when using the CLI for the first time, and it allows you to use the
other commands.
Options:
-f, --force By default, this will be a no-op if you are already logged in.
Pass --force to force the CLI to re-authenticate with LMK.
-m, --manual Print the authentication URL instead of attempting to open the
page in a web browser.
run
Usage: lmk run [OPTIONS] [COMMAND]...
Run a command line process, and monitor it using LMK. This means that you
will be able to notify yourself when it finishes or finishes with an error,
and interrupt it remotely if you choose.
Options:
--daemon / --no-daemon Daemonize the monitored process. This is the
default, and it means that you can detach
and re-attach to the process while it's
running without interrupting it.
--attach / --no-attach Attach to the process, meaning you will see
the logs from the process appearing in your
console in real time. You can detach at any
time, at which point you can choose to let
the process keep running or interrupt it.
After detaching, you will also be able to
re-attach at any time while the process is
running.
-N, --name TEXT Job name for the job you want to run. This
will be visible in the LMK dashboard, and it
can be passed to other commands that take a
job ID such as `attach`, `kill`, etc. If not
passed, a name will be generated.
-n, --notify [stop|error|none] Set the initial `notify_on` value for the
process. If `stop`, you will get a
notification whenever the process completes
for any reason. If `error`, you will only
get a notification if it exists with a non-
zero status code. If `none`, you will note
be notified at all, but will still be able
to monitor the process of the script via the
LMK web app. This can be changed after
launching the process initially, so if you
omit it initially you can always choose to
notify yourself later.
monitor
Usage: lmk run [OPTIONS] [COMMAND]...
Run a command line process, and monitor it using LMK. This means that you
will be able to notify yourself when it finishes or finishes with an error,
and interrupt it remotely if you choose.
Options:
--daemon / --no-daemon Daemonize the monitored process. This is the
default, and it means that you can detach
and re-attach to the process while it's
running without interrupting it.
--attach / --no-attach Attach to the process, meaning you will see
the logs from the process appearing in your
console in real time. You can detach at any
time, at which point you can choose to let
the process keep running or interrupt it.
After detaching, you will also be able to
re-attach at any time while the process is
running.
-N, --name TEXT Job name for the job you want to run. This
will be visible in the LMK dashboard, and it
can be passed to other commands that take a
job ID such as `attach`, `kill`, etc. If not
passed, a name will be generated.
-n, --notify [stop|error|none] Set the initial `notify_on` value for the
process. If `stop`, you will get a
notification whenever the process completes
for any reason. If `error`, you will only
get a notification if it exists with a non-
zero status code. If `none`, you will note
be notified at all, but will still be able
to monitor the process of the script via the
LMK web app. This can be changed after
launching the process initially, so if you
omit it initially you can always choose to
notify yourself later.
attach
Usage: lmk attach [OPTIONS] JOB_ID
Attach to a monitored job, so you will see the output in your terminal in
real time. You can detach from or interrupt the job while attached.
jobs
Usage: lmk jobs [OPTIONS]
List jobs monitored by LMK
Options:
-a, --all List all jobs; by default only running jobs are shown
kill
Usage: lmk kill [OPTIONS] JOB_ID
Send a signal to a monitored job to interrupt or terminate it.
Options:
-s, --signal TEXT Signal to send, defaults to SIGINT
notify
Usage: lmk notify [OPTIONS] JOB_ID
Change the `notify_on` value for a running job to a new value. This will set
the job to notify you when it's finished running, exits with an error, or
change it to not notify you if it's currently configured to send you a
notification.
Options:
-n, --notify [stop|error|none] Set the initial `notify_on` value for the
process. If `stop`, you will get a
notification whenever the process completes
for any reason. If `error`, you will only
get a notification if it exists with a non-
zero status code. If `none`, you will note
be notified at all, but will still be able
to monitor the process of the script via the
LMK web app. This can be changed after
launching the process initially, so if you
omit it initially you can always choose to
notify yourself later.
shell-plugin
Usage: lmk shell-plugin [OPTIONS]
Install the LMK shell plugin, which allows you to monitor jobs using shell
syntax like %1, %2, etc.
Options:
-i, --install Install the shell CLI script in the shell profile
-u, --uninstall Uninstall the shell CLI script from the shell profile
-p, --print Print the shell plugin script; this is useful if the
automatic installation process via --install is not
working properly.
-s, --shell TEXT Shell flavor that you're using, e.g. bash or zsh. If this
is not passed, the shell you're currently using will be
detected automatically.
check-existing-script-monitoring
Usage: lmk check-existing-script-monitoring [OPTIONS]
Check if monitoring a process after it's already started is supported on
your computer. See the docs for details:
https://docs.lmkapp.dev/docs/cli/running-process.
Options:
logout
Usage: lmk logout [OPTIONS]
Log out of LMK. You will need to log in again to monitor jobs or use LMK in
Jupyter notebooks.
Options:
whoami
Usage: lmk whoami [OPTIONS]
Print information about the current logged in user.
Options: