Skip to main content

forest projects:create:in-app

Register a project for an application you host yourself, where Forest runs inside your existing Rails or Node.js server. The CLI creates the project and prints its environment secrets. It generates no code and does not connect to a database: your application sends its schema to Forest when it first starts with the Forest agent mounted.

Usage

Arguments

Options

Output

With the default text format, the CLI prints FOREST_ENV_SECRET and FOREST_AUTH_SECRET, followed by the next steps for Rails and Node.js. Set both variables on your application, then mount the Forest agent:
  • Rails: add the forest_admin_rails, forest_admin_agent, forest_admin_datasource_toolkit, forest_admin_datasource_customizer and forest_admin_datasource_active_record gems, run bundle install, then rails g forest_admin_rails:install $FOREST_ENV_SECRET.
  • Node.js: install @forestadmin/agent and a datasource package, then mount the agent on your server.
FOREST_AUTH_SECRET is a value you own: keep the generated one or set your own random string. With --format json, standard output carries only one JSON document, and every other message goes to standard error. The command never prompts in this mode, so you must be logged in first.
The output contains the project’s secrets. Keep it out of version control and shared CI logs.

Examples

forest start --flow inapp runs this command and mounts Forest in your application for you.