Command line

The snt puq commands evaluate expressions, convert units, inspect quantities, and list unit definitions.

Basic examples

With snt on PATH, evaluate an expression:

snt puq eval "23*cm + 3*m"

Convert to the units needed by a script:

snt puq convert "2.5*m" "cm"
# 250*cm

Common workflows

Task

Command chain

Output

Evaluate an expression

snt puq eval

Formatted quantity on stdout

Convert for a script

snt puq convert

Formatted target quantity on stdout

Inspect dimensions and units

snt puq info

Multi-line report on stdout

Discover unit definitions

snt puq list

Text or JSON listing on stdout

Fail safely in automation

Any command

Error on stderr and nonzero exit status

snt puq eval "23*ft + 3*yd" -s US -S SI -U cm
snt puq info "23*kg*m2/s2"
snt puq list deriv -s IU

Use -s for the input unit system, -S for the output system, and -Q for conversions that need a physical-quantity context:

snt puq convert "12*statA" "A" -s ESU -S SI -Q "I"

See the CLI guide for installation, shell-script usage, and the other command groups.

Current limitations and differences

Compared with the canonical C++ implementation:

  • Each invocation evaluates independently and returns text; it does not retain native Quantity objects for subsequent calls.

  • The CLI exposes evaluation, conversion, inspection, and listings. It has no commands for assigning correlations, Monte Carlo sampling, or extending EXS operators from host code.

  • Errors use stderr and a nonzero exit status rather than C++ exceptions. Use C++ or Python when calculations need typed in-memory results.

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 puq -h or snt puq <command> -h for the current option list.

  • snt puq eval <expression> evaluates with optional -s/--input-system, -S/--output-system, -U/--output-units, and -Q/--output-quantity.

  • snt puq convert <expression> <target-units> converts with the same input, output-system, and output-quantity options.

  • snt puq info <expression> prints dimensions, units, value, and uncertainty information; -s/--system selects the input system.

  • snt puq list <category> accepts prefix, base, deriv, log, temp, const, quant, and sys; -s/--system selects the listing system.