AgentSkillsCN

Cli

CLI

SKILL.md

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

CommandDescription
tsci initInitialize a new project
tsci devStart development server
tsci buildBuild circuit JSON
tsci exportExport to various formats
tsci addInstall registry packages
tsci searchSearch footprints/packages
tsci pushPush package to registry
tsci loginSign in to registry
tsci logoutSign out
tsci auth print-tokenPrint API token
tsci snapshotGenerate 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
FormatDescription
circuit-jsonCircuit JSON format
schematic-svgSchematic as SVG
pcb-svgPCB layout as SVG
readable-netlistHuman-readable netlist
specctra-dsnSpecctra DSN for autorouting
gltf3D scene (text-based)
glb3D model (binary)
kicad-libraryKiCad 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

SkillDescription
APIsWeb API reference
ComponentsComponent elements
TutorialsProject tutorials