CLI reference
The circuitscript command-line tool renders a Circuitscript source file into one or more output files and reports errors as a non-zero exit code.
Usage
circuitscript [input path] [output path]
input path is a .cst file; output path selects the output format from its file extension (see Output formats). Either can be replaced with -i/--input and --o, respectively.
Options
| Name | Description |
|---|---|
-i, --input <text> | Provide the input script directly as a string instead of a file path |
-u, --update-source | Update the source file with refdes annotation. See Annotation |
-j, --annotated-path [file-path] | Save an annotated copy of the source file at the given path. See Annotation |
-w, --watch | Watch the input file for changes and re-render on save |
-n, --dump-nets | Dump out net information |
-d, --dump-data | Dump data during parsing |
-s, --stats | Show stats during generation |
-x, --skip-output | Skip output generation |
-e, --erc | Enable ERC output. See Electrical Rules Check (ERC) |
-b, --bom [output-path] | Generate a Bill of Materials in CSV format. See BOM generation |
--kicad-version <version> | KiCad schematic output version, 9 or 10 (default 9) |
--no-simplify-refdes | Disable simplification of single-instance indexed refdes (for example R1_1 → R1) |
--refdes-mode <mode> | Refdes assignment mode for components created in loops and functions: flat, indexed (default) or indexed-flat. Overrides document.refdes_assignment. See Refdes assignment modes |
--no-indexed-refdes | Same as --refdes-mode flat: use running numbers (R1, R2) instead of indexed refdes (R1_1, R1_2). Cannot be combined with --refdes-mode indexed or indexed-flat |
--max-net-rename-attempts <n> | Maximum attempts to find an unused name when a generated net name collides with an existing one (default 5000) |
--o <fileName> | Additional output path; repeatable to generate several outputs in one run |
Exit codes
The CLI exits 1 when:
- the input has a syntax or parsing error,
- an ERC check reports at least one
Error-severity result, - the input file cannot be found,
- an unexpected error occurs.
Otherwise it exits 0. This makes the CLI usable as a pass/fail step in CI.