Skip to content

TethysL CLI

The TethysL Command-Line Interface (CLI) is the core program that supports all major operations on TethysL script files, including: full validation, translation to XML, TethysL source reformatting, and markdown page generation. It also features an LSP Language Server, which supports smart editing capabilities for LSP enabled editors.

The TethysL CLI program is available from the Install page.

Usage

The general usage of the program is displayed with the --help option:

tethysl --help
TethysL System <version>

TethysL CLI

Usage: tethysl [OPTIONS] [COMMAND]

Commands:
  compile              Compile TethysL sources
  lint                 Lint TethysL sources
  prettify             Prettify TethysL sources
  markdown             Generate markdown from mission scripts and other LRAUV resources
  parse-lrauv-info     Extract base information from lrauv-application files
  download-lrauv-info  Download published lrauv-application base information
  lsp-server           Run TethysL LSP server (only for LSP clients)
  help                 Print this message or the help of the given subcommand(s)

Options:
      --log <level>  Minimum logging level (default, info; for lsp-server, debug)
  -v, --version      Show version of this program
  -h, --help         Print help

For more details and all other tricks, consult the documentation.

The CLI program comprises a number of subcommands, which are described below. You can use --help after a subcommand to get more details about the particular subcommand.

LRAUV Application Resources

A representation of key LRAUV application resources are used by the TethysL CLI program to support its functionality, in particular, to properly validate mission scripts. These resources include all LRAUV behaviors and their settings, units of measure, universals, and several XML Schema files.

For convenience, a version of such representation is embedded in the TethysL CLI program itself. The embedded resources (which are captured at time of creating the TethysL distribution) are mainly intended to facilitate the use of the tool even when a local LRAUV application codebase is not available on the system.

On the other hand, if the LRAUV application codebase is available on the system, the CLI can be instructed to use it to fetch the necessary information instead of using the embedded resources. There are two possible ways to indicate this location:

  • Via option --lrauv, which is accepted by each of the relevant subcommands
  • Via environment variable LRAUV_APP_DIR

Subcommands

compile

This subcommand performs full validation of given TethysL script files.

As an example, the following command:

tethysl compile Missions/_examples/WithInsertExample.tl

will compile the indicated script and generate the corresponding XML file Missions/_examples/WithInsertExample.tx if the script is successfully validated.

Note

  • The .tx file extension has been designated to denote a "TethysL compiled XML version." These .tx mission files will be recognized and handled appropriately by the LRAUV application for purposes of parsing and execution.
  • In the DashUI, for a selected TethysL mission, operators may only note .tl as file extension (instead of .xml) in the script filename, but all related functionality will remain the same as with any XML mission. Internally, at time of mission loading and execution, the LRAUV will process the corresponding .tx file that has been generated as part of vehicle deployment preparations.

Run tethysl compile --help for more details.

lint

This command performs a basic linting of the given script files, and reports any issues or associated suggestions. Checks initially implemented include:

  • ID of mission or aggregate to be consistent with filename
  • Arguments/output for possible use of array syntax
  • Embedded aggregates for possible use of macro syntax
  • Recursively, the above checks for each embedded aggregate.

You can indicate individual files, or use the --all and --mission-dir options to lint all files under a given directory (except those with path containing "Deprecated" or "RegressionTest").

Run tethysl lint --help for more details.

prettify

This subcommand re-formats the given set of TethysL script files.

Run tethysl prettify --help for more details.

markdown

This subcommand generates markdown files of various kinds, including mission pages from a given set of TethysL script files, as well pages for all behaviors, units, and universals, with corresponding information extracted from relevant lrauv-application resources.

Run tethysl markdown --help for more details.

parse-lrauv-info

Instead of using the embedded LRAUV resources for the relevant commands, when a local copy of the lrauv-application codebase is available, this subcommand allows parsing and capturing all needed information in a way that can be reused more efficiently in subsequent uses of the CLI.

Use the --dest option to indicate a directory under which the information will be saved.

Commands accepting the --lrauv option will also accept, alternatively, --lrauv-info to indicate the directory where the information has been captured by parse-lrauv-info.

Run tethysl parse-lrauv-info --help for more details.

lsp-server

Only to be invoked automatically by LSP client tools (e.g., VS Code), the lsp-server subcommand launches the TethysL LSP server, which supports smart editing features. See the VS Code section.

lrauv-info

Note: Command removed in version 5.0.0

This subcommand shows the information that has been extracted from LRAUV application resources,

xml2tethysl

Note: Command removed in version 5.0.0

This subcommand translates XML mission files into corresponding TethysL files.

Note

Although pretty functional and useful in general, the implementation of this subcommand has mainly been intended to facilitate the TethysL development itself, as well as facilitate the migration of traditional missions from XML to TethysL.