Init
Scaffold a new Cluster project with ccp init.
Init
ccp init creates a new project with everything you need to develop and deploy a function.
Usage
# Create in a new directory
ccp init my-app
# Scaffold in the current directory
ccp init .
ccp initIf you pass a directory name, it must not already exist (or must be empty). Using . or omitting the name scaffolds in the current directory.
Templates
You'll be prompted to choose a template:
| Template | Description |
|---|---|
| Handler | Simple Request → Response handler |
| API | JSON API with route matching |
| Static | Static site with public/ directory |
You can also pass --template directly:
ccp init my-app --template handler
ccp init my-app --template api
ccp init my-app --template staticGenerated Files
| File | Purpose |
|---|---|
index.ts | Your handler function |
package.json | Scripts for dev and deploy |
tsconfig.json | TypeScript config (ESNext, strict) |
.cluster/config.json | Links to your remote function and organization |
CLUSTER.md | Quick reference for commands and available APIs |
.gitignore | Ignores .cluster/, node_modules/, dist/, .env |
The static template also generates:
| File | Purpose |
|---|---|
public/index.html | Starter HTML page |
globals.d.ts | TypeScript types for the __pages global |
Linking
If you're logged in, ccp init will offer to create a function and link it to your project. This writes the function_id and organization_id to .cluster/config.json so that ccp deploy works without prompting.
You can skip prompts entirely with -y:
ccp init my-app -y
# Uses "handler" template, skips .env, skips linkingIf you skip linking during init, you can always link later:
ccp linkConfig File
The .cluster/config.json file ties your local project to a remote function:
{
"function_id": "abc-123",
"organization_id": "org-456",
"index": "index.ts",
"client": null,
"assets": null
}| Field | Description |
|---|---|
function_id | ID of the remote function (set by link or first deploy) |
organization_id | ID of the owning organization |
index | Entry point file |
client | Client-side script path (optional) |
assets | Public directory for static assets (e.g., "public") |