The scaffold script creates a new TypeScript/Effect project with a chosen template and optionally installs Effect Patterns rules for AI tools (Cursor, VS Code, Windsurf, Agents). Run it from the Effect-Patterns repository root.
Quick start:
bun run scaffold my-app --template service- Bun — used to run the script and to install dependencies in the new project
- Git — the script runs
git initand an initial commit - Effect Patterns repo — run the command from the repo root (where
package.jsonandscripts/live)
Rule installation (ep install add --tool <tool>) may call the Effect Patterns API. If the API is unavailable or not configured, the script continues and reports which tools failed; you can retry later from the new project directory.
Command: bun run scaffold (defined in the root package.json).
No arguments: the script prompts for project name, template, and tools.
bun run scaffoldPass the project name; optionally pass --template and one or more --tool options.
bun run scaffold my-app- Uses the basic template and installs rules for all tools.
bun run scaffold my-app --template service- Uses the service template and installs rules for all tools.
bun run scaffold my-app --template cli --tool cursor --tool agents- Uses the cli template and installs rules only for Cursor and Agents.
| Option | Description |
|---|---|
--template <name> |
Project template. One of: basic, service, cli, http-server. |
--tool <name> |
Tool to install Effect Patterns rules for; repeatable. Values: agents, cursor, vscode, windsurf. |
If you provide a project name but omit --tool, the script installs rules for all four tools.
| Template | Description |
|---|---|
| basic | Minimal Effect app: Console.log and Effect.runPromise. |
| service | Effect.Service example (Greeter) plus a Vitest test. |
| cli | @effect/cli app with a hello subcommand. |
| http-server | @effect/platform HTTP server with a /health route. |
Each template adds the right dependencies and starter files under src/.
Directory: Projects are created under $HOME/Projects/TestRepos/<project-name> (e.g. ~/Projects/TestRepos/my-app). There is no option to change this path.
Steps the script performs:
- Create the project directory and
src/ - Write
package.json(template-specific dependencies),tsconfig.json,.gitignore - Write template files into
src/ - Run
bun install - Run
git initand create an initial commit - For each selected tool, run
ep install add --tool <tool>(using the repo’s ep-cli)
If ep install add fails for a tool (e.g. API unavailable), the script prints a warning and continues. The final summary includes a retry command for failed tools.
| Variable | Purpose |
|---|---|
| HOME | Used to build the output path $HOME/Projects/TestRepos/<name>. If unset, the script falls back to /Users/paul. |
| EFFECT_PATTERNS_API_URL | If set, passed to the ep install add subprocess (e.g. for a local or staging API). Rule installation may fail if the API is unreachable or not configured. |
"Directory already exists" — The script will not overwrite an existing directory. Use a different project name or remove the existing directory.
"Unknown template" / "Unknown tool" — Use only the supported values:
- Templates:
basic,service,cli,http-server - Tools:
agents,cursor,vscode,windsurf
ep install failed — The script prints a warning and a retry command, e.g. cd <projectDir> && bun run <ep-cli-entry> install add --tool <tool>. You may need to configure an API key or EFFECT_PATTERNS_API_URL; see the ep-cli README and project MCP_CONFIG.md for API and key setup.
After scaffolding:
cd ~/Projects/TestRepos/<project-name>
bun run devFor the service template, run tests with:
bun run test