Project init
Create the smallest Layeron project that can compile, run locally, and produce Cloudflare Worker runtime types.
Command
Section titled “Command”layer init [directory] [options]What It Creates
Section titled “What It Creates”layer init writes these files in the target directory:
layeron.config.tssrc/app.tstsconfig.jsonworker-configuration.d.ts
The command uses Wrangler to generate worker-configuration.d.ts. Layeron
removes its temporary Wrangler config after generation. Successful init leaves
no new .wrangler directory in the project.
Options
Section titled “Options”| Option | Value | Notes |
|---|---|---|
--dir | <path> | Alias for --directory. |
--directory | <path> | Initialization directory. |
--name | <slug> | Alias for --project-name. |
--project-name | <slug> | Project slug. |
-h, --help | Show help. |
Validation
Section titled “Validation”The project name must be a slug made from letters, numbers, hyphens, or underscores. Layeron refuses to overwrite generated project files.
Examples
Section titled “Examples”layer init demo-api --name demo-apiTroubleshooting
Section titled “Troubleshooting”If layer init reports that a file already exists, choose an empty directory or
move the listed file before running the command again.