Command line interface

Overview of command line scripts in PM for developers.

All command line script for PM are stored in the cli module, end with the suffix _cli, and are contained within a function main(). In order to register a new cli, the script must be added to the setup.cfg file. Consider the example of the script irr_rep_prod_cli.py, we would add one entry to the console_scripts as

# setup.cfg file
console_scripts =
  pm-lid = principia_materia.cli.lid_cli:main
  ...
  pm-irr-rep-prod = principia_materia.cli.irr_rep_prod_cli:main

This is cumbersome, so we have a script to automatically regenerate this file:

python get_setup_cfg.py

After regenerating the file, you must run python setup.py install or develop to make the changes take effect. You also may need to restart your virtual environment.


Last modified October 10, 2024: clarified the cli module doc (423d332)