Create a new Forc project in an existing directory


forc init [OPTIONS]



The default program type, excluding all flags or adding this flag creates a basic contract program

-h, --help

Print help information

-L, --log-level <LOG_LEVEL>

Set the log level


Create a package with a library target (src/lib.sw)

--name <NAME>

Set the package name. Defaults to the directory name

--path <PATH>

The directory in which the forc project will be initialized


Create a package with a predicate target (src/

-s, --silent

Silence all output


Create a package with a script target (src/main.sw)

-v, --verbose

Use verbose output


Adding this flag creates an empty workspace


$ mkdir my-fuel-project
$ cd my-fuel-project
$ forc init
$ tree
├── Forc.toml
└── src
    └── main.sw

Forc.toml is the Forc manifest file, containing information about the project and dependencies.

A src/ directory is created, with a single main.sw Sway file in it.