apps/docs/src/guide/fuels-cli/config-file.md
Here, you can learn more about all configuration options.
workspaceRelative directory path to Forc workspace.
<<< @/../../demo-fuels/fuels.config.full.ts#workspace{ts:line-numbers}
The property
workspaceis incompatible withcontracts,predicates, andscripts.
contractsList of relative directory paths to Sway contracts.
<<< @/../../demo-fuels/fuels.config.full.ts#contracts{ts:line-numbers}
The property
contractsis incompatible withworkspace.
predicatesList of relative directory paths to Sway predicates.
<<< @/../../demo-fuels/fuels.config.full.ts#predicates{ts:line-numbers}
The property
predicatesis incompatible withworkspace.
scriptsList of relative directory paths to Sway scripts.
<<< @/../../demo-fuels/fuels.config.full.ts#scripts{ts:line-numbers}
The property
scriptsis incompatible withworkspace.
outputRelative directory path to use when generating Typescript definitions.
<<< @/../../demo-fuels/fuels.config.full.ts#output{ts:line-numbers}
providerUrlThe URL to use when deploying contracts.
<<< @/../../demo-fuels/fuels.config.full.ts#providerUrl{ts:line-numbers}
When
autostartFuelCoreproperty is set totrue, theprovidedUrlis overridden by that of the local short-livedfuel-corenode started by thefuels devcommand.
privateKeyWallet private key, used when deploying contracts.
This property should ideally come from env — process.env.MY_PRIVATE_KEY.
<<< @/../../demo-fuels/fuels.config.full.ts#privateKey{ts:line-numbers}
When
autostartFuelCoreproperty is set totrue, theprivateKeyis overridden with theconsensusKeyof the local short-livedfuel-corenode started by thefuels devcommand.
snapshotDir
- Used by
fuels devonly.
Relative path to directory containing custom configurations for fuel-core, such as:
chainConfig.jsonmetadata.jsonstateConfig.jsonThis will take effect only when autoStartFuelCore is true.
<<< @/../../demo-fuels/fuels.config.full.ts#snapshotDir{ts:line-numbers}
autoStartFuelCore
- Used by
fuels devonly.
When set to true, it will automatically:
fuel-core node as part of the fuels dev commandproviderUrl with the URL for the recently started fuel-core node<<< @/../../demo-fuels/fuels.config.full.ts#autoStartFuelCore{ts:line-numbers}
If set to false, you must spin up a fuel-core node by yourself and set the URL for it via providerUrl.
fuelCorePort
- Used by
fuels devonly.- Ignored when
autoStartFuelCoreis set tofalse.
Port to use when starting a local fuel-core node.
<<< @/../../demo-fuels/fuels.config.full.ts#fuelCorePort{ts:line-numbers}
forcBuildFlags
- Used by
fuels buildandfuels deploy.
Sway programs are compiled in debug mode by default.
Here you can customize all build flags, e.g. to build programs in release mode.
<<< @/../../demo-fuels/fuels.config.full.ts#forcBuildFlags{ts:line-numbers}
Check also:
deployConfigYou can supply a ready-to-go deploy configuration object:
<<< @/../../demo-fuels/fuels.config.full.ts#deployConfig-obj{ts:line-numbers}
Or use a function for crafting dynamic deployment flows:
options.contracts property to get the necessary contract ID. For example:<<< @/../../demo-fuels/fuels.config.full.ts#deployConfig-fn{ts:line-numbers}
onBuildA callback function that is called after a build event has been successful.
Parameters:
config — The loaded config (fuels.config.ts)<<< @/../../demo-fuels/fuels.config.full.ts#onBuild{ts:line-numbers}
onDeployA callback function that is called after a deployment event has been successful.
Parameters:
config — The loaded config (fuels.config.ts)data — The data (an array of deployed contracts)<<< @/../../demo-fuels/fuels.config.full.ts#onDeploy{ts:line-numbers}
onDevA callback function that is called after the fuels dev command has successfully restarted.
Parameters:
config — The loaded config (fuels.config.ts)<<< @/../../demo-fuels/fuels.config.full.ts#onDev{ts:line-numbers}
onNodeA callback function that is called after the fuels node command has successfully refreshed.
Parameters:
config — The loaded config (fuels.config.ts)<<< @/../../demo-fuels/fuels.config.full.ts#onNode{ts:line-numbers}
onFailurePass a callback function to be called in case of errors.
Parameters:
config — The loaded config (fuels.config.ts)error — Original error object<<< @/../../demo-fuels/fuels.config.full.ts#onFailure{ts:line-numbers}
forcPathPath to the forc binary.
When not supplied, will default to using the system binaries (forc).
<<< @/../../demo-fuels/fuels.config.full.ts#forcPath{ts:line-numbers}
fuelCorePathPath to the fuel-core binary.
When not supplied, will default to using the system binaries (fuel-core).
<<< @/../../demo-fuels/fuels.config.full.ts#fuelCorePath{ts:line-numbers}
If you want to load environment variables from a .env file, you can use the dotenv package.
First, install it:
::: code-group
pnpm install dotenv
npm install dotenv
bun install dotenv
:::
Then, you can use it in your fuels.config.ts file:
<<< @/../../create-fuels-counter-guide/fuels.config.ts#fuels-config-file-env{ts:line-numbers}