General Information for CLI

Basic properties of the command line interface for PM.

PM has a collection of command line interfaces (CLI) for performing tasks. For the most part, a given CLI is associated with a class within PM, though there are CLI’s that rely on multiple classes. As outlined below, basic documentation about all commands can be obtained at the command line, and therefore this website only provides individualized attention to selected CLI’s which are nontrivial.

Each CLI starts with the prefix pm-, followed by some descriptive word, such as pm-lattice, pm-crystal, etc. All PM CLI’s can be seen via tab completion

$ pm-<TAB><TAB>
pm-abinitio-output              pm-displaced-crystal            pm-lattice-ftg
pm-cluster                      pm-disp-qrep                    pm-orbit-qrep
pm-convert-id-main-to-dev       pm-file-hive                    pm-phonons-via-irr-derivatives
pm-crystal                      pm-get-variable-doc             pm-point-group-viewer
pm-crystal-format               pm-irr-rep-product              pm-prototype-xtal
pm-crystal-ftg                  pm-irr-rep-symmetric-product    pm-star-rep
pm-crystal-variables            pm-kpoints-fsg                  pm-tensor-irr-rep
pm-crystal-viewer               pm-lattice 

Assuming that the python module argcomplete has been installed and set up, all CLI options can be seen by typing the command name followed by - and pressing tab twice.

$ pm-crystal -<TAB><TAB>
--basis-atoms                --input-files                --shift-atom
--convert-to-supercell       --lattice-vectors            --shift-into-cell
--degub                      --permute-atoms              --shift-origin
-h                           --precision                  --strict-input
--help                       --print-attribute            --use-cartesian-coordinates
-i                           --rotate-lattice-vectors  

For flags that have restricted inputs, tab completion will show valid choices:

$ pm-crystal --print-attribute<TAB><TAB>
atom_names                 lattice_vectors_length     reciprocal_vectors_angle
atoms_cartesian            mass_vector                reciprocal_vectors_length
atoms_species_map          natoms                     reciprocal_volume
basis_atoms                nspecies                   space_dim
center                     positions                  species
lattice_dimension          positions_cartesian        species_names
lattice_vectors            precision                  species_to_elements
lattice_vectors_angle      reciprocal_vectors         volume

Executing -h will print out the command information

$ pm-crystal -h      
usage: pm-crystal [-h] --basis-atoms ATOMS --lattice-vectors VEC [--shift-into-cell]               
                  [--convert-to-supercell S] [--use-cartesian-coordinates] [--permute-atoms X]     
                  [--shift-origin X] [--rotate-lattice-vectors O] [--shift-atom AMP]               
                  [--precision N] [--degub] [--input-files FILE [FILE ...]] [--strict-input]       
                  [--print-attribute ATTR [ATTR ...]]                                              
                                                                                                   
Exposes the Crystal class, allowing the basic properties of a crystal to be constructed.           
                                                                                                   
options:                                                                                           
  -h, --help            show this help message and exit                                            
  --basis-atoms ATOMS   (required) Basis atoms of the crystal structure.                           
  --lattice-vectors VEC                                                                            
                        (required) Lattice vectors in three dimensions, stored in a                
                        matrix \(\hat a\).
  --shift-into-cell     Shift atoms such that they are within the conventional unit cell.

Entering the command without any options will print out the missing required arguments:

$ pm-crystal
User Error: Must provide values for: 

 basis_atoms, lattice_vectors

Input tags can be provided on the command line, or they can be specified in yaml format from standard input or a file via the --input-file or -i tag. Standard input is specified as - and an input file is given by name, such as

$ pm-crystal -i -
$ pm-crystal -i input.yaml

Multiple input files can be specified, and can be mixed with standard input.

$ pm-crystal -i input1.yaml input2.yaml
$ pm-crystal -i - input1.yaml input2.yaml

Last modified October 7, 2025: i (2674345)