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 CLI is self-documenting. Run specforge --help to see all available commands, and specforge <command> --help for detailed usage of any command.

$ specforge --help
Usage: specforge COMMAND [--verbosity VERBOSITY | --verbose]
                 [-p|--project PROJDIR]

Available options:
  --verbosity VERBOSITY    Set log verbosity: none, attention, info, trace
                           (default: info)
  --verbose                Alias for --verbosity trace
  -p,--project PROJDIR     Path to the project directory (default: ".")
  --stdio                  Compatibility flag for language-client stdio
                           transports (ignored)
  -h,--help                Show this help text
  --version                Show version information

Available commands:
  parse                    Parse a spec file
  check                    Typecheck a spec file
  lint                     Run fast project diagnostics
  analyze                  Run solver-backed project analyses
  format                   Format a spec file
  monitor                  Monitor a spec file
  eval                     Evaluate a spec file
  serve                    Start the server
  lsp-server               Run the LSP server on stdio
  export                   Export a spec
  streammon                Monitor a spec in streaming mode from STDIN
  init                     Initialize a new Lilo project
  flatten                  Flatten hierarchical components in a system
  schema                   Generate a schema or template
  doctor                   Troubleshoot common issues
  conditional-inconsistency
                           Analyze conditional inconsistencies in a system
  search                   Search for definitions in a project
  validate                 Validate that the results of the antecedent query are
                           contained in the results of the consequent query
  bulk-label               Update labels for selected definitions
  doc                      Print SpecForge documentation pages
  specialize               Preview feature: generate one specialized spec per
                           finite enum param combination
  fill-stubs               Fill in definition stubs using the configured LLM
  specialize-system        Preview feature: specialize one component-free system
                           source file
  set-tier                 Set the license tier

Documentation (doc)

The SpecForge documentation is embedded in the binary and can be printed directly:

  • specforge doc lists the available pages with a one-line summary of each.
  • specforge doc <topic> prints a single page (e.g. specforge doc lilo-language).
  • specforge doc --all prints every page, concatenated.

Project Directory

CLI commands will assume that the project directory (i.e, the directory containing the specforge.toml file) is the current working directory. You can specify a different project directory with the -p / --project option at the end of the command.

Output language

Some CLI commands localizes human-readable command output. English (the default) and Japanese are supported, and Japanese translations are being rolled out command by command.

The language is selected from the standard locale environment variables. One can change the language by modifying $LANG for instance:

$ LANG=ja_JP.UTF-8 specforge check  # force Japanese
$ LANG=en_US.UTF-8 specforge check  # force English

Record encoding

Several commands accept a RECORD_ENCODING subcommand (flat or nested) that controls how record-typed signals and parameters are represented. The flat encoding accepts -s / --separator SEPARATOR to set the field separator (default: "_").

When no encoding is specified, the default depends on the file format: flat for CSV, nested for JSON/JSONL.

See Record encoding in the Data Files chapter for a full explanation with examples.