Smart contract scaffolding CLI for the Stacks ecosystem
stxforge is a developer-first CLI tool that scaffolds production-ready Clarity smart contracts for the Stacks blockchain. Generate tokens, NFTs, DAOs, and DeFi protocols in seconds — with best practices baked in from day one.
Whether you're a seasoned Stacks builder or just getting started with Clarity, stxforge removes boilerplate and lets you focus on what matters: shipping great products on Bitcoin L2.
- Contract Templates — SIP-010 fungible tokens, SIP-009 NFTs, multi-sig vaults, DAO frameworks, staking contracts
- Interactive CLI — guided prompts to configure each contract to your exact specs
- Test Scaffolding — auto-generates Clarinet test suites alongside every contract
- Deployment Pipelines — built-in scripts for testnet and mainnet deployment via Clarinet
- Plugin System — extend stxforge with community-built templates
- Audit Checklists — inline comments flagging common Clarity security pitfalls
| Layer | Technology |
|---|---|
| Smart Contracts | Clarity (Stacks) |
| CLI Runtime | Node.js / TypeScript |
| Testing | Clarinet + Vitest |
| Deployment | Stacks.js + Clarinet |
| Package Manager | npm / pnpm |
- Node.js >= 18
- Clarinet >= 2.0
- A Stacks wallet (e.g. Hiro Wallet)
npm install -g stxforgeOr with pnpm:
pnpm add -g stxforge# Create a new Stacks project
stxforge init my-project
# Scaffold a SIP-010 fungible token
stxforge add token --name "MyToken" --symbol "MTK" --decimals 6
# Scaffold a SIP-009 NFT collection
stxforge add nft --name "MyCollection" --supply 10000
# Scaffold a DAO with governance token
stxforge add dao --name "MyDAO" --quorum 60
# Run local tests
cd my-project && clarinet test;; Generated by stxforge
(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
(define-fungible-token my-token u1000000000000)
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34))))
(begin
(asserts! (is-eq tx-sender sender) (err u401))
(ft-transfer? my-token amount sender recipient)
)
);; Generated by stxforge
(impl-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait)
(define-non-fungible-token my-nft uint)
(define-public (mint (recipient principal))
(let ((token-id (+ (var-get last-token-id) u1)))
(begin
(var-set last-token-id token-id)
(nft-mint? my-nft token-id recipient)
)
)
)my-project/
├── contracts/
│ ├── token.clar
│ ├── nft.clar
│ └── dao.clar
├── tests/
│ ├── token.test.ts
│ ├── nft.test.ts
│ └── dao.test.ts
├── scripts/
│ ├── deploy-testnet.ts
│ └── deploy-mainnet.ts
├── Clarinet.toml
└── package.json
# stxforge.config.toml
[project]
name = "my-project"
network = "testnet" # testnet | mainnet | devnet
[defaults]
author = "thewealthyplace"
license = "MIT"
[templates]
custom_path = "./my-templates"| Command | Description |
|---|---|
stxforge init <name> |
Bootstrap a new Stacks project |
stxforge add token |
Add a SIP-010 fungible token |
stxforge add nft |
Add a SIP-009 NFT contract |
stxforge add dao |
Add a DAO + governance contract |
stxforge add vault |
Add a multi-sig vault |
stxforge add staking |
Add a staking/reward contract |
stxforge deploy |
Deploy contracts to the configured network |
stxforge audit |
Run security checklist on contracts |
stxforge list |
List all available templates |
- Core CLI scaffolding engine
- SIP-010 and SIP-009 templates
- DAO + governance templates
- DeFi AMM template
- Mainnet one-click deployment
- Community template registry
- VS Code extension integration
- AI-assisted contract generation
Contributions are welcome! Please read CONTRIBUTING.md before submitting a PR.
git clone https://github.com/thewealthyplace/stxforge
cd stxforge
pnpm install
pnpm devMIT © thewealthyplace