Skip to main content

Installation

Dependencies

To use tscircuit, you'll need to have npm or bun installed. We recommend using bun for its speed and ease of use.

Installing tscircuit

To install tscircuit's command line tool, just run:

npm install -g tscircuit

# or

bun install --global tscircuit

This will install a tsci command globally!

info

If you're using tscircuit online, you can skip installation. tscircuit is fully-featured and usable online!

You can test it out by running tsci --help!

tsci --help

Usage: tsci [options] [command]

CLI for developing tscircuit snippets

# Options:
# -V, --version output the version number
# -h, --help display help for command

# Commands:
# init Initialize a new TSCircuit project in the current directory
# dev [options] [file] Start development server for a snippet
# clone <snippet> Clone a snippet from the registry
# auth Login/logout
# login Login to tscircuit registry
# config Manage tscircuit CLI configuration
# export [options] <file> Export tscircuit code to various formats
# help [command] display help for command

You can also run tsci without any arguments to start the interactive CLI.

tsci

# ? Choose command ›
# ❯ tsci init - Initialize a new TSCircuit project in the current directory
# tsci dev - Start development server for a snippet
# tsci clone - Clone a snippet from the registry
# tsci auth - Login/logout
# tsci login - Login to tscircuit registry
# tsci config - Manage tscircuit CLI configuration
# tsci export - Export tscircuit code to various formats

Creating a new project

The easiest way to create a template project is to use tsci init inside a project directory.

mkdir my-project

cd my-project

tsci init

This will bootstrap a fresh tscircuit project! Read more about starting the development server and exporting files in our Quickstart CLI Guide.

Installing tscircuit per project

You can install tscircuit on a per-project basis by installing it as a dev dependency.

npm add -D tscircuit

# or

bun add -D tscircuit

Next Steps

Now that you've installed tscircuit, you can start developing your first electronic device!