CLI Reference
Unified `tdse` command surface, output artifacts, and exit-code behavior.
Use this chapter when you already know you need the tdse command-line tool and want the shortest path to the right command, the stable output fields for automation, or the exact syntax for a specific verb.
How To Use This Chapter
Most readers use this chapter in one of two ways:
- to confirm which command family to use:
sdk,adapter circuit, orprofiler - to look up exact flags, output files, and machine-readable fields
If you are still getting your first model running, start with Getting Started and come back here when you need exact command syntax.
Before You Start
- A successful build that produces the
tdseexecutable. - A writable output directory for
--out-*targets. - Representative input data for the path you want to exercise.
cmake --build build --target tdse
First Confidence Check
For the general SDK installation and first-run path, see Installation.
Use these three commands to confirm that the CLI routes correctly, that Adapter Circuit is available, and that the profiler can emit a report:
tdse sdk version --json-out -
tdse adapter circuit caps --out-caps /tmp/caps.json --json-out -
tdse profiler quick --out-json ./tdse_profile_report.json --json-out -
Expected output sample:
tdse sdk version: success
tdse adapter circuit caps: success
tdse profiler quick: success
Choose A Command Family
Use this table before dropping into the full reference:
| If you need to... | Use... | Primary outputs |
|---|---|---|
| confirm binary and SDK identity | tdse sdk version | version metadata JSON |
| inspect or convert circuit-domain input | tdse adapter circuit ... | netlists, matrix CSV, probe CSV, JSON envelopes |
| benchmark runtime behavior or derive a runtime plan | tdse profiler ... | profiler report JSON, summary Markdown, matrix CSV |
Typical starting points:
- PSS/E RAW case ->
adapter circuit raw-to-netlist - circuit netlist ->
adapter circuit matrix,series, orprobe - backend or route uncertainty ->
profiler calibrate,sweep,validate,explain,diff
Most Common Workflows
If you want the shortest path from intent to command, start here:
| Goal | First command | Then usually do this |
|---|---|---|
| prove the binary and installation are sane | tdse sdk version --json-out - | move to Getting Started |
| convert a RAW case | tdse adapter circuit raw-to-netlist | run matrix on the generated netlist |
| generate Builder-facing matrix data | tdse adapter circuit matrix | move to Builder and Data Contracts |
| inspect source-side waveforms | tdse adapter circuit series | compare against expected circuit behavior |
| inspect internal nodes or branches | tdse adapter circuit probe | use Troubleshooting if values look wrong |
| capture a baseline performance report | tdse profiler quick | follow with validate, explain, diff, or tables |
Use Adapter Circuit when you need the circuit-domain meaning behind a command. Use this chapter when you need exact flags, outputs, and stable fields.
Common Automation Rules
These rules make CLI usage much more predictable in scripts and CI:
- always set
--json-outfor machine parsing - archive the exact input identity for adapter and profiler runs
- keep port ordering stable across repeated matrix and series generation
- archive the exact frequency grid when generating Builder-facing matrix data
- for profiler runs, prefer emitting JSON, Markdown, and CSV together
Parameter quick reference:
| Parameter | Where it appears | Practical rule | Why it matters |
|---|---|---|---|
--json-out | most public commands | always set in automation | gives stable JSON output that scripts can parse |
--out-data | adapter matrix/series/probe | point to a writable file or - | captures primary numeric output |
--ports | adapter matrix/series/probe | keep ordering stable across replays | output shape depends on port order |
--w0-radps, --dw-radps, --nfreq | adapter matrix | archive the exact grid | frequency sweep identity must be reproducible |
--out-json, --out-md, --out-csv | profiler commands | emit all three in release records | JSON is best for automation, Markdown and CSV are easier to review |
--min-coverage | profiler validate | pin the threshold in CI | prevents silent report drift |
When The CLI Fails
Start with these checks before reading the deeper reference material:
- run
tdse sdk version --json-out -to confirm you are using the expected binary - add
--json-out -so failure details remain visible in shell-only logs - reduce adapter failures to the smallest netlist, one port, and one frequency when possible
- compare current profiler output against a known-good report with
tdse profiler diff
Production And CI Path
Use this short path when you are qualifying a build or capturing release evidence:
- run
tdse sdk version --json-out -and archive the version JSON - run one representative adapter command with
--json-out - run one representative profiler command with
--out-json,--out-md, and--out-csv - rerun
tdse profiler validate,explain,diff, ortableson the saved report when needed - archive exit codes and artifact paths alongside the input identity
Related Docs
- Getting Started
- Adapter Circuit
- Profiler
- Troubleshooting
- C API Reference
Reference: Commands
Command Summary
| Command | Purpose | Key options |
|---|---|---|
sdk version | Report CLI/SDK/git/runtime version metadata | --json-out |
adapter circuit caps | Emit backend capability Markdown and build-feature JSON | --out-caps, --out-build-features, --json-out |
adapter circuit raw-to-netlist | Convert PSS/E RAW input into circuit-compatible netlist with base-frequency validation | --raw-kind, --raw, --out-netlist, --out-report-json, --json-out |
adapter circuit matrix | Compute Y or Z matrix over a frequency grid and emit CSV | --netlist-kind, --matrix, --ports, --w0-radps, --dw-radps, --nfreq, --out-data, --json-out |
adapter circuit series | Compute VOC or ISC source-side time series | --netlist-kind, --series, --ports, --method, --dt, --steps, --out-data, --json-out |
adapter circuit probe | Compute AC or transient probe outputs (deprecated alias: adapter circuit simulate) | --domain, --netlist-kind, --observe, --observe-source, --out-data, --json-out |
profiler quick | Quick benchmark pass | --out-json, --out-md, --out-csv, --json-out |
profiler calibrate | Calibrated benchmark with route-policy derivation | --out-json, --out-md, --out-csv, --json-out |
profiler sweep | Full parameter sweep benchmark | --out-json, --out-md, --out-csv, --json-out |
profiler validate | Validate a profiler report against coverage thresholds | --min-coverage, --json-out |
profiler explain | Explain one shape from a profiler report | --np, --nh, --dtype, --json-out |
profiler diff | Diff two profiler reports | --out-md, --json-out |
profiler tables | Generate route/case tables from a profiler report | --out-route-md, --out-matrix-md, --json-out |
profiler irc-scan | Advanced IRC scan for specialized workflows | --scan-prefix-counts, --scan-growth-values, --scan-input, --out-recommend-json, --json-out |
SDK Commands
sdk version — Report CLI, SDK, git, and runtime version metadata.
Minimal replay:
tdse sdk version --json-out -
Documented data keys:
cli_versionsdk_versiongit_commitruntime_versionruntime_version_majorruntime_version_minorruntime_version_patch
Adapter Circuit Commands
adapter circuit caps — Emit backend capability Markdown and optional build-feature JSON.
Minimal replay:
tdse adapter circuit caps \
--out-caps ./adapter_caps.md \
--out-build-features ./adapter_build_features.json \
--json-out -
Documented data keys:
backend_countcaps_targetbuild_features_target
Capability Markdown is operator-facing, while build-features JSON is machine-readable.
adapter circuit raw-to-netlist — Convert PSS/E RAW input into a circuit-compatible netlist and run base-frequency validation in the same command path.
Minimal replay:
tdse adapter circuit raw-to-netlist \
--raw-kind file --raw case.raw \
--out-netlist ./case_from_raw.cir \
--out-report-json ./raw_report.json \
--json-out -
Documented data keys:
source_kindstrictoutput_targetreport_targetnetlist_bytesreport_required_bytesvalidation_passimport_reportsummary
import_report and summary are the contract anchors for conversion count diagnostics and base frequency validation outcomes.
Byte-size semantics: netlist_bytes and report_required_bytes are payload bytes, excluding trailing C-string null terminators.
adapter circuit matrix — Compute Y or Z matrix data over a requested frequency grid.
Minimal replay:
tdse adapter circuit matrix \
--netlist-kind file --netlist case.cir \
--matrix y --ports "1,0;2,0" \
--w0-radps 377 --dw-radps 0 --nfreq 1 \
--out-data ./matrix.csv \
--json-out -
Required options:
--netlist-kind <file|text|stdin>--matrix <y|z>--ports <p0p,p0n;p1p,p1n;...>--w0-radps <w0>--dw-radps <dw>--nfreq <N>
Common optional output:
--out-data <path|->--json-out <path|->
DC endpoint options:
--dc-policy <mode>--dc-extrapolate-points <N>
DC policy notes:
--w0-radpsmay be0or any positive finite value- CLI default is
--dc-policy exact_dc_then_fallback regularized_exact_dckeeps the regularized0Hzsolve behavior as the primary endpoint strategyextrapolate_from_positivereplaces the0Hzsample with a surrogate endpoint fitted from the first positive-frequency samples; it is intended for plotting and Builder-facing smooth endpoints, not as an exact DC proof pointexact_dc_then_fallbackfirst attempts an exact0Hzsolve with DC element semantics; if that endpoint is singular or otherwise unusable and positive-frequency samples exist, it falls back to the same surrogate endpoint strategy- when
--w0-radps 0and--dc-policy extrapolate_from_positive, use--nfreq >= 2
Documented data keys:
matrix_kindnetlist_kindnpnfreqoutput_target
adapter circuit series — Compute VOC or ISC source-side time series.
Minimal replay:
tdse adapter circuit series \
--netlist-kind file --netlist case.cir \
--series voc --ports "1,0" \
--method transient --dt 1e-4 --steps 64 \
--out-data ./series.csv \
--json-out -
Required options:
--netlist-kind <file|text|stdin>--series <voc|isc>--ports <p0p,p0n;...>--method <tone|ifft|transient>--dt <dt>--steps <N>
Method-specific note:
--nfftis required when--method=ifft
Documented data keys:
response_kindnetlist_kindmethodnpstepsdtoutput_target
adapter circuit probe — Compute AC or transient probe outputs. Compatibility note: adapter circuit simulate remains accepted as a deprecated alias.
Required options:
--domain <ac|transient>--netlist-kind <file|text|stdin>
Minimal AC replay:
tdse adapter circuit probe \
--domain ac --netlist-kind file --netlist case.cir \
--observe "v(1,0)" --observe-source argument \
--ac-excitation small_signal \
--sweep-kind list --freq-list-hz 50,60 \
--out-data ./probe_ac.csv \
--json-out -
Minimal transient replay:
tdse adapter circuit probe \
--domain transient --netlist-kind file --netlist case.cir \
--observe "v(1,0)" --observe-source argument \
--method transient --dt 1e-4 --steps 64 \
--out-data ./probe_tr.csv \
--json-out -
Transient-specific options:
--method <tone|ifft|transient>--dt <dt>--steps <N>- optional
--nfft <N> - optional
--t0 <t0>
AC-specific options:
- optional
--ac-excitation <small_signal|legacy_tones> --sweep-kind <from_netlist|lin|dec|oct|list>- sweep arguments matching the selected sweep kind
Probe options:
--observe "v(1,0);i(r1)"--observe-source <argument|netlist|argument_or_netlist|auto>
Documented data keys:
domainnetlist_kindprobe_sourceprobe_countmethodandstepsfor transient modesweep_kind,excitation_mode, andnfreqfor AC modeoutput_target
Profiler Benchmark Commands (quick, calibrate, sweep)
Benchmark runtime shapes and produce route-policy artifacts.
Common output options:
--out-json <report.json>--out-md <summary.md>--out-csv <matrix.csv>--json-out <envelope.json>for unified CLI status envelope
Common workload controls:
--np <N>--nh <N>--dtype <32|64>--steps <N>--warmup <N>--repeats <N>
Profiler Utility Commands (validate, explain, diff, tables, irc-scan)
Validation:
tdse profiler validate <report.json> [--min-coverage X]
Explain one shape:
tdse profiler explain <report.json> --np <N> --nh <N> [--dtype 64]
Diff two reports:
tdse profiler diff <old_report.json> <new_report.json> [--out-md <diff.md>]
Generate route/case tables:
tdse profiler tables <report.json> --out-route-md <route.md> --out-matrix-md <matrix.md>- all profiler verbs also support
--json-out <envelope.json>for machine-readable status
profiler irc-scan — Advanced IRC scan for specialized workflows:
tdse profiler irc-scan--scan-prefix-counts ...--scan-growth-values ...--scan-input random|lowpass|step_ring|trace--out-recommend-json <recommend.json>
Deep Reference: Output Formats and Stable Fields
Use this section when you parse CLI artifacts directly in automation or tooling. If you only need to run commands interactively, the command reference above is usually enough.
Common JSON Envelope
When --json-out is enabled, the CLI writes a completion envelope with these stable top-level keys:
groupactionstatusexit_codemessagedata
Parsing guidance:
- use
groupandactionto determine which command completed - use
status,exit_code, andmessagefor command outcome handling - parse
dataaccording to the command family and the corresponding output shape - accept undocumented extra keys conservatively rather than failing hard on their presence
- do not treat undocumented nested keys inside
dataas a long-term contract unless another public guide section says so explicitly
For profiler commands, --json-out is a command-level envelope emitted by the unified tdse router (group="profiler"), so automation can consume success/failure status consistently across adapter and profiler families.
Output Artifacts
Adapter Circuit. Primary adapter-circuit outputs:
- converted netlist
- validation report JSON
- matrix or probe CSV
- command completion JSON envelope
Use these as integration records before handoff to Builder and Runtime.
Profiler. Primary profiler outputs:
- profiler report JSON (authoritative machine-readable surface)
- optional summary Markdown
- optional matrix CSV
- runtime plan section for
tdse_backend_apply_plan(...)
Cross-Family Handoff. Treat TDSE CLI outputs as one handoff chain:
- adapter-domain artifacts establish model and signal validity
- profiler artifacts establish route and policy validity
- runtime consumes stable plan information only after both are accepted
Authoritative vs Summary.
- authoritative:
- adapter and profiler JSON outputs
- profiler schema-backed report
- summary:
- Markdown and human review tables
- CSV convenience outputs for analysis
Command Data Shapes
sdk version fields:
cli_versionsdk_versiongit_commitruntime_versionruntime_version_majorruntime_version_minorruntime_version_patch
adapter circuit caps documented data fields:
backend_countcaps_targetbuild_features_target
adapter circuit raw-to-netlist documented fields:
source_kindstrictoutput_targetreport_targetnetlist_bytesreport_required_bytesvalidation_passimport_reportsummary
Matrix Output (Y / Z). CLI CSV header:
freq_index,freq_radps,row,col,re,im
Parsing contract:
- one row per frequency / matrix-row / matrix-column tuple
freq_indexis zero-basedfreq_radpsis the physical angular frequency for that rowrowandcolare zero-based port indicesreandimstore the complex value- frequency-major ordering
In-memory C API layout:
- frequency-major row-major
- packed as
out[2*(k*np*np + row*np + col) + {0,1}]
Builder handoff note:
- this is the same ordering expected when the matrix is exposed through
tdse_builder_cplx_mat_view_t
VOC / ISC Time-Series Output. CLI CSV header:
step,time,port,value
Parsing contract:
- one row per time step and port
stepis zero-basedtime = t0 + step * dtportis the zero-based port indexvalueis the scalarVOCorISCsample- step-major ordering
In-memory C API layout:
- step-major row-major
out_values[step*np + port]
Integration note:
- CLI JSON is metadata only; the sequence payload contract is the CSV shape above or the in-memory layout above
Transient Probe Output. CLI CSV header:
step,time,probe,value
Parsing contract:
- one row per time step and resolved probe
probeis the zero-based resolved probe index- the mapping from probe index to expression depends on CLI
--observeorder or netlist probe order
In-memory C API layout:
- step-major row-major
out_values[step*nprobe + probe]
AC Probe Output. CLI CSV header:
freq_index,freq_hz,probe,re,im
Parsing contract:
- one row per frequency sample and probe
freq_indexis zero-basedfreq_hzis the physical frequency in Hzprobeis the zero-based resolved probe indexre/imstore the complex probe response- frequency-major ordering
In-memory C API layout:
- frequency-major row-major with RI interleaving
out_values_ri[2*(k*nprobe + p) + 0] = Re(X_p(f_k))out_values_ri[2*(k*nprobe + p) + 1] = Im(X_p(f_k))
Unit note:
- AC probe sweep files use Hz, not rad/s
Region Preparation and Region-Compute Report. tdse_adapter_circuit_prepare_region(...) can return a machine-readable JSON report through out_report_json.
For machine integration, the primary shape contract is no longer JSON-only:
- region preparation returns
required_ports_lenplus optionalout_ports - matrix calls return
result.shapeplus optionalout_resolved_ports - series calls return
result.shapeplus optionalout_resolved_ports - probe calls return
result.shape
Treat the JSON report as audit/debug metadata, not the only source of shape information.
Stable top-level keys for this release:
report_versionsummaryboundaryshaperesolved_portsissues
Parsing guidance:
- require
report_version == 2 - treat the key set above as the documented top-level contract for this release
- tolerate additional undocumented keys conservatively
- use
result.shape,result.required_*, and optionalout_resolved_portsas the primary in-memory sizing contract
Top-level shape:
{
"report_version": 2,
"summary": {},
"boundary": {},
"shape": {},
"resolved_ports": [],
"issues": []
}
summary — operation metadata. Common keys include:
operation, accepted, requested_node_count,
region_node_count, region_element_count, component_count,
boundary_node_count, port_count, topology_hash, and
parameter_hash. The operation field identifies which phase emitted
the report (for example, prepare_region).
boundary — region boundary structure. Contains components, where each component holds boundary_nodes, reference_node, and ports.
shape — dimension and layout contract. Always includes port_count and layout. Matrix reports add required_values_len, w0, dw, nfreq. Series reports add required_values_len, dt, steps. Preparation reports include required_ports_len.
resolved_ports — array of [node_p, node_n] pairs. Each entry is a canonical SPICE node label string ("0" for ground, retained name forms when available, numeric token otherwise). Hosts must not interpret these strings as internal node indices.
Profiler Canonical JSON Report. Primary machine-readable artifact:
tdse_profile_report.json
Runtime-facing expectations:
schema_version == "tdse_profile_report_v1"- non-placeholder fingerprint fields
policy.rulesruntime_plan
Profiler --json-out Envelope. Profiler envelope data is currently an empty object {} and is intended as a stable status contract:
group: alwaysprofileraction: resolved profiler action (quick,calibrate,validate,diff, etc.)status:okorerrorexit_code: process exit codemessage: short completion/failure summary
runtime_plan Contract. runtime_plan is the profiler output intended for TDSE Core consumption through tdse_backend_apply_plan(...).
At minimum, it must provide:
- a default backend choice
- scenario-based selections for relevant shape signatures
Human-Review And Debug Outputs
- Markdown summary and route tables are human-review surfaces
- CSV matrices are analysis/audit surfaces
- runtime consumption should rely on JSON contracts only
NPORT Debug CSV / JSON. Debug CSV shape:
# type=Y,nports=2,z0=50
freq_hz,row,col,re,im
1000,0,0,1.0,0.0
1000,0,1,0.0,0.0
1000,1,0,0.0,0.0
1000,1,1,2.0,0.0
Rules:
- the file must contain the full
N x Nmatrix at each frequency rowandcolare zero-basedtypeshould beYorZ
Debug JSON shape:
{
"nports": 2,
"type": "Y",
"z0": 50,
"freq_hz": [1000, 2000],
"mats_ri": [
[[1, 0], [0, 0], [0, 0], [2, 0]],
[[3, 0], [0, 0], [0, 0], [4, 0]]
]
}
Rules:
freq_hz[k]andmats_ri[k]must have matching outer lengths- each
mats_ri[k]can be either:- a flat row-major list of
N*Ncomplex pairs, or - a nested
N x Nlist of complex pairs
- a flat row-major list of
Integrator Guidance. Recommended parser behavior:
- branch on
groupandaction - validate documented keys and headers
- ignore unknown extra keys conservatively
- archive artifact paths named in
output_target,caps_target,build_features_target,report_target, and profiler report output options
Exit Codes
The CLI maps outcomes into stable process exit categories:
0: success2: CLI argument shape error10: invalid argument11: parse failure12: I/O failure13: unsupported operation14: singular solve15: internal failure16: backend unavailable20: strict validation failure
Both command families (adapter and profiler) remain automation-friendly:
- nonzero code on failure family
- machine-readable completion payload via
--json-outwhen available - command-scoped stable fields documented in the output contracts section above
