CLI commands
Blueprint provides a comprehensive set of CLI commands for smart contract development, testing, and deployment. Commands support both interactive and non-interactive modes.create
Interactive mode
- Contract name selection (validates CamelCase format)
- Programming language choice (Tolk, FunC, or Tact)
- Template type selection (empty or counter example)
Non-interactive mode
<CONTRACT>— contract name in CamelCase format (e.g.,MyAwesomeContract)<TYPE>— template type from available options
tolk-empty— an empty contract (Tolk)func-empty— an empty contract (FunC)tact-empty— an empty contract (Tact)tolk-counter— a simple counter contract (Tolk)func-counter— a simple counter contract (FunC)tact-counter— a simple counter contract (Tact)
contracts/MyContract.{tolk|fc|tact}— contract source codewrappers/MyContract.ts— TypeScript wrapper for contract interactiontests/MyContract.spec.ts— Jest test suite with basic test casesscripts/deployMyContract.ts— deployment script with network configuration
build
.compile.ts configuration files.
Interactive mode
.compile.ts files for selection. Shows compilation status and allows building individual contracts or all at once.
Non-interactive mode
<CONTRACT>— specific contract name to build (matches the.compile.tsfilename)--all— build all contracts in the project that have compilation configurations
run
scripts/ directory with full network provider access. Commonly used for contract deployment, interaction, and maintenance tasks.
Interactive mode
scripts/ directory to select from.
Non-interactive mode
<SCRIPT>— script name (without.tsextension)<ARGS...>— optional arguments passed to the script--<NETWORK>— network selection (mainnet,testnet)--<DEPLOY_METHOD>— deployment method (tonconnect,mnemonic)
--mainnet— use TON Mainnet--testnet— use TON Testnet--custom <URL>— use custom network endpoint--custom-version <VERSION>— API version (v2,v4)--custom-type <TYPE>— network type (custom,mainnet,testnet)--custom-key <KEY>— API key (v2 only)
--tonconnect— use TON Connect for deployment--deeplink— use deep link for deployment--mnemonic— use mnemonic for deployment
--tonscan— use Tonscan explorer--tonviewer— use Tonviewer explorer (default)--toncx— use Toncx explorer--dton— use Dton explorer
<YOUR_API_KEY>— API key for the selected provider (v2only).
- Scripts must be located in the
scripts/directory - Script files must export a
runfunction:
test
Run the full project test suite with all .spec.ts files.
Basic usage
tests/ directory.
Collecting coverage
coverage/ directory.
Gas reporting
Specific test file
- Test files should be located in the
tests/directory - Use
.spec.tsextension - Supports standard Jest syntax and matchers
verify
Verify a deployed contract using TON Contract Verifier.
Basic usage
Non-interactive mode
<CONTRACT>— contract name to verify--network <NETWORK>— network (mainnet,testnet)--compiler-version <VERSION>— compiler version used for building--custom <URL>— custom network endpoint--custom-version <VERSION>— API version (v2default)--custom-type <TYPE>— network type (mainnet,testnet)--custom-key <KEY>— API key (v2only)
help
Show detailed help.
set
Sets language versions.
func— overrides@ton-community/func-js-binversion
convert
Converts legacy bash build scripts to Blueprint wrappers.
rename
Renames a contract by matching in wrappers, scripts, and tests.
pack
Builds and prepares a publish-ready package of wrappers.
--no-warn,-n— ignore warnings about modifyingtsconfig.jsonandpackage.json, and about removing thedistdirectory
- Creates a deployment-ready package
- Includes compiled artifacts
- Bundles dependencies
snapshot
Creates snapshots with gas usage and cell sizes.
--label=<COMMENT>,-l=<COMMENT>— add a comment label to the snapshot
- Run with gas usage and cell sizes collected
- Write a new snapshot
- Useful for regression testing
Environment variables
Blueprint supports environment variables for wallet configuration when using the mnemonic provider:WALLET_MNEMONIC— wallet mnemonic phrase (space-separated words).WALLET_VERSION— wallet contract version (v1r1,v1r2,v1r3,v2r1,v2r2,v3r1,v3r2,v4r1,v4r2,v4,v5r1).WALLET_ID— wallet ID for versions earlier thanv5r1.SUBWALLET_NUMBER— subwallet number forv5r1wallets.
Example .env file
<MNEMONIC_24_WORDS>— 24-word wallet mnemonic (space-separated).