Skip to main content
Create an API token on the Wokwi CI Dashboard. Set the WOKWI_CLI_TOKEN environment variable to the token value.

Initialize Your Project

If you haven’t set up your project for Wokwi yet, you can use the init command to configure your project for Wokwi. Run the following command in your project’s root directory:
This command will ask you a few questions and will automatically generate wokwi.toml and diagram.json files for your project.

Run a Simulation

To run the simulation, use the following command:
The CLI will start the simulation and display the serial output. It will automatically exit after 30 seconds.

CLI Options

You can use the following options to customize the CLI behavior:

Configuration

string
ELF file to simulate (default: read from wokwi.toml)
string
Path to the diagram.json file, relative to project root (default: diagram.json)
boolean
Redirect stdin to the simulated serial port
string
Save the serial monitor output to the given file
number
Timeout in simulation milliseconds (default: 30000)
number
Process exit code when timeout is reached (default: 42)

Automation

string
Expect the given text in the output
string
Fail if the given text is found in the output
string
Path to an automation scenario file, relative to project root
string
Take a screenshot of the given part id (from diagram.json)
number
Time in simulation milliseconds to take the screenshot
string
File name to save the screenshot to (default: screenshot.png)
string
Export Logic Analyzer data to a VCD file

General

boolean
Prints help information and exit (alias: -h)
boolean
Quiet: do not print version or status messages (alias: -q)

Linting Diagrams

The lint command validates your diagram.json file for errors and warnings before running a simulation:
The linter checks for common issues such as unknown part types, invalid pin connections, and missing components. By default, it fetches the latest board definitions from the Wokwi registry to ensure accurate validation.