This section provides an overview of the forge
command line tool. We demonstrate how to create a new project, compile, and test it.
To start a new project with Foundry, use forge init
:
{{#include ../output/hello_foundry/forge-init:command}}
Let's check out what forge
generated for us:
$ cd hello_foundry
{{#include ../output/hello_foundry/tree:all}}
We can build the project with forge build
:
{{#include ../output/hello_foundry/forge-build:all}}
And run the tests with forge test
:
{{#include ../output/hello_foundry/forge-test:all}}
💡 Tip
You can always print help for any subcommand (or their subcommands) by adding
--help
at the end.
You can watch these beginner tutorials if you are a visual learner.