Project Setup Commands

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

cre init

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:

cre init [flags]

Flags:

FlagDescription
--non-interactiveFail instead of prompting; supply all inputs via flags (for CI/CD and non-TTY environments).
-p, --project-nameName for the new project (required for a new project when using --non-interactive).
-t, --templateTemplate name to use (for example hello-world-ts). Run cre templates list to see IDs and required networks.
-w, --workflow-nameName for the new workflow.
--deployment-registryRegistry 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.
--refreshBypass the template cache and fetch fresh data from GitHub.
--rpc-urlRPC endpoint for a chain, repeatable. Format: chain-name=url. Often required with --non-interactive when the template needs RPCs.

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

Example:

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

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

For a detailed walkthrough, see Part 1 of the Getting Started guide.

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 directorycd 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

Get the latest Chainlink content straight to your inbox.