Project Setup
Foundry projects are initialized with forge init and follow a standard layout that works out of the box.
Creating a project
The --force flag initializes in non-empty directories:
$ forge init --forceInitialization options
| Flag | Description |
|---|---|
--template <url> | Use a custom template repository |
--no-git | Skip git repository initialization |
--no-commit | Skip initial commit |
--shallow | Perform shallow clone for template |
--offline | Skip dependency installation |
--vscode | Generate VS Code settings |
Create from template
$ forge init --template https://github.com/PaulRBerg/foundry-template my_projectInitialize without git
$ forge init --no-git my_projectWhat gets created
A new project includes:
- foundry.tomlProject configuration
- Counter.solExample contract
- Counter.t.solExample test
- Counter.s.solExample script
- Standard library
Learn more
- Project layout — Directory structure and conventions
- Dependencies — Managing external libraries
- Soldeer — Alternative package manager
Was this helpful?
