Skip to content
tscircuitPublic

About

Create electronics with React with a local development server

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Repository files navigation

tscircuit command line interface (CLI)

A CLI for developing, managing and publishing tscircuit code (the "npm for tscircuit") npm install -g tscircuit

The.tscircuit.Command.Line.Tool.mp4

Usage

# Start a local dev server in your current directory
tsci dev

Installation

npm install -g tscircuit

CLI USAGE

Usage: tsci [options] [command]

CLI for developing tscircuit packages

Options:
  -h, --help                   display help for command

Commands:
  init [options] [directory]   Initialize a new TSCircuit project in the
                               specified directory (or current directory if none
                               is provided)
  dev [options] [file]         Start development server for a package
  clone [options] [package]    Clone a package from the registry
  push [options] [file]        Save package code to Registry API
  auth                         Login/logout
  login                        Login to tscircuit registry
  logout                       Logout from tscircuit registry
  config                       Manage tscircuit CLI configuration
  export [options] <file>      Export tscircuit code to various formats
  build [options] [file]       Run tscircuit eval and output circuit json
  transpile [file]             Transpile TypeScript/TSX to JavaScript (ESM,
                               CommonJS, and type declarations)
  add <packageSpecs...>        Add tscircuit component packages to your project
  agent [args...]              Install/update and run tsci-agent
  remove <component>           Remove a tscircuit component package from your
                               project
  snapshot [options] [path]    Generate schematic and PCB snapshots (add --3d
                               for 3d preview)
  setup                        Setup utilities like GitHub Actions
  install [packageSpec]        Install project dependencies, or install a
                               specific package (e.g., tsci install
                               https://github.com/espressif/kicad-libraries)
  update [packageSpec]         Update tscircuit component packages to their
                               latest version
  upgrade                      Upgrade CLI to the latest version
  doctor                       Run diagnostic checks for your tscircuit setup
  report                       Report a tscircuit bug
  check [file]                 Partially build and validate circuit artifacts
  quote                        Estimate or create a quote for manufacturing a
                               board
  registry                     Manage tscircuit registry resources
  search [options] <query...>  Search for footprints, CAD models or packages in
                               the tscircuit ecosystem
  import [options] <query...>  Search JLCPCB or the tscircuit registry and
                               import a component
  convert [options] <file>     Convert .kicad_mod to TSX, or discover a
                               footprinter string with --footprinter
  simulate [options] <file>    Run a simulation
  version [options]            Print CLI version
  help [command]               display help for command

Development

This command will open the index.tsx file for editing.

bun run dev

How it Works

When you run tsci dev, we start a local server that uses the @tscircuit/file-server and @tscircuit/runframe (on the browser)

We use commanderjs to define the CLI commands inside of cli/main.ts

Utility functions are defined in lib/*

See local autorouting threads for project thread configuration, runtime requirements, and creating and disposing routing workers.

Development

Dynamically Loading Runframe

Use the RUNFRAME_STANDALONE_FILE_PATH environment variable to point to the runframe standalone file. You will still need to run bun run build inside runframe each time you'd like to load a new version of runframe.

export RUNFRAME_STANDALONE_FILE_PATH=../runframe/dist/standalone.min.js
cd ../runframe && bun run build
cd ../cli && bun run dev

About

Create electronics with React with a local development server

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages