Skip to main content
Command Line Interface

tsci export

Overview​

tsci export can be used to convert a tsx file or circuit.json file into various output formats including schematics, PCB layouts, fabrication files, and more.

Export options in the web interface
Export options available in the web interface after running tsci dev

Usage​

tsci export <file> [options]

Arguments​

  • <file>: Path to the source file (.tsx or .circuit.json)

Options​

  • -f, --format <format>: Output format (defaults to "json")
  • -o, --output <path>: Custom output file path
  • --drawing <name-or-filename>: Select a configured drawing page; implies --format drawing-svg when the format is omitted.
  • --disable-parts-engine: Disable the parts engine during circuit evaluation
  • --show-courtyards: Show courtyard outlines in PCB images
  • --layer <layer>: Choose top or bottom; during X-Ray, this layer is drawn in front
  • --x-ray-net <name-or-id>: X-Ray a connected PCB net; repeat to select multiple nets
  • --hidden-layer-opacity <opacity>: Opacity of other copper during X-Ray, from 0 to 1 (default: 0.2)

Supported Formats​

The following export formats are supported:

FormatDescription
jsonCircuit JSON format (alias for circuit-json)
circuit-jsonCircuit JSON format
schematic-svgSchematic view as SVG
pcb-svgPCB layout as SVG
pcb-pngPCB layout as PNG
assembly-svgAssembly view as SVG
drawing-svgOne configured assembly drawing sheet, including its part views and title block
gerbersGerber fabrication files (zipped)
readable-netlistHuman-readable netlist
specctra-dsnSpecctra DSN format for autorouting
gltfText-based 3D scene (glTF 2.0) that references board meshes and textures
glbBinary glTF bundle that packs geometry, materials, and textures into a single file
stepSTEP 3D model (ISO-10303-21) for high-fidelity CAD integration
kicad_schKiCad schematic file
kicad_pcbKiCad PCB layout file
kicad_zipZipped KiCad project (schematic + PCB)
kicad-libraryKiCad library with symbols, footprints, and 3D models (see Exporting KiCad Library)
spiceSPICE netlist with simulation results exported as .spice.cir and .csv

Examples​

Export to circuit JSON:

tsci export circuit.tsx

Export as schematic SVG:

tsci export circuit.tsx -f schematic-svg

Export as assembly SVG:

tsci export circuit.tsx -f assembly-svg

Export PCB layout with custom output path:

tsci export circuit.tsx -f pcb-svg -o my-pcb-layout.svg

Export PCB SVG with courtyard outlines:

tsci export circuit.tsx -f pcb-svg --show-courtyards

Export to Specctra DSN format:

tsci export circuit.tsx -f specctra-dsn

Export selected nets across all copper layers (PCB SVG or PNG only):

tsci export board.tsx -f pcb-png --x-ray-net GND --x-ray-net VCC --hidden-layer-opacity 0.2 -o power.png

Exporting 3D models​

Use the gltf, glb, or step formats when you want a 3D representation of your board for use in CAD tools, AR viewers, or when embedding on the web.

Export as glTF​

tsci export circuit.tsx --format gltf

This produces a .gltf file (plus any referenced texture files) that follows the glTF 2.0 spec. Because the assets stay separate, glTF exports are easier to diff in git and you can selectively optimize textures.

Export as GLB​

tsci export circuit.tsx --format glb

The glb format wraps the same data into a single binary so you can upload one file to a web viewer (for example, https://gltf.report/ or model-viewer). This is handy for sharing previews or attaching a lightweight CAD model to a manufacturing request.

Both commands work with .tsx source files as well as .circuit.json files, so you can export whichever representation you already have. Each command writes the 3D model next to the input file unless you override the location with --output <path>.

Export as STEP​

tsci export circuit.tsx --format step

This produces a .step file that can be imported into most mechanical CAD tools.

Output Files​

By default, the exported file will be saved in the same directory as the input file, with a filename based on the input filename and the chosen format. For example:

  • Input: my-circuit.tsx
  • Format: pcb-svg
  • Default output: my-circuit-pcb.svg

You can override the output location using the -o or --output option.

Exporting drawing sheets​

Add assembly.drawing.page elements to your circuit. Select a page by its name or generated SVG filename:

tsci export carrier.circuit.tsx --format drawing-svg --drawing carrier-inspection
tsci export carrier.circuit.tsx --drawing carrier-inspection.svg --output inspection.svg

Without --output, the first command writes carrier-inspection.svg beside the source file. Relative output paths are also resolved from the input file's directory; absolute paths are preserved. Create destination directories before exporting.

You can export an already-built Circuit JSON file too:

tsci export dist/carrier/circuit.json --drawing carrier-inspection -o /tmp/inspection.svg

A single drawing page needs no selector: tsci export carrier.circuit.tsx -f drawing-svg. Multiple pages require --drawing; unknown or ambiguous names fail with an error. Page names become safe SVG filenames, and unnamed pages use drawing-1.svg, drawing-2.svg, etc.

drawing-svg renders the configured paper sheet. For a PCB assembly illustration instead, use assembly-svg. To export every drawing page into the build directory, use tsci build --drawings.