Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command Line Interface

The core features of the SpecForge tool can be accessed via the command line interface (CLI).

Running the SpecForge CLI without any additional arguments will display a list of available commands. Here is a brief overview of the commands.

  • serve: Start the SpecForge server for interactive development via the VSCode extension and the Python SDK.
  • init: Setup a new Lilo project with a sample lilo.toml file and a sample spec.
  • parse: Check if the given list of Lilo files parse correctly.
  • check: Typecheck the given list of Lilo files.
  • format: Format the given list of Lilo files, possibly inlining specs.
  • export: Export a Lilo spec to another formalism (e.g., .json or .lilo).
  • eval: Evaluate a Lilo spec on a given input signal, i.e, determine the value of the spec at the first timestamp of the input signal.
  • monitor: Monitor a Lilo spec on a given input signal, i.e., produce an output signal by evaluating the spec at every timestamp of the input signal.
  • streammon: Monitor a Lilo spec in streaming mode. This mode will read the input signal line-by-line from standard input as JSONL records, and output the value of the spec (when applicable) in a streaming manner.

The documentation for each CLI tool should be accessed directly using the --help flag with commands. Here is an example:

$ cabal exec specforge -- monitor --help
Usage: specforge monitor PROJDIR SYSTEM DATAFILE PARAMFILE DEFNAME
                      [--file-format FORMAT] [RECORD_ENCODING]

  Monitor a spec file

Available options:
  PROJDIR                  Path to the project directory
  SYSTEM                   System in which the spec lives
  DATAFILE                 Path to the data file
  PARAMFILE                Path to the param file
  DEFNAME                  Name of the definition to monitor
  --file-format FORMAT     One of these formats: csv, json, jsonl
  -h,--help                Show this help text

Record Encodings:
  flat                     Flat JSON with separator
  nested                   Nested JSON