Command line¶
The molq CLI submits jobs, reads the same SQLite records as the Python API,
and offers terminal-oriented inspection and monitoring.
The two identifiers you must keep consistent¶
Most commands accept both:
- a scheduler positional argument:
local,slurm,pbs, orlsf; --cluster, the namespace used to store and retrieve records.
If --cluster names a Host entry declared in ~/.ssh/config, molq uses it
as an SSH destination when no profile is active. Any other name — including
the default cli_<scheduler> namespace — is a local destination and a pure
record namespace.
Why the alias must be declared
molq checks the Host blocks in your SSH config rather than asking
ssh -G, because ssh -G prints a resolved configuration for any
string you hand it and so can never distinguish a real destination from a
typo.
Use the same namespace later
A job submitted with --cluster dardel will not appear under the default
cli_slurm namespace.
Submit¶
Local:
SLURM:
molq submit slurm \
--cluster dardel \
--cpus 8 \
--mem 32G \
--time 4h \
--gpus 1 \
--partition gpu \
--account project123 \
python train.py
Wait before returning:
Retry at most twice after the first attempt:
Dependencies accept molq job IDs:
Repeat --after-success, --after-failure, --after-started, or --after
to supply several upstream jobs.
Inspect and control¶
| Command | Purpose |
|---|---|
list |
Active records; add --all for terminal jobs |
status |
Refresh and print one job |
inspect |
Metadata, attempts, dependencies, and transition timeline |
watch |
Wait for one job; add --all for every active job |
cancel |
Cancel the latest active attempt |
logs |
Read local stdout or stderr |
history |
Show persisted history |
cleanup |
Apply retention policy |
Examples:
molq list slurm --cluster dardel --all
molq status JOB_ID slurm --cluster dardel
molq inspect JOB_ID slurm --cluster dardel
molq watch JOB_ID slurm --cluster dardel --timeout 3600
molq cancel JOB_ID slurm --cluster dardel
Read logs¶
For local jobs:
molq logs JOB_ID local --cluster laptop
molq logs JOB_ID local --cluster laptop --stream stderr --tail 100
molq logs JOB_ID local --cluster laptop --follow
The current CLI reads recorded paths from the local filesystem. For an SSH
destination, use Submitor.fetch_logs() to transfer them first:
Watch and monitor¶
Wait for every active local job in a namespace:
Open the cross-namespace dashboard:
Run background reconciliation:
When the config has no [plugins] table, daemon enables the official Nerve
status plugin. See Plugins and Nerve.
Discover destinations¶
List profile destinations and concrete SSH aliases:
SSH aliases are resolved with ssh -G, so the display reflects effective
OpenSSH settings.
Sync remote files¶
molq workspace sync ./src \
--cluster dardel \
--path /remote/project/src
molq workspace sync ./results \
--pull \
--cluster dardel \
--path /remote/project/results
molq workspace list \
--cluster dardel \
--path /remote/project
See Remote files for the corresponding Python API.
Use a profile¶
Profiles provide scheduler options, defaults, retry, retention, and job
directory settings. The top-level plugins mapping applies to CLI sessions
separately.
The default config file is:
Profiles currently do not encode SSH transport settings. For remote CLI
submission without a profile, use an SSH alias with --cluster. In Python,
combine a profile with an explicit remote target:
cluster = mq.Cluster("dardel", "slurm", host="dardel")
queue = mq.Submitor.from_profile("gpu", target=cluster)
See Configuration for the complete config shape and precedence rules.
List plugins¶
The command shows official and third-party plugins and whether the current config enables them.
Command map¶
Jobs submit list status inspect watch cancel logs
History history cleanup
Live monitor daemon
Setup clusters list|show workspace sync|list plugins list
Use molq COMMAND --help as the authoritative option list for the installed
version.