Skip to content

Latest commit

 

History

History
84 lines (53 loc) · 2.04 KB

forge-init.md

File metadata and controls

84 lines (53 loc) · 2.04 KB

forge init

NAME

forge-init - Create a new Forge project.

SYNOPSIS

forge init [options] [root]

DESCRIPTION

Create a new Forge project in the directory root (by default the current working directory).

The default template creates the following project layout:

{{#include ../../output/hello_foundry/tree-with-files:output}}

However, it is possible to create a project from another using --template.

By default, forge init will also initialize a new git repository, install some submodules and create an initial commit message.

If you do not want this behavior, pass --no-git.

If you want to create a project a ZKsync template, you can use the --zksync flag. This will download the forge-zksync-std library and add it to the project and also populate the .gitignore file with zksync specific output directories.

OPTIONS

Init Options

--zksync
    Create the project with zksync template.

--force
    Create the project even if the specified root directory is not empty.

-t template
--template template
    The template to start from.

--vscode
    Create a .vscode/settings.json file with Solidity settings, and generate a remappings.txt file.

--offline
    Do not install dependencies from the network.

VCS Options

--no-commit
    Do not create an initial commit.

--no-git
    Do not create a git repository.

Display Options

-q
--quiet
    Do not print any messages.

{{#include common-options.md}}

EXAMPLES

  1. Create a new project:

    forge init hello_foundry
  2. Create a new project, but do not create a git repository:

    forge init --no-git hello_foundry
  3. Forcibly create a new project in a non-empty directory:

    forge init --force 

SEE ALSO

forge