Skip to content
Built with

Project setup ​

SDK Reference

These commands create a project, migrate older config and prepare generated files.

On this pageStart a project with void init · Migrate older config with void migrate · Inspect the project with void info

void info ​

Shows each Durable State and WebSocket definition: source file, inferred or explicit name, Worker class and binding. It runs locally. It needs no sign-in, makes no network requests and writes no files.

Now you will list your definitions.

sh
void info
void info --json

Example output: one entry per definition with its file, name, class and binding. --json prints the same data as JSON, and WebSocket entries also include their route.

Before you move a deployed definition, copy the suggested name into defineDurableState(), defineRoom() or defineWebSocket(). Keep that name after the move to keep the resource. See Durable State and WebSockets for migration flows, including WebSocket parameter renames.

Resources in void.lock.json with no matching definition are listed separately. Adopt a suggested name only after you identify the resource you moved. If the SDK cannot suggest a name, restore the original source and inspect it before you move it again.

--json returns resources and recordedResources. Current entries contain file, definition, name, nameSource (inferred or explicit), className, bindingName, and an optional route. Recorded entries contain className and bindingName, with name and definition when a matching name is available.

void migrate ​

void migrate converts a legacy void.json and a root wrangler.jsonc or wrangler.json into void.config.ts. It also accepts one root wrangler*.json(c) file that a supported framework adapter uses. The SDK saves backups in .void/config-migration/ and records resource IDs in void.lock.json. It also points supported adapters at its generated Cloudflare config.

.void-wrangler.jsonc is generated for Cloudflare tools and belongs in .gitignore. Migration adds that entry. Review and commit void.config.ts, void.lock.json and .gitignore.

void init and void deploy migrate legacy files on their own. If the project has several or conflicting Cloudflare configs, resolve them first. The installed void package must match the CLI version before a Cloudflare deploy.

void init ​

Sets up a new or existing SDK project. In an empty folder, you choose Vite+ or Vite, a framework, and a D1, PostgreSQL, MySQL or Static Pages starter.

Now you will run the setup wizard.

sh
void init [--tsconfig] [--github] [--git | --no-git]

Example output: void init asks a few setup questions, then writes the project files.

Vite+ projects install dependencies with vp install. You do not need a global Vite+ install. The SDK keeps existing package-manager versions and lockfiles. New Vite+ projects with no package-manager config use pnpm, with no pinned version.

In an existing app, the SDK adds missing dependencies and scripts. It also updates the Vite config. If it cannot edit your config, it prints the snippet to add.

The wizard also sets up TypeScript, agent instructions, env declarations and a deploy target. Choose Cloudflare, an SDK platform or no deploy setup. If you skip sign-in, run void connect when you are ready. See Quick Start.

Every init run sets up coding agents. New projects get a short AGENTS.md that points to node_modules/void/docs/. In existing projects, the CLI asks before it creates, appends to or updates the file. CI and non-interactive runs leave existing instructions unchanged. Skills are linked for detected agents. See Coding Agents.

Outside an existing repo or workspace package, the SDK offers to set up Git. Use --git to do it without a prompt, or --no-git to skip it. In CI, Git setup needs --git. Workspace packages do not accept these flags.

To run only some setup steps, use these flags:

FlagPurpose
--tsconfigUpdate TypeScript configuration, preserving existing settings.
--githubCreate the GitHub Actions deployment workflow.

You can combine these flags. They skip the other wizard steps. Coding agent setup still runs. Add --git if you also want Git set up.

For Cloudflare workflows, add CLOUDFLARE_API_TOKEN as a repository secret. PostgreSQL and MySQL apps also need DATABASE_URL as a secret.

SDK platforms with GitHub Actions support use short-lived OIDC credentials. Authorize the repository with void github connect <project> --repo <owner/repo> --executor github_actions. Core self-hosted platforms do not support that integration. See Deployment.

void prepare ​

void prepare

Generates the SDK's types and TypeScript config. It does not start the dev server or build the app. Run it after a fresh clone and before typechecking in CI.

Next steps ​

implemented.stream AI