CLI Command Reference
Complete reference for all tsci commands
Overview
The tsci CLI provides commands for initializing projects, building circuits, managing packages, and more.
Command Index
| Command | Description |
|---|---|
| tsci init | Initialize a new project |
| tsci dev | Start development server |
| tsci build | Build circuit JSON |
| tsci export | Export to various formats |
| tsci add | Install registry packages |
| tsci search | Search footprints/packages |
| tsci push | Push package to registry |
| tsci login | Sign in to registry |
| tsci logout | Sign out |
| tsci auth print-token | Print API token |
| tsci snapshot | Generate test snapshots |
tsci init
Initialize a new tscircuit project.
bash
# Interactive initialization tsci init # Skip prompts with defaults tsci init -y
Creates:
- •
index.tsx- Main circuit file - •
package.json- Dependencies - •
tsconfig.json- TypeScript config - •
.gitignore - •
tscircuit.config.json
tsci dev
Start the development server with live preview.
bash
# Watch current directory tsci dev # Watch specific file tsci dev index.tsx # Custom port tsci dev --port 3000
Opens browser with live preview. Changes reload automatically.
tsci build
Generate circuit JSON from source files.
bash
# Build all circuits tsci build # Build specific file tsci build index.tsx # Build with transpilation tsci build --transpile # Ignore errors tsci build --ignore-errors
Output in dist/ directory.
tsci export
Export to various formats.
bash
# Export to Circuit JSON tsci export circuit.tsx # Export to SVG tsci export circuit.tsx -f schematic-svg tsci export circuit.tsx -f pcb-svg # Export to Specctra DSN tsci export circuit.tsx -f specctra-dsn # Export 3D model tsci export circuit.tsx --format glb # Export KiCad library tsci export circuit.tsx -f kicad-library # Custom output path tsci export circuit.tsx -o output.json
| Format | Description |
|---|---|
circuit-json | Circuit JSON format |
schematic-svg | Schematic as SVG |
pcb-svg | PCB layout as SVG |
readable-netlist | Human-readable netlist |
specctra-dsn | Specctra DSN for autorouting |
gltf | 3D scene (text-based) |
glb | 3D model (binary) |
kicad-library | KiCad symbols/footprints |
tsci add
Install packages from the tscircuit registry.
bash
# Add a package tsci add seveibar/PICO_W # Add with version tsci add seveibar/PICO_W@0.0.1
tsci search
Search for footprints and packages.
bash
# Search for footprints tsci search resistor # Search for packages tsci search "usb-c"
tsci push
Push a package to the registry for sharing.
bash
# Push current package tsci push
tsci auth print-token
Print your API token for web API authentication.
bash
tsci auth print-token
Output can be used with Authorization: Bearer <token> header.
tsci snapshot
Generate snapshots for regression testing.
bash
# Generate snapshots tsci snapshot # Update existing snapshots tsci snapshot --update # Include 3D previews tsci snapshot --3d
Authentication
bash
# Login to registry tsci login # Logout tsci logout # Print auth token tsci auth print-token
Login required for:
- •Cloud autorouting
- •Package publishing
- •Registry access
Related Skills
| Skill | Description |
|---|---|
| APIs | Web API reference |
| Components | Component elements |
| Tutorials | Project tutorials |