# Project Setup Commands
Source: https://docs.chain.link/cre/reference/cli/project-setup-ts
Last Updated: 2026-03-26

> For the complete documentation index, see [llms.txt](/llms.txt).

The project setup command `cre init` initializes new CRE projects or adds workflows to existing projects.

> **NOTE: Global flags**
>
> All `cre` commands support [global flags](/cre/reference/cli#global-flags) like `--env`, `--target`, `--project-root`,
> and `--verbose`.

## `cre init`

> **NOTE: Authentication required**
>
> Running this command requires you to be logged in with the CRE CLI. Run `cre whoami` in your terminal to verify you're
> logged in, or run `cre login` to authenticate. See [Creating Your Account](/cre/account/creating-account) and [Logging
> in with the CLI](/cre/account/cli-login) for further details.

Initializes a new CRE project or adds a workflow to an existing project. The behavior depends on your current directory:

- **In a directory without a project**: Creates a new project with the first workflow
- **In an existing project directory**: Adds a new workflow to the existing project

**Usage:**

```bash
cre init [flags]
```

**Flags:**

| Flag                    | Description                                                                                                                                                                                                                                      |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--non-interactive`     | Fail instead of prompting; supply all inputs via flags (for **CI/CD** and non-TTY environments).                                                                                                                                                 |
| `-p, --project-name`    | Name for the new project (required for a new project when using `--non-interactive`).                                                                                                                                                            |
| `-t, --template`        | Template name to use (for example `hello-world-ts`). Run `cre templates list` to see IDs and required networks.                                                                                                                                  |
| `-w, --workflow-name`   | Name for the new workflow.                                                                                                                                                                                                                       |
| `--deployment-registry` | Registry ID to write into the generated `workflow.yaml` (e.g. `private` or `onchain:ethereum-mainnet`). Run `cre registry list` to see available IDs. In `--non-interactive` mode, omitting this flag prints a warning and defaults to on-chain. |
| `--refresh`             | Bypass the template cache and fetch fresh data from GitHub.                                                                                                                                                                                      |
| `--rpc-url`             | RPC endpoint for a chain, repeatable. Format: `chain-name=url`. Often **required** with `--non-interactive` when the template needs RPCs.                                                                                                        |

Inherited [global flags](/cre/reference/cli#global-flags) include **`-R, --project-root`**, which `cre init` uses as the directory where the project is created when you pass it explicitly.

**Interactive mode (recommended):**

Running `cre init` without flags starts an interactive setup that guides you through the process:

1. **Project name** (only if creating a new project)
2. **Language** (Go or TypeScript)
3. **Workflow template** (fetched dynamically from configured template sources)
4. **Workflow name**
5. **Deployment registry** — select which registry the generated `workflow.yaml` targets. Private (off-chain) registries appear first with the cursor defaulted to them. If your organization has no registries configured, this step is skipped and the field is omitted from `workflow.yaml`.

> **NOTE: Template sources**
>
> Templates are fetched at runtime from GitHub. The Chainlink official repository is included by default. To browse available templates or add custom sources, see [Template Sources](/cre/reference/cli/templates).

**Example:**

```bash
# Interactive setup
cre init
```

**Non-interactive mode (scripting / CI):**

Pass **`--non-interactive`** plus the flags your template needs. Use **`cre templates list`** (or **`cre templates list --json`**) to see **required networks** and choose **`--rpc-url`** values.

```bash
cre init \
  --non-interactive \
  --project-name my-cre-project \
  --workflow-name my-workflow \
  --template hello-world-ts \
  --deployment-registry private \
  --rpc-url sepolia=https://sepolia.infura.io/v3/YOUR_KEY
```

> **NOTE: Interactive vs. non-interactive**
>
> For most users, `cre init` without flags is easiest. With **`--non-interactive`**, the CLI does not prompt; if RPC URLs are required and there is no TTY, you get a clear error — pass the needed flags up front. If `--deployment-registry` is omitted in `--non-interactive` mode, the CLI prints a warning and defaults to the onchain registry.

For a detailed walkthrough, see [Part 1 of the Getting Started guide](/cre/getting-started/part-1-project-setup).

## Project initialization workflow

The typical project setup flow for TypeScript workflows:

1. **`cre init`** — Create a new project or add a workflow (interactive or with flags)
2. **Navigate to workflow directory** — `cd your-project/your-workflow`
3. **Install dependencies** — Run `bun install` to install the CRE SDK and dependencies
4. **Start development** — Write your workflow code

## Learn more

- [Part 1: Project Setup](/cre/getting-started/part-1-project-setup) — Step-by-step tutorial for initializing projects
- [Project Configuration](/cre/reference/project-configuration) — Understanding `project.yaml` and `workflow.yaml`