ffx provides a unified platform for Fuchsia CLI tools for host target interactions. It introduces a service oriented interface to many common development and integration workflow operations that users may wish to perform against one or more Fuchsia target devices.
It is both a service runtime, and a collection of utilities, and it is intended for both users and infrastructure integrators alike.
Getting started for users
Review the user guide for using the ffx command line tool.
Getting started for developers
When extending or adding a new plugin for
ffx it is important to
consider the following:
ffxis developed in Rust and makes heavy use of rust crates. However, crates must be hosted in the Fuchsia Platform Source Tree. This process is detailed in Open Source Review Board (OSRB) process document. Review existing crates in
- When extending
ffx, review the existing command surface by running
ffx helpto understand where the new command or tool may fit.
- When extending an existing command, consider adding a flag or an option. However, if the overall workflow enabled does not exist, consider a new command or a higher level subgrouping.
- Consider the dependencies such as which FIDL services, local filesystem entries, target filesystem paths, or any manifests/manifest formats the tool depends on.
- Consider how the command interacts with multiple devices.
ffxprovides a global
--targetflag that can be passed multiple times to execute commands across multiple targets in parallel.
- Does the command need access to configurations or depend on a specific
build environment? If so, take advantage of the various configuration
ffxor define new ones for the specific command or workflow. Existing configurations can be accessed via
ffx config get.
A detailed guide with examples is available in developing for ffx.
The Command Line Interface (CLI) provides the UX for ffx. It is responsible for:
- Parsing user parameters (CLI Parameters)
- Communicating with the daemon (starting it if necessary)
- Routing parsed parameters and requested FIDL proxies to the proper code path for execution
The daemon runs in the background on the host device and manages:
- Target discovery
- Target life cycle management (flashing, provisioning, and package serving)
- Facilitating communication with target devices
Remote control service
The remote control service runs on target devices and is responsible for providing access to the FIDL services running on the target.