fx is the entry-point for a set of subcommands that make many tasks related to Fuchsia development easier.
It contains a large number of subcommands. Run fx help to see all the available subcommands.
If you use bash or zsh as a shell, source scripts/fx-env.sh
to get some auto-completion.
Also see the global options and flags that affect all subcommands.
fx subcommands
Main subcommands
Subcommands that are part of the fx workflow.
| Command | Category | Description | 
|---|---|---|
| add-update-source | Software delivery | register a repository package server as a device's update source | 
| args | Build | manually edit args.gn for the current build directory | 
| atomic-commit | Other | Create a pair of changes that will be submitted atomically. It will modify | 
| bazel | Build | Run experimental Bazel build for Fuchsia platform tree | 
| bazel-tool | Build | Run the bazel-tool script in the Fuchsia Bazel workspace. | 
| bootfs-size-report | Run, inspect and debug | produce an uncompressed size report from a ZBI | 
| build | Build | Run Ninja to build Fuchsia | 
| build-metrics | Other | manage build metrics configuration | 
| build-profile | Other | manage build profile configuration | 
| cipd | Source tree | run the cipd command line tool | 
| clean | Build | clean the current Fuchsia build artifacts | 
| clean-build | Build | Clean the build directory and then perform a full build | 
| cleandead | Build | Delete stale generated files in the build output directory. | 
| cleandead-build | Build | Delete stale generated files and then perform a full build. | 
| cmc | Build | Component manifest compiler | 
| cp | Device management | copy a file to/from a target device | 
| create-pb-zip | Other | Create pb.zip suitable for flashing based on product_bundles.json file. | 
| create | Source tree | Scaffold new projects | 
| doc-checker | Code submission and review | Check the markdown documentation using a variety of checks. | 
| exec | Other | read the current build config, then exec | 
| fargo | Build | Fargo is a prototype Fuchsia-specific wrapper around Cargo | 
| fetch-build-artifacts | Build | TODO(https://fxbug.dev/42139110): under construction. | 
| flash | Device management | flash a connected device | 
| flash-remote | Other | Remotely build, fetch and flash a Fuchsia image onto a device, see https://fuchsia.dev/fuchsia-src/development/sdk/ffx/flash-a-device | 
| format-code | Source tree | runs source formatters on modified files | 
| gen | Build | run gn genagainst the Fuchsia build directories. | 
| get-build-artifacts | Internal api | DEPRECATED! Renamed to list-build-artifacts | 
| get-build-dir | Build | print the current fuchsia build directory | 
| get-device | Device discovery | print the current selected device name | 
| get-device-addr | Device discovery | print the Fuchsia address of the current selected device | 
| get-flash-source | Internal api | Builds and returns a list of a desired set of build artifacts | 
| get-src-dir | Build | print the Fuchsia source directory (checkout root, aka "//") | 
| get-workspace-dir | Build | print the Bazel workspace directory | 
| gn | Build | meta-build system that generates build files for Ninja | 
| go | Build | Manage Go source code | 
| helpdoc | Documentation | create markdown docs for fx subcommands | 
| host-tool | Run, inspect and debug | run a host tool produced by the build | 
| is-package-server-running | Software delivery | check if the package server is running | 
| jiri | Source tree | multi-purpose tool for multi-repo development. | 
| jq | Other | jq is a utility for manipulating JSON on the command-line. | 
| jq5 | Build | Extends the functionality of jq to json5 objects. | 
| klog | Run, inspect and debug | listen for kernel logs | 
| list-boards | Build | list boards available for building | 
| list-build-artifacts | Internal api | Builds and returns a list of a desired set of build artifacts | 
| list-devices | Device discovery | list all nearby devices (excluding those on zedboot) | 
| list-products | Build | list products available for building | 
| list-usb-disks | Other | list attached usb disks | 
| local-publish-platform | Other | Release platform artifacts to local CIPD instances. | 
| log | Run, inspect and debug | Display logs from a target device. | 
| mdlint | Code submission and review | Markdown linter | 
| merge-package-config | Other | |
| metrics | Other | manage collection of metrics in fx tools | 
| mkzedboot | Software delivery | make a zedboot USB key | 
| mkzedboot-remote | Software delivery | make a zedboot USB key | 
| multi | Other | Run an fxcommand across multiple build directories. | 
| netaddr | Device discovery | get the address of a running fuchsia system | 
| netboot | Software delivery | run bootserver for netbooting | 
| netboot-remote | Other | Remotely build, fetch and netboot | 
| netls | Device discovery | list running fuchsia systems on the local network | 
| ninja | Build | directly run the build system. Don't use for regular workflows. | 
| ninjatrace2json | Build | Collect Ninja trace information for analysis in chrome://tracing | 
| node-names | Device management | find other names for the same node | 
| ota | Software delivery | perform a system OTA on a connected device | 
| qemu | Run, inspect and debug | start fuchsia in qemu with a FVM disk | 
| rbe | Build | check remote build configuration | 
| reboot | Device management | reboot a target fuchsia system | 
| repro | Build | Locally replicate the result of infra builds and tests | 
| resultstore | Build | Manage build ResultStore configuration. ResultStore is a service | 
| rfc | Source tree | Scaffold new RFCs | 
| run-host-tests | Test | DEPRECATED! build and run tests on host | 
| run-in-build-dir | Build | Run the given command at the root of the current build directory | 
| run-netboot | Run, inspect and debug | start fuchsia in qemu via netboot | 
| run-script | Other | Run a custom combination of commands, able to take advantage of fx -i(iterative mode) | 
| scp | Device management | invoke scp with the build ssh config | 
| sdk-deps | Other | List the dependencies of a target, and if dependencies are in SDK | 
| self-build | Build | build the minimal host dependencies to run fx main workflows | 
| self-test | Test | run tests of fx and subcommands | 
| serial | Device management | attach to a serial console | 
| serve | Software delivery | start the update server and attach to a running fuchsia device | 
| serve-remote | Other | serve from a remote workstation | 
| set | Build | set up a build directory | 
| set-build-dir | Build | set the default build directory used by other fx commands | 
| set-device | Device discovery | set the default device to interact with | 
| set-main-pb | Build | set which product bundle to build in a multi-product environment | 
| setup-firewall | Other | setup Linux firewall rules to allow Fuchsia device and emulator traffic. | 
| setup-mcp-servers | Other | |
| setup-ufw | Other | setup Linux firewall rules to allow Fuchsia device and emulator traffic. | 
| sftp | Device management | invoke sftp with the build ssh config | 
| shell | Device management | start a remote interactive shell in the target device | 
| ssh | Device management | invoke ssh with the ssh keys and configuration for Fuchsia devices. | 
| status | Other | print relevant information about the developer setup | 
| sync-to | Source tree | Sync the local Fuchsia source tree to a given state | 
| syslog | Run, inspect and debug | DEPRECATED! deprecated alias for fx log | 
| test | Test | Entry point for all Fuchsia tests (host, target, and end-to-end) | 
| testgen | Test | Component integration test auto-generator | 
| unset-device | Device discovery | unset the default device to interact with | 
| update | Software delivery | DEPRECATED! deprecated alias for fx ota | 
| update-if-in-base | Software delivery | check if packages are in base and update the device if needed | 
| use | Build | re-use a previous build directory set up by fx set | 
| vendor | Other | forward commands to vendor/*/scripts/devshell | 
| wait | Device management | wait for a shell to become available | 
Contrib subcommands
Subcommands that have been contributed by project members that have other levels of support, ownership, or both. The OWNERS file in the contrib directory provides a pointer to the member that supports each script.
| Command | Category | Description | 
|---|---|---|
| add-host-test | Build | add a GN label to args.gn and regen | 
| add-test | Build | add a GN label to args.gn and regen | 
| arm-esr | Other | decode ARM Exception Syndrome Register values | 
| bazel2gn | Source tree | Syncs BUILD.gn and BUILD.bazel for targets that are dual-building in both. | 
| bindc | Run, inspect and debug | run the bind program compiler and debugger | 
| binutils | Run, inspect and debug | Provides a shortcut to the prebuilt LLVM binutils tools | 
| bisect-rustc | Other | |
| blobstats | Run, inspect and debug | compute some blobfs statistics from the build | 
| bt-snoop-from-snapshot | Run, inspect and debug | extract a snoop log from a snapshot as pcap formatted data | 
| build-main-pb | Build | build the current default product bundle | 
| check-deps | Build | checks dependency graph in areas | 
| check-goldens | Source tree | Checks all golden file comparisons in the GN build graph. | 
| check-licenses | Documentation | analyze the license state of a given package or directory | 
| cl | Code submission and review | Print the gerrit review URL and attempts to open it in the user's default browser. | 
| clang-tidy | Source tree | runs clang-tidy on specified files | 
| clippy | Other | Runs a Rust helper script inside the fx environment under the lock | 
| clippy | Diagnostic | |
| compdb | Build | DEPRECATED | 
| core-tests | Test | run zircon core-tests | 
| coverage | Test | Runs test and exports coverage data. | 
| cpu-stats | Run, inspect and debug | generate a report of CPU stats from a snapshot | 
| crosvm | Run, inspect and debug | Run crosvm | 
| dis | Build | Disassembles a given binary in the build. | 
| download-rust-toolchain | Toolchain | Download the Rust toolchain to the latest green build from toolchain.ci | 
| dupefinder | Run, inspect and debug | Report on duplicate allocations from a heap dump. | 
| exec-host-tests | Test | |
| extract-pprof | Run, inspect and debug | Extract pprof data from inspect.json | 
| extract-zbi | Other | |
| fastboot | Device management | interact directly with a device's bootloader via the fastboot protocol | 
| ffx | Other | execute ffx - developer tools for fuchsia devices. | 
| fidlcat | Run, inspect and debug | Deprecated, please use "ffx debug fidl" | 
| fidldoc | Documentation | generate documentation for FIDL | 
| fidltags | Other | generate tags for .fidl files | 
| find-owner | Other | |
| flash-kola | Other | Flash Fuchsia onto a Kola board that has an unmodified bootloader. | 
| force-ota-from-devhost | Software delivery | force an Over The Air system update from devhost (reboots!) | 
| fuzz | Run, inspect and debug | DEPRECATED! run a fuzz test on target a device | 
| g-review | Code submission and review | Perform a Gemini review on the current commit | 
| gc | Software delivery | garbage collect packages on the target (reboots!) | 
| gce | Other | Google Compute Engine commands | 
| gdb | Run, inspect and debug | Run GDB, the GNU DeBugger. | 
| gen-cargo | Other | Runs a Rust helper script inside the fx environment | 
| gen-cargo | Source tree | generate symlinks to Rust Cargo.toml output files | 
| gen-watchman-config | Developer tools | generates a .watchmanconfig file for use with jj | 
| gerrit-split-cl | Code submission and review | Submits chains of CLs to Gerrit | 
| gerrit-submit | Code submission and review | Submits chains of CLs to Gerrit | 
| get-main-pb-path | Build | get the output path to the provided product bundle | 
| gnu | Run, inspect and debug | Provides a shortcut to the prebuilt GNU (binutils / GCC) tools | 
| grep | Source tree | print lines in the Fuchsia sources matching the given pattern | 
| gum | Other | gum is a utility for adding interactivity to scripts | 
| iquery | Other | |
| lint | Source tree | runs source linters on modified files | 
| list-owners | Source tree | Finds the nearest OWNERS file corresponding to the provided path, or the | 
| list-packages | Build | List which packages are built. | 
| llvm | Run, inspect and debug | Provides a shortcut to the prebuilt Clang / LLVM tools | 
| ls-buildid | Build | Find binaries among build directories, the checkout, and cloud storage | 
| make-fuchsia-vol | Other | build a fuchsia persistent disk | 
| mkinstaller | Software delivery | make a Fuchsia installer image | 
| mkinstaller-remote | Software delivery | make a Fuchsia installer image from a remote build host | 
| move-docs | Documentation | Helper tool to batch move docs from one location to another | 
| pending-commits | Source tree | view commits not yet published to global integration | 
| pprof | Run, inspect and debug | pprof wrapper that gives access to local files in symbol-index | 
| publish | Software delivery | publish a set of packages | 
| qemu-cipd-ensure | Other | Generate CIPD files to download the current QEMU package. | 
| refresh-bazel-compdb | Other | |
| remove-update-source | Software delivery | unregister a repository package server as a device's update source | 
| roll-compiler | Other | |
| run-boot-test | Run, inspect and debug | Run a ZBI test | 
| run-boot-test.py | Other | |
| run-e2e-tests | Test | run e2e tests | 
| run-in-build | Run, inspect and debug | Run a command in the build directory | 
| run-recovery | Run, inspect and debug | start Fuchsia System Recovery in qemu | 
| run-zbi-test-remote | Run, inspect and debug | Remotely build a ZBI test, fetch and run it | 
| rust-3p-outdated | Other | Runs a Rust helper script inside the fx environment under the lock | 
| rust-3p-outdated | Diagnostic | |
| rustdoc-link | Other | Runs a Rust helper script inside the fx environment | 
| rustdoc-link | Documentation | Link generated documentation for Rust code. Replaces fx rustdoc | 
| set-petal | Source tree | configure jiri to manage a specific petal | 
| set-relay | Other | Actuates the state of an external relay by writing a single byte to |tty|. | 
| setup-go | Other | Set up the checkout for Go development. | 
| setup-usb-ethernet | Other | Setup udev rules for USB CDC ethernet | 
| show-package | Software delivery | lists package contents | 
| shush | Source tree | silence rust lints with allows or compiler suggested fixes | 
| size-check | Other | Convenience wrapper for running the product size checker. | 
| smoke-test | Other | Runs a Python helper script inside the fx environment | 
| smoke-test | Test | Finds and runs tests affected by the current change. | 
| snapshot | Run, inspect and debug | Obtain and parse a snapshot from a connected target. | 
| sniff | Run, inspect and debug | Fuchsia packet capture and display tool | 
| sniff.py | Other | |
| sync-from-stem | Source tree | sync integration and deps to a state matching fuchsia.git state | 
| system-status | Device management | Get a summary of system status | 
| test-rustdoc | Test | runs "fx rustdoc" on all rust targets | 
| test-stats | Test | Query and calculate test stats. | 
| test-stats.py | Test | Query and calculate test stats. | 
| triage | Run, inspect and debug | generate a report of error conditions, with Google-specific rules. | 
| unarchive-package | Software delivery | unarchive a Fuchsia package archive in FAR format | 
| update-3p-owners | Source tree | updates OWNERS files for third_party dependencies | 
| update-bazel-vendor-dir | Build | Update the Bazel vendor directory to include all necessary Bazel deps. | 
| update-rust-3p-outdated | Source tree | updates external Rust dependencies with latest from crates.io | 
| update-rustc-third-party | Source tree | updates rustc_library and rustc_binary third_party dependencies | 
| zbi_json_to_d3js.py | Other | |
| zedmon | Other | run zedmon client | 
| zxdb | Run, inspect and debug | Deprecated, please use "ffx debug connect" |