Skip to content

Watch Mode

Watch mode is a flag on the build command that re-runs your build (or tests) automatically whenever source files change.

Terminal window
# Watch and rebuild on change
sui-runner build --watch
# Watch and re-run tests on change
sui-runner build --watch --test

Sui-runner polls the following paths every 500 ms:

PathNotes
sources/Watched recursively — any .move file change triggers a rebuild
tests/Watched if the directory exists
Move.tomlTriggers a rebuild when the manifest changes

The build command also accepts these flags independently of watch mode:

FlagDescription
--testRun tests instead of building
--filter <name>Only run tests whose name contains <name>
--skip-fetchSkip fetching git dependencies
--docGenerate Move documentation
--path <dir>Path to the Move package (defaults to current directory)
Terminal window
# Build the current package
sui-runner build
# Run all tests
sui-runner build --test
# Run only tests matching "transfer"
sui-runner build --test --filter transfer
# Watch and re-run a specific test suite
sui-runner build --watch --test --filter transfer