Contents
- Global flags
- Exit codes
- Command overview
- new
- add
- dev
- generate
- deploy
- test, check, clean
- init, upgrade, doctor
- Configuration files
- Name validation
- JSON output
Global flags
The CLI walks up from the current directory looking for
stacksdapp.toml or contracts/Clarinet.toml.
Exit codes
With
--json, failures include "ok": false, "code", and "exit_code".
Command overview
new
stacksdapp.toml, git hooks, agent skill, and a default counter contract (Clarity 6).
add
Creates
contracts/contracts/<name>.clar, updates Clarinet.toml, adds trait requirements for SIP templates, and regenerates bindings.
dev
--network starts local devnet (Docker required). Do not run clarinet devnet start alongside stacksdapp dev.
generate
deploy
Guides: testnet · mainnet · local devnet
test, check, clean
init, upgrade, doctor
init
Adopt an existing Clarinet project. Adds frontend (if missing), support files, bindings, git hooks, and agent skill.Clarinet.toml at repo root or contracts/Clarinet.toml. Normalizes standard Clarinet layout. Guide: Adopt an existing project
upgrade
Refresh npm deps, regenerate bindings, refresh git hooks and agent skill. Non-destructive to user contracts.doctor
Checks Rust 1.75+, Node 20+, Clarinet 3.23+, Docker (for devnet), git hooks path.completions
Generate shell completions:Configuration files
After cloning, enable git hooks:
Name validation
- Project name: single segment, letters/digits/
-/_, no..or absolute paths, max 64 chars - Contract name: Clarity identifier, letter first, max 40 chars
JSON output
With--json, success payloads include "ok": true and command-specific fields. Failures include "ok": false, "error", "code", and "exit_code".