> ## Documentation Index
> Fetch the complete documentation index at: https://docs.forest.app/llms.txt
> Use this file to discover all available pages before exploring further.

# forest projects:create:in-app

> Register a Forest project for an application you already run, and print its secrets

# 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

```bash theme={null}
forest projects:create:in-app <APPLICATION_NAME> [options]
```

## Arguments

| Argument | Description |
| - | - |
| `APPLICATION_NAME` | Name of the project to create (required) |

## Options

| Option | Description |
| - | - |
| `-H, --applicationHost` | Hostname your application runs on. Default `http://localhost` |
| `-P, --applicationPort` | Port your application runs on. Default `3000` |
| `--format` | Output format: `text` (default) or `json` |

## 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.

```json theme={null}
{"projectId":"<PROJECT_ID>","envSecret":"<FOREST_ENV_SECRET>","authSecret":"<FOREST_AUTH_SECRET>","endpoint":"<APPLICATION_URL>"}
```

> [!WARNING]
>
> The output contains the project's secrets. Keep it out of version control and shared CI logs.

## Examples

```bash theme={null}
# Register a project for a Rails app on port 3000
forest projects:create:in-app my-app

# Register it for a Node.js app on port 3001 and read the secrets from a script
forest projects:create:in-app my-app -H http://localhost -P 3001 --format json
```

[`forest start --flow inapp`](https://docs.forest.app/reference/cli/start) runs this command and mounts Forest in your application for you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.