Fuels CLI
The quickest way to build full stack Fuel dApps.
fuels init— Creates a newfuels.config.tsfilefuels build— Buildforcworkspace and generate Typescript types for everythingfuels deploy— Deploy workspace contracts and save their IDs to JSON filefuels dev— Start local Fuel Core node andbuild+deployon every file change
Getting started
Imagine you have this file structure:
sh
my-fuel-dapp # NextJS app or similar
├── sway-programs # Forc's workspace
│ ├── src
│ ├── ...
│ └── Forc.toml
├── public
│ └── ...
├── src
│ ├── app
│ ├── ...
├ └── sway-programs-api # Type-safe generated API
└── package.jsonPrerequisites
The Fuel Toolchain and its components (namely forc and fuel-core) are pre-requisite for several operations with the Fuels CLI. For example:
- Building out contracts using
fuels buildrequiresforc. - Deploying contracts locally using
fuels deployrequiresfuel-core.
Follow the installation guide if you don't have them installed already.
Installation
Add it to your my-fuel-dapp project:
console
npm install fuels@0.92.0 --saveconsole
pnpm add fuels@0.92.0console
bun add fuels@0.92.0Double-checking
console
npx fuels@0.92.0 -vNext Step
Use fuels init to create a fuel.config.ts file.
