forest initcommand provides an all-in-one initialization command that will:
- set up your own development environment on a given project.
$ forest init --help
Set up your development environment in your current folder.
$ forest init
-p, --projectId=projectId The id of the project you want to init.
forest initis not meant to help you create a new project. If you don't have an existing project yet, please refer to this guide.
forest initshould be run from your project's root directory
All Forest CLI commands require to be authenticated. You can do this on the fly using
forest initor use
forest loginfirst. Refer to the forest login page if you need further details.
The development environment you will initialize is unique per project and per developer. It is thus mandatory that we identify the right project to create your environment accordingly:
If you have 1 project only in your Forest Admin account, this step will be automatically skipped.
If you have 2 projects or more, you'll be asked to choose one: it should match the project from your current directory!
forest initrequires your project to run on the latest version of Forest Admin:
$ forest init
✓ Selecting your project
✖ Analyzing your setup
> This project does not support branches yet. Please migrate your environments from your Project settings first.
If you're using
forest init, it means your admin backend should already be running locally. If you used the default values used during installation, your endpoint should be http://localhost:3310
Since we need to know your project's local endpoint in order to create your development environment, we've left the same default values. You can just hit "Enter" to use those; otherwise simply fill the host and port to fit your situation.
[? Enter your local admin backend host: (localhost) localhost
[? Enter your local admin backend port: (3310)
At this point, your development environment will be created! 🎉
Note that your new development environment is identified by the
.envfile. If you had no such file, it will have been automatically created.
To work properly in your local environment, your Forest Admin project needs to be connected to the corresponding database (which could be local or remote, it's your choice.)
As a result, we've added an extra step to the
forest initcommand to help you set up your database. If you accept the help, you'll be taken through a few prompts and your
DATABASE_URL(and potentially other environment variables) will be generated and added to your