Edit this page on our live server and create a PR by running command !create-pr in the console panel

List of all sos commands and options

  • Difficulty level: easy
  • Time need to lean: 10 minutes or less
  • Key points:
    • This tutorial lists the command line options of sos command

Command sos

Command sos accepts a number of subcommands (similar to svn, git etc). Its syntax follows

sos subcommand [subcommand-options]

You can use command

In [2]:
usage: sos [-h] [--version]
           {install,run,dryrun,status,execute,kill,purge,config,convert,remove}
           ...

A workflow system for the execution of commands and scripts in different
languages.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

subcommands:
  {install,run,dryrun,status,execute,kill,purge,config,convert,remove}
    run                 Execute default or specified workflow in script
    dryrun              Execute workflow in dryrun mode
    status              Check the status of specified tasks
    remote              Listing and testing remote configurations
    execute             Execute a packages task
    kill                Stop the execution of running task
    purge               Remove local or remote tasks or workflows
    config              Read and write sos configuration files
    convert             Convert between .sos, .ipynb and other formats
    remove              Remove specified files and/or their signatures

Use 'sos cmd -h' for details about each subcommand. Please contact Bo Peng
(bpeng at mdanderson.org) if you have any question.

to get a list of subcommands with brief descriptions and

sos subcommand -h

to get detailed description of a particular subcommand.

Command sos-runner

Command sos-runner is a shortcut for sos run so

% sos-runner script

is equivalent to

% sos run script

This allows a SoS script to be executed directly if it is executable with shebang line

#!/usr/bin/env sos-runner

Workflow Execution

subcommand run

In [2]:
usage: sos run [-h] [-j [WORKERS [WORKERS ...]]] [-J EXTERNAL_JOBS]
               [-c CONFIG_FILE] [-t FILE [FILE ...]] [-q QUEUE [QUEUE ...]]
               [-r HOST [HOST ...]] [-n] [-s SIGMODE] [-T] [-e ERRORMODE]
               [-d [DAG]] [-p [REPORT]] [-v {0,1,2,3,4}]
               SCRIPT [WORKFLOW]

Execute default or specified workflow defined in script

positional arguments:
  SCRIPT                A SoS script that defines one or more workflows, in
                        format .sos or .ipynb. The script can be a filename or
                        a URL from which the content of a SoS will be read. If
                        a valid file cannot be located or downloaded, SoS will
                        search for the script, with specified name, and with
                        added extension .sos and .ipynb, in a search path
                        specified by variable `sos_path` defined in the global
                        SoS configuration file (~/.sos/config.yml).
  WORKFLOW              Name of the workflow to execute. This option can be
                        ignored if the script defines a default workflow (with
                        no name or with name `default`) or defines only a
                        single workflow. A subworkflow or a combined workflow
                        can also be specified, where a subworkflow executes a
                        subset of workflow (`name_steps` where `steps` can be
                        `n` (a step `n`), `:n` (up to step `n`), `n:m` (from
                        step `n` to `m`), and `n:` (from step `n`)), and a
                        combined workflow executes to multiple (sub)workflows
                        combined by `+` (e.g. `A_0+B+C`).

optional arguments:
  -h, --help            show this help message and exit
  -j [WORKERS [WORKERS ...]]
                        Hosts and number of worker processes in each host for
                        the execution of workflow, default to local host with
                        half the number of CPUs, or 8, whichever is smaller.
                        The complete format of this option is "-j host1:n1
                        host2:n2 host3:n3 ..." which are name, ip or alias
                        (defined in sos configurations) of local or remote
                        hosts, and number of processes on each host. If left
                        unspecified, host will be assumed to be the host on
                        which the master SoS process is started, and n is half
                        of the number of CPUs on the host, or 8 if there are
                        more than 16 CPUs. If there are a large number of
                        hosts, the parameters are usually speified through a
                        hostfile with values in each line, and be specified in
                        the format of "-j @hostfile". On a supported cluster
                        system where environmental variables such as
                        "PBS_HOSTFILE" are specified, SoS will ignore this
                        parameter and read worker information from the host
                        file.
  -J EXTERNAL_JOBS      Maximum number of externally running tasks. This
                        option overrides option "max_running_jobs" of a task
                        queue (option -q) so that you can, for example, submit
                        one job at a time (with -J 1) to test the task queue.
  -c CONFIG_FILE        A configuration file in the format of YAML/JSON. The
                        content of the configuration file will be available as
                        a dictionary CONF in the SoS script being executed.
  -t FILE [FILE ...]    One of more files or names of named outputs that will
                        be the target of execution. If specified, SoS will
                        execute only part of a workflow or multiple workflows
                        or auxiliary steps to generate specified targets.
  -q QUEUE [QUEUE ...]  host (server) or job queues to execute all tasks in
                        the workflow. The queue can be name, IP, or an alias
                        defined in SoS configuration files. A host is assumed
                        to be a remote host with process type unless other
                        queue types and related information are defined in the
                        host file. If left unspecified, tasks are executed as
                        part of the regular step processes unless task-
                        specific queues are specified. Optional KEY=VALUE
                        pairs could be specified after queue name and be used
                        to expand task or workflow templates. These options
                        will override task options if the options with the
                        same name is defined.
  -r HOST [HOST ...]    Execute the workflow in specified remote (or local)
                        host, which should be defined under key "hosts" of sos
                        configurations (preferrably in ~/.sos/hosts.yml). This
                        option basically copies the script to specified host
                        and executes it with the "workflow_engine" of the
                        host, which is by default a "process" engine that
                        execute the workflow with an opotional
                        "workflow_template" defined for the host. The
                        "workflow_template" is expanded with "filename" being
                        the path of script, "script" being the content of the
                        script (extracted from notebook if "filename" is a
                        notebook), "command" being the command line to execute
                        the script, as specified from the command line but
                        with options "-r", and "-c" removed, "KEY" being
                        "VALUE" from "KEY=VALUE" pairs defined after the
                        "host" name. For example, "-r cluster cores=4 mem=5G"
                        would expand variables "cores" and "mem" in the
                        template with values "4" and "5G".

Run mode options:
  Control how sos scirpt is executed.

  -n                    Execute a workflow in dryrun mode. Please check
                        command sos dryrun for details of the dryrun mode.
  -s SIGMODE            How runtime signature would be handled, which can be
                        "default" (save and use signature, default mode in
                        batch mode), "ignore" (ignore runtime signature,
                        default mode in interactive mode), "force" (ignore
                        existing signature and overwrite them while executing
                        the workflow), "build" (build new or overwrite
                        existing signature from existing environment and
                        output files), and "assert" for validating existing
                        files against their signatures. "skip" and
                        "distributed" are two experimental modes with "skip"
                        for bypassing substep as long as step output exists
                        and later than input files and "distributed" for
                        sending tasks to subworkers for signature validation.
                        Please refer to online documentation for details about
                        the use of runtime signatures.
  -T                    Trace existing targets and re-execute the steps that
                        generate them to make sure that the targets are
                        current.
  -e ERRORMODE          How to handle failures from steps and substeps. By
                        default, after an error happens and stops the
                        execution of a step, SoS will exit after it executes
                        the rest of the DAG until all unaffected steps are
                        executede. You can specify "-e abort" if you would
                        like SoS to stop as soon as any error is detected, or
                        "-e ignore" to ignore the error and continue to
                        execute the workflow as best as it can.

Output options:
  Output of workflow

  -d [DAG]              Output Direct Acyclic Graph (DAGs) in graphiviz .dot
                        format. Because DAG and status of nodes will change
                        during the execution of workflow, multiple DAGs will
                        be written to the specified file with names
                        {workflow}_1, {workflow}_2 etc. The dot file would be
                        named {script_name}_{timestamp}.dot unless a separate
                        filename is specified.
  -p [REPORT]           Output a report that summarizes the execution of the
                        workflow after the completion of the execution. This
                        includes command line, steps executed, tasks executed,
                        CPU/memory of tasks, and DAG if option -d is also
                        specified. The report will by be named
                        {script_name}_{timestamp}.html unless a separate
                        filename is specified.
  -v {0,1,2,3,4}        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information

Arbitrary parameters defined by the [parameters] step of the script, and
[parameters] steps of other scripts if nested workflows are defined in other
SoS files (option `source`). The name, default and type of the parameters are
specified in the script. Single value parameters should be passed using option
`--name value` and multi-value parameters should be passed using option
`--name value1 value2`.

Please refer to section SoS Syntax of the documentation for details about this command.

subcommand dryrun

This command execute the script in dryrun mode. It is alias to command sos run -n.

In [3]:
usage: sos dryrun [-h] [-c CONFIG_FILE] [-t FILES [FILES ...]] [-q QUEUE] [-T]
                  [-d [DAG]] [-p [REPORT]] [-v {0,1,2,3,4}]
                  SCRIPT [WORKFLOW]

Execute workflow in dryrun mode. This mode is identical to run mode except
that 1). Actions might behavior differently. In particular, script-running
steps would print instead of execute script. 2). Steps will generate empty
output files if specified output do not exist after execution. 3). Signature
mode is set to ignore. 4). Option -q is ignored so all tasks are executed
locally. 5). Tasks are generated but not executed.

positional arguments:
  SCRIPT                A SoS script that defines one or more workflows, in
                        format .sos or .ipynb. The script can be a filename or
                        a URL from which the content of a SoS will be read. If
                        a valid file cannot be located or downloaded, SoS will
                        search for the script, with specified name, and with
                        added extension .sos and .ipynb, in a search path
                        specified by variable `sos_path` defined in the global
                        SoS configuration file (~/.sos/config.yml).
  WORKFLOW              Name of the workflow to execute. This option can be
                        ignored if the script defines a default workflow (with
                        no name or with name `default`) or defines only a
                        single workflow. A subworkflow or a combined workflow
                        can also be specified, where a subworkflow executes a
                        subset of workflow (`name_steps` where `steps` can be
                        `n` (a step `n`), `:n` (up to step `n`), `n:m` (from
                        step `n` to `m`), and `n:` (from step `n`)), and a
                        combined workflow executes to multiple (sub)workflows
                        combined by `+` (e.g. `A_0+B+C`).

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE        A configuration file in the format of YAML/JSON. The
                        content of the configuration file will be available as
                        a dictionary CONF in the SoS script being executed.
  -t FILES [FILES ...]  One of more files or alias of other targets that will
                        be the target of execution. If specified, SoS will
                        execute only part of a workflow or multiple workflows
                        or auxiliary steps to generate specified targets.
  -q QUEUE              host (server) or job queues to execute all tasks in
                        the workflow. The queue can be defined in global or
                        local sos configuration file, or a file specified by
                        option --config. A host is assumed to be a remote
                        machine with process type if no configuration is
                        found.

Run mode options:
  Control how sos scirpt is executed.

  -T                    Trace existing targets and re-execute the steps that
                        generate them to make sure that the targets are
                        current.

Output options:
  Output of workflow

  -d [DAG]              Output Direct Acyclic Graph (DAGs) in graphiviz .dot
                        format. An exntesion of ".dot" would be added
                        automatically. Because DAG could change during the
                        execution of workflow, multiple DAGs could be outputed
                        with names $FILE_1.dot, $FILE_2.dot. If this option is
                        specified without a name, the DAG would be wrritten to
                        the standard output.
  -p [REPORT]           Output a report that summarizes the execution of the
                        workflow after the completion of the execution. This
                        includes command line, steps executed, tasks executed,
                        CPU/memory of tasks, and DAG if option -d is also
                        specified. The report will by be named
                        {script_name}_{timestamp}.html unless a separate
                        filename is specified.
  -v {0,1,2,3,4}        Output error (0), warning (1), info (2), debug (3) and
                        trace (4) information to standard output (default to
                        2).

Arbitrary parameters defined by the [parameters] step of the script, and
[parameters] steps of other scripts if nested workflows are defined in other
SoS files (option `source`). The name, default and type of the parameters are
specified in the script. Single value parameters should be passed using option
`--name value` and multi-value parameters should be passed using option
`--name value1 value2`.

Please refer to the tutorial on SoS Workflow for details about this command.

Task Management

subcommand remote

In [4]:
usage: sos remote [-h] [-c CONFIG] [-p PASSWORD] [--files [FILES [FILES ...]]]
                  [--cmd ...] [-v {0,1,2,3,4}]
                  {list,status,setup,test,login,push,pull,run}
                  [hosts [hosts ...]]

Listing and testing remote configurations

positional arguments:
  {list,status,setup,test,login,push,pull,run}
                        List (list), check status of tasks (status), setup
                        public-key authentication (setup), test configuration
                        (test), login (login), push files to one or more
                        remote hosts (push), pull files from a remote host, or
                        execute command (run) on one or all or specified
                        remote hosts
  hosts                 Hosts to be checked or tested. All hosts defined in
                        SoS configurations will be included if unspecified. As
                        a special case for "sos remote setup", an address is
                        acceptable even if it is defined in configuration
                        file.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        A configuration file with host definitions, in case
                        the definitions are not defined in global sos
                        config.yml files.
  -p PASSWORD, --password PASSWORD
                        Password used to copy public key to remote hosts. You
                        will be prompted for a password if a password is
                        needed and is not passed from command line. The same
                        password will be used for all specified hosts so you
                        will need to use separate setup commands for hosts
                        with different passwords.
  --files [FILES [FILES ...]]
                        files or directories to be push or pulled for action
                        "push" or "pull"
  --cmd ...             commands to be executed by action "run" or tested by
                        action "test". This option takes all remaining options
                        of part of command and must be the last option of the
                        sos remote command.
  -v {0,1,2,3,4}, --verbosity {0,1,2,3,4}
                        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information

subcommand execute

In [5]:
usage: sos execute [-h] [-s SIGMODE] [-v {0,1,2,3,4}] [-e EXECUTOR]
                   [-m RUN_MODE] [-q QUEUE] [-c CONFIG] [-w]
                   tasks [tasks ...]

Execute a packages task

positional arguments:
  tasks                 IDs of the task.

optional arguments:
  -h, --help            show this help message and exit
  -s SIGMODE            How runtime signature would be handled, which can be
                        "default" (save and use signature, default mode in
                        batch mode), "force" (ignore existing signature and
                        overwrite them while executing the workflow), "build"
                        (build new or overwrite existing signature from
                        existing environment and output files), and "assert"
                        for validating existing files against their
                        signatures. "skip" and "distributed" are two
                        experimental modes with "skip" for bypassing substep
                        as long as step output exists and later than input
                        files and "distributed" for sending tasks to
                        subworkers for signature validation. Tasks will always
                        save sigatures. For compatibility reasons, "ignore"
                        mode is accepted but is treated the same as "default".
                        Please refer to online documentation for details about
                        the use of runtime signatures.
  -v {0,1,2,3,4}        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information
  -e EXECUTOR, --executor EXECUTOR
                        Executor used to execute the task, which should be an
                        entry point under section sos_taskexecutors that
                        points to a class with at least a execute member
                        function.
  -m RUN_MODE, --mode RUN_MODE
                        Run mode of the task, default to 'run', but can be
                        'dryrun' (the same as --dryrun) or 'interactive",
                        which suppress status update.
  -q QUEUE, --queue QUEUE
                        Check the status of job on specified tasks queue or
                        remote host if the tasks . The queue can be defined in
                        global or local sos configuration file, or a file
                        specified by option --config. A host is assumed to be
                        a remote machine with process type if no configuration
                        is found.
  -c CONFIG, --config CONFIG
                        A configuration file with host definitions, in case
                        the definitions are not defined in global sos
                        config.yml files.
  -w, --wait            Wait for the completion of the task, and retrieve job
                        results if needed after the completion of the task.
                        This option is only valid with the specification of
                        the -q option.

subcommand status

In [6]:
usage: sos status [-h] [-q QUEUE] [-c CONFIG] [-v {0,1,2,3,4}]
                  [-t [TAGS [TAGS ...]]] [-s [STATUS [STATUS ...]]]
                  [--age AGE] [--html]
                  [tasks [tasks ...]]

Check the status of specified tasks

positional arguments:
  tasks                 ID of the task. All tasks that are releted to the
                        workflow executed under the current directory will be
                        checked if unspecified. There is no need to specify
                        compelete task IDs because SoS will match specified
                        name with tasks starting with these names.

optional arguments:
  -h, --help            show this help message and exit
  -q QUEUE, --queue QUEUE
                        Check the status of job on specified tasks queue or
                        remote host if the tasks . The queue can be defined in
                        global or local sos configuration file, or a file
                        specified by option --config. A host is assumed to be
                        a remote machine with process type if no configuration
                        is found.
  -c CONFIG, --config CONFIG
                        A configuration file with host definitions, in case
                        the definitions are not defined in global sos
                        config.yml files.
  -v {0,1,2,3,4}        Output error (0), warning (1), info (2), debug (3) and
                        trace (4) information to standard output (default to
                        2).
  -t [TAGS [TAGS ...]], --tags [TAGS [TAGS ...]]
                        Only list tasks with one of the specified tags.
  -s [STATUS [STATUS ...]], --status [STATUS [STATUS ...]]
                        Display tasks with one of the specified status.
  --age AGE             Limit to tasks that are created more than (default) or
                        within specified age. Value of this parameter can be
                        in units s (second), m (minute), h (hour), or d (day,
                        default), or in the foramt of HH:MM:SS, with optional
                        prefix + for older (default) and - for newer than
                        specified age.
  --html                Output results in HTML format. This option will
                        override option verbosity and output detailed status
                        information in HTML tables and figures.

subcommand kill

In [7]:
usage: sos kill [-h] [-a] [-q QUEUE] [-t [TAGS [TAGS ...]]] [-c CONFIG]
                [-v {0,1,2,3,4}]
                [tasks [tasks ...]]

Stop the execution of running task

positional arguments:
  tasks                 IDs of the tasks that will be killed. There is no need
                        to specify compelete task IDs because SoS will match
                        specified name with tasks starting with these names.

optional arguments:
  -h, --help            show this help message and exit
  -a, --all             Kill all tasks in local or specified remote task queue
  -q QUEUE, --queue QUEUE
                        Kill jobs on specified tasks queue or remote host if
                        the tasks . The queue can be defined in global or
                        local sos configuration file, or a file specified by
                        option --config. A host is assumed to be a remote
                        machine with process type if no configuration is
                        found.
  -t [TAGS [TAGS ...]], --tags [TAGS [TAGS ...]]
                        Only kill tasks with one of the specified tags.
  -c CONFIG, --config CONFIG
                        A configuration file with host definitions, in case
                        the definitions are not defined in global sos
                        config.yml files.
  -v {0,1,2,3,4}, --verbosity {0,1,2,3,4}
                        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information

subcommand purge

In [8]:
usage: sos purge [-h] [-a | --age AGE | -s STATUS [STATUS ...] | -t
                 [TAGS [TAGS ...]]] [-q QUEUE] [-c CONFIG] [-v {0,1,2,3,4}]
                 [tasks [tasks ...]]

Remove local or remote tasks

positional arguments:
  tasks                 ID of the tasks to be removed. There is no need to
                        specify compelete task IDs because SoS will match
                        specified name with tasks starting with these names.
                        If no task ID is specified, all tasks related to
                        specified workflows (option -w) will be removed.

optional arguments:
  -h, --help            show this help message and exit
  -a, --all             Clear all task information on local or specified
                        remote task queue, including tasks created by other
                        workflows.
  --age AGE             Remova all tasks that are created more than (default)
                        or within specified age. Value of this parameter can
                        be in units s (second), m (minute), h (hour), or d
                        (day, default), or in the foramt of HH:MM:SS, with
                        optional prefix + for older (default) and - for newer
                        than specified age.
  -s STATUS [STATUS ...], --status STATUS [STATUS ...]
                        Remove all tasks with specified status, which can be
                        pending, submitted, running, completed, failed, and
                        aborted. One of more status can be specified.
  -t [TAGS [TAGS ...]], --tags [TAGS [TAGS ...]]
                        Remove all tasks that matches one or more specified
                        tags.
  -q QUEUE, --queue QUEUE
                        Remove tasks on specified tasks queue or remote host
                        if the tasks . The queue can be defined in global or
                        local sos configuration file, or a file specified by
                        option --config. A host is assumed to be a remote
                        machine with process type if no configuration is
                        found.
  -c CONFIG, --config CONFIG
                        A configuration file with host definitions, in case
                        the definitions are not defined in global sos
                        config.yml files.
  -v {0,1,2,3,4}        Output error (0), warning (1), info (2), debug (3) and
                        trace (4) information to standard output (default to
                        2).

Project Management

subcommand convert

In [9]:
usage: sos convert [-h] [-v {0,1,2,3,4}]
                   {sos-ipynb,ipynb-sos,ipynb-html,ipynb-pdf,ipynb-md,ipynb-ipynb,rmd-ipynb,rmd-html,sos-html}
                   ...

Converts .sos to various formats including .html for web display, to jupyter
notebook (.ipynb), and to terminal for syntax highlighted viewing on terminal.
It also allows converting from jupyter notebook (.ipynb) to sos script (.sos).

optional arguments:
  -h, --help            show this help message and exit
  -v {0,1,2,3,4}, --verbosity {0,1,2,3,4}
                        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information

converters (name of converter is not needed from command line):
  {sos-ipynb,ipynb-sos,ipynb-html,ipynb-pdf,ipynb-md,ipynb-ipynb,rmd-ipynb,rmd-html,sos-html}
    sos-ipynb           Convert a sos script to Jupyter notebook (.ipynb) so
                        that it can be opened by Jupyter notebook.
    ipynb-sos           Export Jupyter notebook with a SoS kernel to a .sos
                        file. The cells are presented in the .sos file as cell
                        structure lines, which will be ignored if executed in
                        batch mode
    ipynb-html          Export Jupyter notebook with a SoS kernel to a .html
                        file. Additional command line arguments are passed
                        directly to command "jupyter nbconvert --to html" so
                        please refer to nbconvert manual for available
                        options.
    ipynb-pdf           Export Jupyter notebook with a SoS kernel to a .pdf
                        file. Additional command line arguments are passed
                        directly to command "jupyter nbconvert --to pdf" so
                        please refer to nbconvert manual for available
                        options.
    ipynb-md            Export Jupyter notebook with a SoS kernel to a
                        markdown file. Additional command line arguments are
                        passed directly to command "jupyter nbconvert --to
                        markdown" so please refer to nbconvert manual for
                        available options.
    ipynb-ipynb         Export a Jupyter notebook with a non-SoS kernel to a
                        SoS notebook with SoS kernel, or from a SoS notebook
                        to a regular notebook with specified kernel, or
                        execute a SoS notebook.
    rmd-ipynb           Export a Rmarkdown file kernel to a SoS notebook. It
                        currently only handles code block and Markdown, and
                        not inline expression.
    rmd-html            Export a Rmarkdown file kernel to a SoS report. It
                        currently only handles code block and Markdown, and
                        not inline expression.
    sos-html            Convert sos file to html format with syntax
                        highlighting, and save the output either to a HTML
                        file or view it in a broaser.

Extra command line argument could be specified to customize the style of html,
markdown, and terminal output.

Please refer to the File Conversion tutorial for more details about this command.

subcommand config

In [10]:
usage: sos config [-h] [-s | --hosts | -c CONFIG_FILE]
                  [--get [OPTION [OPTION ...]] | --unset OPTION [OPTION ...] |
                  --set KEY VALUE [KEY VALUE ...]] [-v {0,1,2,3,4}]

Displays configurations in host, global, local, and user specified
configuration files.

optional arguments:
  -h, --help            show this help message and exit
  -s, --site            Set (--set) or unset (--unset) options in system site
                        configuration file (${SOS}/site_config.yml).
  --hosts               Set (--set) or unset (--unset) options in hosts
                        (~/.sos/hosts.yml)
  -c CONFIG_FILE, --config CONFIG_FILE
                        Set (--set) or unset (--unset) options in user
                        specified configuration file, or display options
                        (--get) also in this file.
  --get [OPTION [OPTION ...]]
                        Display values of options that contain one of the
                        specified words from all configuration files.
  --unset OPTION [OPTION ...]
                        Unset (remove) settings for specified options. The
                        arguments of this option can be a single configuration
                        option or a list of option. Wildcard characters are
                        allowed to match more options (e.g. '*timeout', or '*'
                        for all options, quotation is needed to avoid shell
                        expansion).
  --set KEY VALUE [KEY VALUE ...]
                        --set KEY VALUE sets VALUE to variable KEY. The value
                        can be any valid python expression (e.g. 5 for integer
                        5 and '{"c": 2, "d": 1}' for a dictionary) with
                        invalid expression (e.g. val without quote) considered
                        as string. Syntax 'A.B=v' can be used to add {'B': v}
                        to dictionary 'A', and --set KEY VALUE1 VALUE2 ...
                        will create a list with multiple values.
  -v {0,1,2,3,4}, --verbosity {0,1,2,3,4}
                        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information

Please refer to section SoS Syntax for details about this command.

subcommand remove

In [11]:
usage: sos remove [-h] [-t | -u | -s | -z | -p] [-e] [--size SIZE] [--age AGE]
                  [-n] [-y] [-v {0,1,2,3,4}]
                  [FILE_OR_DIR [FILE_OR_DIR ...]]

Remove specified files and/or their signatures

positional arguments:
  FILE_OR_DIR           Files and directories to be removed. Directories will
                        be scanned for files to removed but no directory will
                        be removed.

optional arguments:
  -h, --help            show this help message and exit
  -t, --tracked         Limit files to only files tracked by SoS, namely files
                        that are input, output, or dependent files of steps.
  -u, --untracked       Limit files to untracked files, namely files that are
                        not tracked by SoS steps.
  -s, --signature       Remove signatures of specified files (not files
                        themselves). As a special case, all local signatures
                        will be removed if this option is specified without
                        target.
  -z, --zap             Replace files with their signatures. The file will not
                        be regenerated by SoS unless is it actually needed by
                        other steps. This option is usually used to remove
                        large intermediate files from completed workflows
                        while allowing relevant steps to be skipped during re-
                        execution of the workflow.
  -p, --placeholders    Remove placeholder files that might have been left
                        uncleaned after an interrupted dryrun.
  -e, --external        By default the remove command will only remove files
                        and signatures under the current project directory.
                        This option allows sos to remove files and/or
                        signature of external files.
  --size SIZE           Limit to files that exceed or smaller than specified
                        size. Value of option should be in unit K, M, KB, MB,
                        MiB, GB, etc, with optional prefix + for larger than
                        (default), or - for smaller than specified size.
  --age AGE             Limit to files that are modified more than (default)
                        or within specified age. Value of this parameter can
                        be in units s (second), m (minute), h (hour), or d
                        (day, default), or in the foramt of HH:MM:SS, with
                        optional prefix + for older (default) and - for newer
                        than specified age.
  -n, --dryrun          List files or directories to be removed, without
                        actually removing them.
  -y, --yes             Remove files without confirmation, suitable for batch
                        removal of files.
  -v {0,1,2,3,4}, --verbosity {0,1,2,3,4}
                        Output error (0), warning (1), info (2) and debug (3)
                        information to standard output (default to 2). More
                        debug information could be generated by setting
                        environmental variable SOS_DEBUG to comma separated
                        topics of GENERAL, WORKER, CONTROLLER, STEP, VARIABLE,
                        EXECUTOR, TARGET, ZERONQ, TASK, DAG, and ACTION, or
                        ALL for all debug information

Please refer to the tutorial on Project Management for details about this command.