Command line

Parse, compare, save, export, and report DIPL environments.

Basic examples

With snt on PATH, evaluate text and print a scalar:

snt dip parse --input string "steps int = 100" --request steps --value --type integer
# 100

Tune the same input with an override:

snt dip parse --input string "steps int = 100" \
    --input override_string "steps = 200" --request steps --value --type integer
# 200

Common workflows

Task

Command chain

Output

Parse and inspect

snt dip parse; describe; list; entries

Text or JSON records

Save and restore

parse --save; parse --load

DIPH5 snapshot

Export parameters

parse --generate FORMAT FILE

Generated source or data file

Preview overrides

snt dip preview --override ... or --override-file

Candidate validation and comparison

Compare snapshots

snt dip compare before.diph5 after.diph5 --scope effective|full

Summary and indexed differences

Generate a report

snt report --project DIPfile --format ... --output FILE

Report file

Package for the web

snt dip package --project DIPfile --output FILE

Project bundle JSON

Maintain source

snt dip format; validate; lint

Check/write result or diagnostics

snt dip parse --project DIPfile --print --save run.diph5
snt dip describe --project DIPfile --path physics.speed --format json
snt dip list --project DIPfile --query '?physics.' --format json

snt dip preview --project DIPfile --override 'physics.speed = 3 m/s' \
    --format json
snt dip compare before.diph5 run.diph5 --scope full

snt report --project DIPfile --format html --output report.html
snt dip package --project DIPfile --output project.bundle.json

snt dip format --check parameters.dip
snt dip validate DIPfile
snt dip lint --json parameters.dip

Each command evaluates its input independently; no environment persists between invocations. Use --print, --request, --value, or --format json to make machine-readable output. Errors go to stderr and return a nonzero status, so shell pipelines can test the command directly.

snt dip docs prints the embedded DIPL language reference by chapter or heading, for example snt dip docs expressions#templates.

DIPL developer tools. The CLI exposes the complete maintenance workflow:

snt dip format --check parameters.dip
snt dip format --write parameters.dip
snt dip validate DIPfile
snt dip lint --json parameters.dip

See the CLI guide for parsing, setup, persistence, export, and reports, and the DIPL developer tools page for formatter, validator, and linter settings.

Current limitations and differences

Compared with the canonical C++ implementation:

  • Each command loads and evaluates its input independently; callers receive text or JSON instead of a persistent C++ Environment or Inspector.

  • Custom value/node callbacks cannot be registered from command arguments. Register them in C++ or Python when embedding DIP in an application.

  • Parsing, source validation, formatting, linting, guided setup, reports, and experiment recording have CLI commands. The C++ source-editing session APIs have no direct CLI counterpart; use the viewer or embed those APIs.

Command reference

This is a command lookup, not a set of examples to run in order. Use Common workflows above to choose a task, then find the exact invocation below. Run snt dip <command> --help for the current option list.

Project and source commands

  • snt dip init initializes a project in the current directory.

  • snt dip setup <DIPfile> [--output FILE] builds an override through guided prompts.

  • snt dip docs [--list | CHAPTER | CHAPTER#HEADING] reads the embedded language reference.

  • snt dip package --project <DIPfile> [--output FILE] [--include FILE ...] creates a browser project bundle.

  • snt dip experiment <command> records a DIPH5 execution lifecycle.

Evaluation and persistence

  • snt dip parse accepts repeated -i/--input registrations: file, string, override_string, override_file, unit, source, schema_string, and schema_file.

  • snt dip parse --project <DIPfile> loads a project; --load <run.diph5> restores a snapshot.

  • --request/-r, --print, --value, --type, --record-graph, --save, and --generate control output and persistence.

  • snt dip compare <before.diph5> <after.diph5> [--scope ...] compares snapshots.

Inspection commands

  • snt dip describe --project <DIPfile> --path <PATH> [--format json].

  • snt dip schemas --project <DIPfile> [--format json].

  • snt dip sources --project <DIPfile> [--format json].

  • snt dip override-contract --project <DIPfile> --path <PATH>.

  • snt dip list --project <DIPfile> [--query QUERY] [--limit N].

  • snt dip entries --project <DIPfile> --path <PATH>.

  • snt dip records --input <FILE> --collection <MAP> [--where-eq ...].

  • snt dip preview --project <DIPfile> --override-file <FILE>.

  • snt dip format --check|--write <file> [<file> ...].

  • snt dip validate [--project] [--json] <file> [<file> ...].

  • snt dip lint [--project] [--json] <file> [<file> ...].

Reports

  • snt report --project <DIPfile> --format tex|pdf|md|rst|html|typ|txt|json --output <FILE>.

  • snt report --load <FILE.diph5> ... renders from a snapshot.

  • --intro, --title, --author, --date, --report-version, --tex-compiler, and --cheatsheet-pdf control report output.