Tools

Dioxus has an ecosystem of tools to help you develop and deploy your applications. This guide will help you set up, configure and use these tools.

Installing the CLI

The CLI bundles together many different tools for dioxus development. Dioxus provides prebuilt binaries for Windows, macOS, and Linux you can download with cargo-binstall:

cargo binstall dioxus-cli

Manual installation

If you don't have cargo-binstall installed or we don't have a prebuilt binary for your platform, you can install the CLI with manually with cargo install:

cargo install dioxus-cli

Commands

To verify your installation and get an overview of all the commands available, run:

dx --help

You should see something like this:

Dioxus: build web, desktop, and mobile apps with a single codebase

Usage: dx [OPTIONS] <COMMAND>

Commands:
  new          Create a new Dioxus project
  serve        Build, watch, and serve the project
  bundle       Bundle the Dioxus app into a shippable object
  build        Build the Dioxus project and all of its assets
  run          Run the project without any hotreloading
  init         Init a new project for Dioxus in the current directory (by default). Will attempt to keep your project in a good state
  doctor       Diagnose installed tools and system configuration
  print        Print project information in a structured format, like cargo args, linker args, and other flags DX sets that might be useful in third-party tools
  translate    Translate a source file into Dioxus code
  fmt          Automatically format RSX
  check        Check the project for any issues
  config       Dioxus config file controls
  self-update  Update the Dioxus CLI to the latest version
  tools        Run a dioxus build tool. IE `build-assets`, `hotpatch`, etc
  components   Manage components from the `dioxus-component` registry
  help         Print this message or the help of the given subcommand(s)

Options:
      --verbose      Use verbose output [default: false]
      --trace        Use trace output [default: false]
      --json-output  Output logs in JSON format
  -h, --help         Print help
  -V, --version      Print version

Logging Options:
      --log-to-file <LOG_TO_FILE>  Write *all* logs to a file

Manifest Options:
      --locked   Assert that `Cargo.lock` will remain unchanged
      --offline  Run without accessing the network
      --frozen   Equivalent to specifying both --locked and --offline

Table of Contents

Many chapters in this guide cover different commands in the CLI:

  • Create a project provides an overview of the dx new and dx init commands to scaffold your dioxus project
  • Translate HTML provides an overview of the dx translate command to convert HTML into rsx.

Other chapters explore different aspects of using the CLI and other tools:

  • Configure Project explores how you can configure your project with the Dioxus.toml file the CLI reads