mcpField
S
sui-build

sui-build

github.com/mystenlabsDevelopment19362 installsUpdated today
Repository

About sui-build

A build and testing guide for Sui Move developers. It covers compilation, environment-specific dependency resolution, coverage, debugging, and installing and using Move Analyzer.

Key features

  1. 01Compile Move modules and validate types
  2. 02Resolve dependencies for a chosen environment
  3. 03Run tests and generate coverage
  4. 04Use Move Analyzer for code editing
  5. 05Diagnose issues with tracing and replay

Use cases

  1. 01Check Move code for build errors
  2. 02Choose a build target for multi-environment packages
  3. 03Assess test coverage
  4. 04Debug tests or onchain transaction issues

MCP support

Recommends querying the Sui documentation MCP server for up-to-date information and details not covered in the guide.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mystenlabs/skills --skill sui-build

After installing, type/sui-buildin Claude Code to confirm it loaded.

Bundled filesevals/evals.json

Details

From the project README

Building Packages

MCP tool: When available in your environment, also query the Sui documentation MCP server (https://sui.mcp.kapa.ai) for up-to-date answers. Use it for verification and for details not covered by these reference files.

Source constraint: All information sourced exclusively from docs.sui.io and move-book.com.

Building

sui move build

This compiles all modules, validates types, enforces resource safety, and produces bytecode. Fix any errors before proceeding.

For the canonical hello-world repository, run build commands from sui-stack-hello-world/move/hello-world.

--build-env flag

When a package has an [environments] section in Move.toml with multiple networks, use --build-env to target a specific environment:

sui move build --build-env testnet
sui move build --build-env mainnet

This resolves dependencies and package addresses for the specified environment. Without --build-env, the build uses the default environment or may fail with "Could not determine the correct dependencies" if multiple environments are defined and no default is set.

The --build-env flag also applies to sui move test:

sui move test --build-env testnet

Testing

sui move test
Key testing modules
  • sui::test_scenario — Multi-transaction, multi-sender test scenarios. Simulates realistic transaction flows with begin, next_tx, and end.
  • std::unit_test — Assertion macros for unit tests (assert_eq!, assert_ne!).
Code coverage

Track which lines your tests exercise:

sui move test --coverage

View coverage results for a specific module:

sui move coverage source --module <name>
Move Analyzer

Install via suiup:

suiup install move-analyzer

Then install the Move Analyzer extension in VS Code. It provides code completion, go-to-definition, inline diagnostics, and hover documentation. It activates automatically for .move files — no additional configuration needed.

Debugging
  • Move Trace Debugger: Step-through debugger for Move execution traces with variable inspection.
  • sui replay: Locally re-execute any past onchain transaction and compare effects. Useful for diagnosing production issues.
  • std::debug::print: Print values during test execution.

Comments

Markdown supported