Developer tools
Find more about our XState CLI (Command Line Interface) and Chrome Devtools below. We plan to make extensions for more IDEs (Integrated Development Environments) in the future.
XState CLI (Command Line Interface)
The @xstate/cli (Command Line Interface) package contains commands for running typegen. The package is small right now, but we plan to add more features.
Installation
Run npm install @xstate/cli
.
Commands
xstate typegen <files>
Use the following command to run the typegen against a glob.
xstate typegen "src/**/*.ts?(x)"
Running typegen will scan every targeted file and generate a typegen file to accompany it. It will also import the typegen into your file, as described in our typegen documentation.
Options
xstate typegen "src/**/*.ts?(x)" --watch
Runs the task on a watch, monitoring for changed files and running the typegen script against them.
Chrome Devtools
Quick Start
- Run
npm install
. - Run
npm start
to build the/panel
in development mode. - Go to
chrome://extensions
and Load unpacked this directory (/packages/xstate-dev
). - Select the
XState
extension in the dev tools.