Run without the editor

Open a Project from Python with witwin.studio, run scripts and solvers headless with the witwin command, and record Results.

A Project works without Studio. The witwin-studio Python package (imported as witwin.studio) opens Scenes, edits them, runs solvers and records Results, and installs the witwin command.

Availability

witwin-studio is not on a public package index yet. Studio bundles it for its own use; the standalone release will be announced in the release notes.

Open a Project from Python#

import witwin.studio as ws
 
project = ws.open_project(".")
scene = project.scene()          # the main scene
print(list(scene.objects))

Changes you make through witwin.studio are written to the .wtscene file when you save, and the editor shows them the next time it reads the file. If the Project is open in Studio, witwin.studio finds the running server through .witwin/runtime/server.json and can attach to it.

Run a script#

witwin run scripts/prepare_radar.py

witwin run runs the script with the Project root and the script's folder on sys.path, the same way the Agent and the Run button do.

Run a solver#

List the solvers the Project's Plugins provide, then run one on the main Scene:

witwin solve --list
witwin solve witwin.radar.simulate

The run uses the Project's interpreter and records a Result in the Project, which then appears in Studio's Results panel. If Studio has the Project open, witwin solve sends the run to that server instead of starting its own. Use --no-attach to always run locally, or --attach to require the server.

Pass solver settings with --config file.toml or repeated --set key=value.

Check a Project#

witwin check

witwin check validates witwin.toml and the Scene files. It is a good first step in CI.

See the CLI reference for every command and option.