Skip to main content
Run stacksdapp init from the repository root to add the Scaffold Stacks frontend, TypeScript bindings, and debug UI to an existing Clarinet project.

Contents

Requirements

  • Clarinet 3.21+
  • Run from the repo root where Clarinet lives today
Verify with:

What init does

  1. Normalizes layout to contracts/Clarinet.toml and frontend/ when needed
  2. Adds missing frontend template files
  3. Runs npm install in frontend/ and contracts/
  4. Runs stacksdapp generate
If frontend/ already exists but frontend/scripts/export-abi.mjs is missing, init exits with an error. Add that script, or move frontend/ temporarily, then run init again.

Standard Clarinet layout

Before:
After (typical):
Entries like path = "contracts/token.clar" in Clarinet.toml still resolve. The file ends up at contracts/contracts/token.clar, with Clarinet.toml under contracts/.

Already scaffold layout

Normalization is skipped. Missing files are filled in, then npm install and stacksdapp generate run.

Layout conflicts

init fails if both of these exist:
  • ./settings
  • ./contracts/settings
Merge or remove one set, then rerun.

Init vs upgrade

Next steps

For local development with auto-deploy: