Skip to content
Logo

Project Setup

Foundry projects are initialized with forge init and follow a standard layout that works out of the box.

Creating a project

Initialize a new project

$ forge init my_project
$ cd my_project

Or initialize in an existing directory

$ cd existing_directory
$ forge init

The --force flag initializes in non-empty directories:

$ forge init --force

Initialization options

FlagDescription
--template <url>Use a custom template repository
--no-gitSkip git repository initialization
--no-commitSkip initial commit
--shallowPerform shallow clone for template
--offlineSkip dependency installation
--vscodeGenerate VS Code settings
Create from template
$ forge init --template https://github.com/PaulRBerg/foundry-template my_project
Initialize without git
$ forge init --no-git my_project

What gets created

A new project includes:

    • foundry.tomlProject configuration
      • Counter.solExample contract
      • Counter.t.solExample test
      • Counter.s.solExample script
      • Standard library

Learn more