Skip to content
Thyme Docs

thyme init

Scaffold a new Thyme Flow project. init creates a directory with the SDK and CLI wired up, a strict TypeScript config, and an empty functions/ folder ready for your first task.

Usage

thyme init [name]

If you omit name, the CLI prompts for it interactively. Without a terminal the name is required as an argument — see CI & Non-Interactive Use. Either way the name must match ^[a-z0-9-]+$.

Arguments

ArgumentRequiredDescription
nameNoProject directory name. Must match ^[a-z0-9-]+$ (lowercase letters, digits, hyphens). Prompted if omitted.

What it creates

init writes the project files; install dependencies before running a task:

my-project/
├── functions/          # your tasks live here (empty to start)
├── package.json        # type: module; scripts.dev = "thyme run"
├── tsconfig.json       # ES2022 / ESNext, bundler resolution, strict
├── .env.example        # template for project-level env vars
├── .gitignore
└── README.md

The generated package.json:

  • sets "type": "module",
  • adds a dev script that runs thyme run,
  • declares dependencies @thyme-labs/sdk, viem, and zod,
  • declares devDependencies @thyme-labs/cli and typescript.

The tsconfig.json targets ES2022/ESNext with bundler module resolution and strict enabled. Dependency versions come from the installed CLI package: CLI 0.10.0 scaffolds SDK ^0.8.0, CLI 0.10.0, viem 2.46.3, and Zod ^3.24.1. It does not run the package manager or create the first task.

Examples

Scaffold with a name:

thyme init my-project
cd my-project
npm install
thyme new monitor

Scaffold interactively (the CLI prompts for the name):

thyme init

Behavior notes

  • The directory created by init satisfies the project gate (it has a functions/ dir and @thyme-labs/sdk in package.json), so commands like new, run, list, and upload work inside it.
  • After scaffolding, install dependencies with your package manager, then create your first task with thyme new.

Next steps

  • thyme new — create a task in the project.
  • Installation — prerequisites including Deno.
  • Quickstart — the full path from scaffold to scheduled executable.