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 init

If 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:

TemplateDescription
HandlerSimple Request → Response handler
APIJSON API with route matching
StaticStatic 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 static

Generated Files

FilePurpose
index.tsYour handler function
package.jsonScripts for dev and deploy
tsconfig.jsonTypeScript config (ESNext, strict)
.cluster/config.jsonLinks to your remote function and organization
CLUSTER.mdQuick reference for commands and available APIs
.gitignoreIgnores .cluster/, node_modules/, dist/, .env

The static template also generates:

FilePurpose
public/index.htmlStarter HTML page
globals.d.tsTypeScript 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 linking

If you skip linking during init, you can always link later:

ccp link

Config 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
}
FieldDescription
function_idID of the remote function (set by link or first deploy)
organization_idID of the owning organization
indexEntry point file
clientClient-side script path (optional)
assetsPublic directory for static assets (e.g., "public")

On this page