Using the CLI¶
The oi-tools package ships a command line app for submitting and monitoring PBS jobs and viewing the package documentation while offline.
The documentation for each command is given below.
Command line app for the oi-tools package.
oi docs¶
oi docs [OPTIONS]
Serve the oi-tools HTML documentation.
Parameters:
--build, --no-buildRebuild the documentation before serving. [Default:
False]--serve, --no-serveServe the documentation on
host:port. [Default:True]--hostHostname to serve on. [Default:
0.0.0.0]--portPort to serve on. [Default:
8000]--open, --no-openOpen the documentation in the default browser. Requires
serve. [Default:True]
oi sub¶
oi sub [OPTIONS] FILE [ARGS]
Submit a single script or module as a PBS job.
Logs are written to <log_folder>/<base_job_name>/<args>/, with one
file per submission named by today’s date and an incrementing counter
(e.g. logs/myscript/2001/2026-01-15-1.log).
If filetype is omitted, the filetype is inferred from the file
suffix (e.g. .py → python_script, .do → stata_script).
If the suffix is unrecognized, this function will falls back to "python_module".
Parameters:
FILE, --filePath to the script or python module. [Required]
ARGS, --args, --empty-argsCommand-line arguments to pass to the script or module. [Default:
[]]--memMemory to request. Can be an integer (treated as gigabytes) or a string such as
"16G". The default value is configurable via theOI_TOOLS_PBS_DEFAULT_MEMenvironment variable. [Default:8G]--cpusNumber of CPU cores to request. The default value is configurable via the
OI_TOOLS_PBS_DEFAULT_CPUSenvironment variable. [Default:4]--wait, --no-waitWhether to wait for the job to finish before returning (
True) or immediately return (False). [Default:False]--log-folderDirectory in which to create log files. Set to
Noneto discard output. The default value is configurable via theOI_TOOLS_PBS_LOG_FOLDERenvironment variable. [Default:logs]--verbose, --no-verbosePrint job details and the generated PBS script before submitting. [Default:
True]--filetypeExplicitly set the script type. [Choices:
python_script,python_module,stata_script,r_script,sas_script]--base-job-nameBase name used for the PBS job and the log subdirectory. Defaults to the script path with the suffix removed and non-alphanumeric characters replaced by hyphens (e.g.
"code/myscript.py"→"code-myscript").--python-executablePath to the Python interpreter to use for Python jobs. Defaults to whatever version of Python is used to submit the job (
sys.executable).--cwdWorking directory for the job. Defaults to the current directory at submission time.
--env-varsOptional dictionary of environment variables to export in the job script (e.g.
{"MY_VAR": "value"}).
oi list¶
oi list [OPTIONS] [ARGS...]
Print PBS jobs in a formatted table.
Arguments:
USERSUsernames indicating whose jobs to show. If omitted, shows only the current user’s jobs.
Parameters:
--all, --no-allShow everyone’s jobs. [Default:
False]--limitMaximum number of jobs to display. [Default:
20]--completed, --no-completedInclude completed jobs. [Default:
False]--sortWhat to sort by. [Choices:
user,mem,cpus, Default:user]