Home · Quickstart
Your first contract, this afternoon.
From an empty terminal to a deployable Clarity contract in five steps. Everything runs at build time; the artifact you deploy is plain Clarity.
$pip install stxscript
- 01
Install StxScript
StxScript ships as a single Python 3.10+ package. pip install stxscript gives you the CLI, formatter, linter, language server, and scaffolder.
$ pip install stxscript $ stxscript --version
- 02
Scaffold a project
Pick a starter template — basic, token, nft, or defi. The scaffolder lays out source, tests, and project files.
$ stxscript new my-token --template token $ cd my-token
- 03
Write StxScript
Edit the .stx source with your editor of choice. The VS Code extension and stxscript-lsp give you diagnostics, autocomplete, and hover info as you type.
# contracts/my-token.stx @public function mint(amount: uint): Response<bool, uint> { ... } - 04
Check & build
Run static analysis, then transpile to Clarity. Use stxscript watch for auto-rebuild while iterating.
$ stxscript check contracts/my-token.stx $ stxscript build contracts/my-token.stx my-token.clar
- 05
Test & deploy
Run contract tests with stxscript test, then deploy the generated .clar with your standard Stacks tooling — it is plain Clarity.
$ stxscript test # deploy my-token.clar with Clarinet / Stacks CLI
Quickstart FAQ
+ What do I need installed first?
Python 3.10 or newer. Everything else — CLI, formatter, linter, language server, scaffolder — comes with the single pip install stxscript package.
+ Do I still need Clarinet?
Optional. StxScript produces .clar files that any Stacks tool deploys. Many teams pair StxScript (source language) with Clarinet (local devnet + simulation). See the comparison.
+ Which template should I start with?
basic for a minimal contract, token for a fungible token, nft for a non-fungible token, and defi for a starter DeFi contract. They are starter projects, not frameworks.