> ## Documentation Index
> Fetch the complete documentation index at: https://scaffoldstacks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI commands

> Compact reference for stacksdapp flags and commands

Syntax and flags only. For walkthroughs and layout examples, see the Guides tab.

## Contents

* [Command overview](#command-overview)
* [new](#new)
* [add](#add)
* [dev](#dev)
* [generate](#generate)
* [deploy](#deploy)
* [test, check, clean](#test-check-clean)
* [Configuration files](#configuration-files)

## Command overview

```bash theme={null}
stacksdapp --version
stacksdapp doctor              # prerequisite checks (Clarinet 3.21+)
```

| Command                                                 | Description                                                   |
| ------------------------------------------------------- | ------------------------------------------------------------- |
| `stacksdapp new <name>`                                 | Scaffold a new monorepo                                       |
| `stacksdapp init`                                       | Adopt an existing Clarinet project ([guide](/adopt-existing)) |
| `stacksdapp upgrade`                                    | Refresh deps and regenerate bindings ([guide](/upgrade))      |
| `stacksdapp doctor`                                     | Check Rust, Node, Clarinet 3.21+, Docker, git                 |
| `stacksdapp add <name>`                                 | Add a blank Clarity contract                                  |
| `stacksdapp add <name> --template sip010`               | SIP-010 fungible token                                        |
| `stacksdapp add <name> --template sip009`               | SIP-009 NFT                                                   |
| `stacksdapp generate`                                   | Regenerate TypeScript bindings ([guide](/code-generation))    |
| `stacksdapp generate --watch`                           | Regenerate on `.clar` changes                                 |
| `stacksdapp test`                                       | Contract and frontend tests ([guide](/testing))               |
| `stacksdapp check`                                      | Type-check Clarity contracts                                  |
| `stacksdapp clean`                                      | Remove generated files and devnet state                       |
| `stacksdapp dev`                                        | Local devnet + frontend + watcher ([guide](/local-devnet))    |
| `stacksdapp dev --auto-deploy`                          | Devnet and deploy once the chain is ready                     |
| `stacksdapp dev --network testnet`                      | Frontend against testnet                                      |
| `stacksdapp dev --network mainnet`                      | Frontend against mainnet                                      |
| `stacksdapp deploy --network <net>`                     | Deploy contracts (`devnet`, `testnet`, `mainnet`)             |
| `stacksdapp deploy --network testnet --contract <name>` | Deploy one contract                                           |
| `stacksdapp deploy --network testnet --dry-run`         | Plan and fee estimate, no broadcast                           |

## new

```bash theme={null}
stacksdapp new my-dapp
```

## add

```bash theme={null}
stacksdapp add my-contract
stacksdapp add token --template sip010
stacksdapp add nft --template sip009
```

Creates `contracts/contracts/<name>.clar`, updates `Clarinet.toml`, and regenerates bindings.

## dev

```bash theme={null}
stacksdapp dev                         # local Docker devnet
stacksdapp dev --auto-deploy           # deploy when chain is healthy
stacksdapp dev --network testnet
stacksdapp dev --network mainnet
```

Default with no `--network` starts local devnet (Docker required).

## generate

```bash theme={null}
stacksdapp generate
stacksdapp generate --watch
```

## deploy

```bash theme={null}
stacksdapp deploy --network testnet
stacksdapp deploy --network mainnet
stacksdapp deploy --network devnet
stacksdapp deploy --network testnet --contract counter
stacksdapp deploy --network testnet --dry-run
```

| Flag                  | Description                                       |
| --------------------- | ------------------------------------------------- |
| `--network <network>` | `testnet`, `mainnet`, or `devnet`                 |
| `--contract <name>`   | Deploy only one contract                          |
| `--dry-run`           | Print plan and estimated fee without broadcasting |

Guides: [testnet](/testnet) · [mainnet](/mainnet) · [local devnet](/local-devnet)

## test, check, clean

```bash theme={null}
stacksdapp test
stacksdapp check
stacksdapp clean
```

## Configuration files

| Path                              | Role                                                             |
| --------------------------------- | ---------------------------------------------------------------- |
| `contracts/Clarinet.toml`         | Contract registry (full scaffold layout)                         |
| `contracts/settings/Devnet.toml`  | Local accounts (mnemonic warning shown in CLI)                   |
| `contracts/settings/Testnet.toml` | Deployer mnemonic for testnet                                    |
| `contracts/settings/Mainnet.toml` | Deployer mnemonic for mainnet                                    |
| `frontend/.env.local`             | Auto-managed network config; optional `NEXT_PUBLIC_HIRO_API_KEY` |
| `contracts/.cache/`               | Cached ABIs (skip redundant `initSimnet`)                        |
| `frontend/src/generated/*`        | Generated bindings. Do not edit by hand.                         |
