Skip to main content
The 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
Example:
Output: Successful builds display:
  • 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
Example:
Test Output:

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
Prerequisites: Must run sui move test --coverage first to generate coverage data. Example:

disassemble

Disassemble Move bytecode.
Disassembles compiled Move modules to readable bytecode. Example:

migrate

Migrate a Move package to the latest syntax and format.
Updates Move source code to match current language version. Example:

new

Create a new Move package.
string
required
Name of the new package
Example:
Creates a new directory with:
Generated Move.toml:

summary

Generate a package summary.
ObjectID
Generate summary for an on-chain package
boolean
Generate bytecode-based summary
Example:

update-deps

Update Move package dependencies.
Updates dependencies defined in Move.toml to their latest compatible versions. Example:

Package Structure

A typical Sui Move package structure:

Move.toml Configuration

The Move.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

Common Workflows

Creating a New Package

Development Cycle

Working with Dependencies

Examples

Simple Counter Module

Running the Example

Troubleshooting

Build Errors

Module not found:
Address resolution failed:

Test Failures

Dependency Issues