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 theinit command to configure your project for Wokwi. Run the following command in your project’s root directory:
Run a Simulation
To run the simulation, use the following command:CLI Options
You can use the following options to customize the CLI behavior:Configuration
ELF file to simulate (default: read from wokwi.toml)
Path to the diagram.json file, relative to project root (default: diagram.json)
Redirect stdin to the simulated serial port
Save the serial monitor output to the given file
Timeout in simulation milliseconds (default: 30000)
Process exit code when timeout is reached (default: 42)
Automation
Expect the given text in the output
Fail if the given text is found in the output
Path to an automation scenario file, relative to project root
Take a screenshot of the given part id (from diagram.json)
Time in simulation milliseconds to take the screenshot
File name to save the screenshot to (default: screenshot.png)
Export Logic Analyzer data to a VCD file
General
Prints help information and exit (alias:
-h)Quiet: do not print version or status messages (alias:
-q)Linting Diagrams
Thelint 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.