dx) is the official command-line tool for building, developing, and deploying Dioxus applications. It provides a complete development workflow with hot-reload, asset management, multi-platform builds, and production bundling.
What is the Dioxus CLI?
The Dioxus CLI handles the complex build orchestration required for cross-platform Rust applications:- Development server with hot-reload and hot-patching
- Asset management including Tailwind CSS integration
- Multi-platform builds for web (WASM), desktop, mobile (iOS/Android)
- Production bundling with optimization and code splitting
- Project scaffolding and code formatting
wasm-pack and webpack, the CLI abstracts away platform-specific build complexity.
Installation
Stable Version (Recommended)
Install the latest stable release from crates.io:Development Build
For the latest features and bug fixes, install from the git repository:From Local Source
If you’re contributing to the CLI or testing local modifications:Quick Start
Create a new Dioxus project:- Live hot-reload for instant UI updates
- Development server at
http://localhost:8080 - Automatic browser opening
- File watching for changes
Core Features
Hot-Reload System
Dioxus CLI provides two complementary hot-reload mechanisms: RSX Template Hot-Reload: Instant UI updates when changing RSX templates without full recompilation. Changes to literal values, attributes, and component children are applied in milliseconds. Subsecond Hot-Patching: Full Rust code hot-reload through jump table indirection. Modified functions are recompiled and patched into the running application without restart.Multi-Platform Support
Build for any platform from a single codebase:Asset Management
Automatic handling of assets through theasset!() macro:
- Compile-time asset resolution
- Hash-based cache busting
- Platform-specific asset bundling
- Tailwind CSS integration with auto-installation
Development Tools
dx serve- Development server with hot-reloaddx build- Production builds with optimizationdx bundle- Platform-specific app bundlesdx check- Lint and check your codedx fmt- Format RSX macrosdx doctor- Diagnose installation and configuration
Architecture
The CLI orchestrates multiple build tools:- Cargo - Rust compilation
- wasm-bindgen - WASM JavaScript bindings (auto-managed)
- wasm-opt - WASM optimization (auto-installed)
- Tailwind CSS - Styling (auto-installed when detected)
- Platform bundlers - iOS, Android, desktop packaging
Configuration
Projects are configured throughDioxus.toml:
Workspace Support
The CLI supports Cargo workspaces with package selection:Getting Help
Every command has detailed help:dx serve:
r- Trigger rebuildp- Toggle automatic rebuildsv- Toggle verbose logging/- Show all commandsCtrl+C- Exit
Next Steps
Commands
Explore all available CLI commands
Configuration
Configure Dioxus.toml for your project
Hot-Reload
Learn about the hot-reload system
Bundling
Package apps for production