Choose commands to format, check, test, run, and build your Topaz program. Start with a single file or use a package to keep several files and dependencies together.
Install topaz using First Program. The package example below uses the completed study-plan project from First Application.
Choose a file or a package
For the first-program.tpz from First Program, run these commands in its folder.
topaz check first-program.tpz
topaz run first-program.tpzThe check exits with code 0. The program prints Topaz basics: 25 minutes. For a package, run the following commands inside study-plan, next to topaz.toml and its generated topaz.lock.
topaz fmt --check --root .
topaz check --root . --locked
topaz test tests/plan.tpz --root . --locked
topaz run --root . --locked
topaz build --root . --locked --out-dir product| Command | Result to check |
|---|---|
fmt --check | Exit code 0 means the source follows Topaz formatting. If files differ, run topaz fmt --root . and check again. |
check | Exit code 0 means syntax, names, imports, and types passed checking. The program has not run. |
test tests/plan.tpz | Runs the selected test file. A successful test reports test-ok. |
run | Prints tasks=2, remaining=25 minutes for the study planner. |
build | Creates product/ with the executable and topaz-artifact.json, which records the generated files. |
With no file argument, package commands use the entry in topaz.toml. Specify a test file to test it. --locked checks the manifest and local dependency contents against topaz.lock. The package guide explains how to create or update that file.
build creates the files you distribute. Native and Web builds need the Rust toolchain for their target. Choose a target in Interpreter & Backends, then follow Artifacts & Deployment.
Use the compiler in your editor
The default self compiler is written in Topaz and included in the installed executable. To compare its behavior with the Rust reference compiler, select --compiler rust. See Toolchain Status for installation details.
Install the official extension from Visual Studio Marketplace for VS Code or Open VSX Registry for VSCodium and compatible editors.
Both stores provide the same extension. It recognizes .tpz files and supplies the file icon, syntax highlighting, comment and bracket settings, and basic snippets. It starts the installed topaz lsp server to show compiler diagnostics.
Install the compiler separately. If it is missing, the editor reports the missing executable while highlighting and static editing features remain available. Set topaz.executablePath if topaz is not on PATH.
Continue after an error
If a command exits nonzero, fix the first diagnostic and repeat that command. CLI & Diagnostics explains the options and error codes.
If a build reports a missing Rust toolchain, install it for the selected target. If files in an existing output directory have changed, preserve that directory and choose a new empty --out-dir.