sui move command provides tools for developing Move smart contracts on Sui.
Synopsis
Global Options
path
Path to a package which the command should be run with respect to
path
Path to client configuration file
string
The Sui environment to use
Build Configuration Options
These options are available for most commands:string
Build environment for the package
string
Build mode(s) to use
boolean
Enable dev mode
boolean
Enable test mode
Commands
build
Build a Move package.boolean
Dump package bytecode as Base64
boolean
Build with unpublished dependencies (addresses set to 0x0)
boolean
Skip tree shaking optimization
- Build summary
- Module compilation status
- Package digest
- Build artifacts location
test
Run Move unit tests.string
Optional filter string to run specific tests matching the pattern
boolean
Enable coverage collection during tests
u64
Gas limit for running tests (default: 1000000000)
boolean
List all tests without running them
coverage
Generate coverage report for Move tests.string
Output format:
text, html, lcov, or summary (default: summary)path
Output file or directory for coverage data
sui move test --coverage first to generate coverage data.
Example:
disassemble
Disassemble Move bytecode.migrate
Migrate a Move package to the latest syntax and format.new
Create a new Move package.string
required
Name of the new package
summary
Generate a package summary.ObjectID
Generate summary for an on-chain package
boolean
Generate bytecode-based summary
update-deps
Update Move package dependencies.Move.toml to their latest compatible versions.
Example:
Package Structure
A typical Sui Move package structure:Move.toml Configuration
TheMove.toml file configures your package:
Writing Tests
Move unit tests use the#[test] attribute:
Test Attributes
attribute
Marks a function as a test
attribute
Marks code that is only compiled in test mode
attribute
Marks a test that is expected to fail
parameter
Expected abort code for
#[expected_failure]Build Modes
Sui Move supports different build modes:- Default: Standard build for deployment
- Test: Includes test code and test-only dependencies
- Dev: Development mode with additional checks