Fuels CLI
The quickest way to build full stack Fuel dApps.
fuels init
— Creates a newfuels.config.ts
filefuels build
— Buildforc
workspace and generate Typescript types for everythingfuels deploy
— Deploy workspace contracts and save their IDs to JSON filefuels dev
— Start local Fuel Core node andbuild
+deploy
on 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.json
Prerequisites
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 build
requiresforc
. - Deploying contracts locally using
fuels deploy
requiresfuel-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 --save
console
pnpm add fuels@0.92.0
console
bun add fuels@0.92.0
Double-checking
console
npx fuels@0.92.0 -v
Next Step
Use fuels init
to create a fuel.config.ts
file.