Candy Machine Commands
Create Candy Machine
The mplx cm create command creates a new MPL Core Candy Machine with configurable settings and asset uploads. It offers both an interactive wizard for beginners and manual configuration for advanced users.
Usage
# Interactive wizard (recommended)
mplx cm create --wizard
# Create directory template
mplx cm create --template
# Manual creation (requires existing cm-config.json)
mplx cm create
Prerequisite Assets
Independent of the Mode (Wizard or Manual) you choose you will need your assets prepared. If you want to play around with dummy assets you can create them using mplx cm create --template. All the image and metadata files should be in their own assets folder.
Image Files:
- Formats: PNG, JPG
- Naming: Sequential (0.png, 1.png, 2.png, ...)
Metadata Files:
- Format: JSON
- Naming: Matching image files (0.json, 1.json, 2.json, ...)
- Schema: Standard Metaplex Core metadata format
Collection Files:
- collection.png: Collection image
- collection.json: Collection metadata
Template Mode
Create a basic directory structure to get started:
mplx cm create --template
This creates the following structure, but not the candy machine.
candy-machine-template/
├── assets/
│ ├── 0.png # Example image
│ ├── 0.json # Example metadata
│ ├── collection.png # Example collection image
│ └── collection.json # Example collection metadata
└── cm-config.json # Example configuration
After creating the template:
- Replace example assets with your actual files
- Update the configuration in
cm-config.json - Run
mplx cm createto deploy
Interactive Wizard Mode
The wizard provides a guided, user-friendly experience with comprehensive validation and progress tracking. This is the recommended approach for most users.
Wizard Workflow
- Project Setup
- Asset Discovery & Validation
- Collection Configuration
- Candy Machine and Candy Guard Settings
- Asset Upload & Processing
- Candy Machine Creation
- Item Insertion
Manual Configuration Mode
For advanced users who want full control over the configuration process.
Prerequisites
- Candy machine asset directory with proper structure
- Manually created
cm-config.jsonwith required configuration. See below for an example - Prepared assets in the
assets/directory in a structure as shown below
Directory Structure
my-candy-machine/
├── assets/
│ ├── 0.png
│ ├── 0.json
│ ├── 1.png
│ ├── 1.json
│ ├── ...
│ ├── collection.png
│ └── collection.json
└── cm-config.json # Required
Configuration File Format
Create cm-config.json with this structure:
{
"name": "My Candy Machine",
"config": {
"collection": "CollectionPublicKey...", // existing collection
"itemsAvailable": 100,
"isMutable": true,
"isSequential": false,
"guardConfig": {
"solPayment": {
"lamports": 1000000000,
"destination": "111111111111111111111111111111111"
},
"mintLimit": {
"id": 1,
"limit": 1
}
},
"groups": [
{
"label": "wl",
"guards": {
"allowList": {
"merkleRoot": "MerkleRootHash..."
},
"solPayment": {
"lamports": 500000000,
"destination": "111111111111111111111111111111111"
}
}
}
]
}
}
Manual Workflow
# 1. Navigate to your candy machine directory
cd ./my-candy-machine
# 2. Create candy machine using existing config
mplx cm create
# 3. Upload assets to storage
mplx cm upload
# 4. Insert items into candy machine
mplx cm insert
# 5. Validate setup (optional)
mplx cm validate
Configuration Options
Core Settings
| Setting | Description | Required |
|---|---|---|
name | Display name for the candy machine | ✅ |
itemsAvailable | Total number of items to mint | ✅ |
isMutable | Whether NFTs can be updated after minting | ✅ |
isSequential | Whether to mint items in order | ✅ |
collection | Existing collection address (optional) | ❌ |
Guard Configuration
Global Guards (guardConfig):
- Apply to all groups and the candy machine as a whole
- Cannot be overridden by group guards
- Useful for universal restrictions
Guard Groups (groups):
- Apply only to specific groups
- Allow different rules per minting phase
- Group labels limited to 6 characters maximum
Common Guard Examples
Basic Public Sale
{
"guardConfig": {
"solPayment": {
"lamports": 1000000000,
"destination": "YourWalletAddress..."
},
"mintLimit": {
"id": 1,
"limit": 1
}
}
}
Whitelist Phase
{
"groups": [
{
"label": "wl",
"guards": {
"allowList": {
"merkleRoot": "MerkleRootHash..."
},
"solPayment": {
"lamports": 500000000,
"destination": "YourWalletAddress..."
}
}
}
]
}
Getting Help
- Use
mplx cm create --helpfor command options - Join the Metaplex Discord for support
Related Commands
mplx cm upload- Upload assets to storagemplx cm insert- Insert items into candy machinemplx cm validate- Validate asset cachemplx cm fetch- View candy machine information
Next Steps
- Upload assets if created manually
- Insert items to load assets into candy machine
- Validate your setup to ensure everything works
- Learn about guards for advanced configuration