===
CLI
===

``oi-tools`` ships a command-line interface accessible as ``oi``.

.. code-block:: bash

   oi --help

PBS commands
------------

``oi sub`` — Submit a job
~~~~~~~~~~~~~~~~~~~~~~~~~

Submit a script or module as a PBS job. This is a thin CLI wrapper around
:func:`oi_tools.pbs.submit_job` — see that function for the full list of options,
or run ``oi sub --help``.

.. code-block:: bash

   # submit a Python script with a year argument
   oi sub --mem 16G --cpus 8 code/myscript.py 2001

   # submit a Stata do-file
   oi sub code/myscript.do 2001

``oi list`` — List jobs
~~~~~~~~~~~~~~~~~~~~~~~

Display active and queued PBS jobs in a formatted table. This is a thin CLI
wrapper around :func:`oi_tools.pbs.list_jobs` — see that function for the full
list of options, or run ``oi list --help``.

.. code-block:: bash

   # show your own jobs (default)
   oi list

   # show all users' jobs
   oi list --users all

   # show completed jobs too, up to 50
   oi list --completed --limit 50

Other commands
--------------

``oi docs`` — Serve documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Build and serve the HTML documentation locally.

.. code-block:: bash

   oi docs [--host HOST] [--port PORT] [--build]

Pass ``--build`` to rebuild the docs before serving.
