CLI Command Reference
Project management
stacksdapp new <name>
Scaffold a new Scaffold Stacks project.
stacksdapp init
Adopt an existing Clarinet repository so it matches scaffold-stacks: adds a frontend/ and Node tooling where needed, keeps your contracts, and normalizes the repo layout when Clarinet currently lives at the root.
When: Run from the repository root (where Clarinet lives today).
Example A — Standard Clarinet layout (before)
path = "contracts/token.clar" in Clarinet.toml still resolve. The file ends up at contracts/contracts/token.clar relative to the repo root, with Clarinet.toml under contracts/.
Existing frontend/: If frontend/ already exists but frontend/scripts/export-abi.mjs is missing, init exits with an error and does not overwrite your frontend. Add that script, or move or rename frontend/ temporarily, then run init again.
Example B — Already scaffold layout (no file moves)
npm install and stacksdapp generate run.
Example C — Conflict (error)
If both of these exist,init fails with a message to merge or remove one set, then rerun:
./settings./contracts/settings
stacksdapp add <name>
Add a new Clarity contract.
contracts/contracts/my-contract.clar and updates configuration.
Templates
Development
stacksdapp dev
Start development server.
stacksdapp generate
Regenerate TypeScript bindings from contracts.
dev when contracts change.
Testing & validation
stacksdapp test
Run all tests.
stacksdapp check
Type-check Clarity contracts.
Deployment
stacksdapp deploy
Deploy contracts to network.
Deploy options
--network <network>: Target network (testnet,mainnet, ordevnet)--contract <name>: Deploy only one contract from your project--dry-run: Generate and print deployment plan, estimated fee, and contract list without broadcasting transactions
Networks
- testnet: Hiro testnet infrastructure
- mainnet: Stacks mainnet
- devnet: Local Docker environment
Maintenance
stacksdapp upgrade
Refresh npm dependencies in frontend/ and contracts/, then run stacksdapp generate again. Does not rewrite your application logic.
Prerequisites: Full scaffold layout, including:
contracts/Clarinet.tomlfrontend/package.json
stacksdapp or template, or when generated bindings feel stale and you want a deterministic refresh without rescaffolding.
What to expect: A spinner and install progress for frontend and contracts, then codegen output (same kind of feedback as init for npm).
stacksdapp clean
Remove generated files and devnet state.
stacksdapp --version
Show CLI version.
Init vs upgrade
| Command | Use case |
|---|---|
stacksdapp init | First time bringing an existing Clarinet project onto scaffold-stacks. |
stacksdapp upgrade | Already a scaffold project; refresh dependencies and regenerate TypeScript bindings. |
Configuration files
Clarinet.toml
Contract configuration managed by CLI. In the full scaffold layout, this file lives at contracts/Clarinet.toml.
contracts/settings/*.toml
Network-specific settings:
Devnet.toml: Local developmentTestnet.toml: Testnet deploymentMainnet.toml: Mainnet deployment