# prisma-next init (/docs/cli/next/init)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Initialize Prisma Next files in a project.

Location: CLI > Next > prisma-next init

`prisma-next init` scaffolds the Prisma Next config, contract source, and runtime files inside an existing project.

Use a [Prisma Next quickstart](https://www.prisma.io/docs/next/quickstart/postgresql) when you want a complete new application template. Use `prisma-next init` when you already have a project and want to add the lower-level Prisma Next files.

## Usage [#usage]

```bash
prisma-next init
```

Run it non-interactively:

```bash
prisma-next init --yes --target postgres --authoring psl
```

## Options [#options]

| Option                 | What it does                                                   |
| ---------------------- | -------------------------------------------------------------- |
| `--target <db>`        | Sets the database target. Use `postgres` or `mongodb`.         |
| `--authoring <style>`  | Sets the contract authoring style. Use `psl` or `typescript`.  |
| `--schema-path <path>` | Sets where the starter contract is written.                    |
| `--force`              | Overwrites an existing scaffold without prompting.             |
| `--write-env`          | Writes `.env` from `.env.example`.                             |
| `--probe-db`           | Connects to `DATABASE_URL` once and checks the server version. |
| `--strict-probe`       | Treats a failed database probe as fatal.                       |
| `--no-install`         | Skips dependency installation and contract emission.           |

## What it creates [#what-it-creates]

The exact files depend on the target and authoring style, but a Postgres PSL setup normally includes:

* `prisma-next.config.ts`
* a starter contract file such as `prisma/contract.prisma`
* emitted contract artifacts after installation runs
* a runtime client file that imports `contract.json`
* package scripts for contract emission and database commands

## Examples [#examples]

```bash
prisma-next init --yes --target postgres --authoring psl
prisma-next init --yes --target mongodb --authoring typescript --json
prisma-next init --no-install
```

## After initialization [#after-initialization]

Review the generated files, set `DATABASE_URL`, and emit the contract when you change the schema:

```bash
prisma-next contract emit
```

Then initialize or verify the database:

```bash
prisma-next db init --db "$DATABASE_URL"
prisma-next db verify --db "$DATABASE_URL"
```

## Related pages

- [`CLI configuration`](https://www.prisma.io/docs/cli/next/configuration): Configure Prisma Next CLI commands with prisma-next.config.ts and global flags.
- [`prisma-next contract emit`](https://www.prisma.io/docs/cli/next/contract-emit): Emit Prisma Next contract artifacts.
- [`prisma-next contract infer`](https://www.prisma.io/docs/cli/next/contract-infer): Infer a starter contract from an existing database.
- [`prisma-next db init`](https://www.prisma.io/docs/cli/next/db-init): Initialize a database from the current Prisma Next contract.
- [`prisma-next db schema`](https://www.prisma.io/docs/cli/next/db-schema): Inspect a live database schema.