Create a new pallet
Use the interactive prompt to scaffold a pallet:
pop new palletIf you run pop new without a subcommand, Pop CLI prompts you to choose between chain, pallet, and contract. You can also use the top-level alias pop n.
Command overview
pop new pallet
pop new pallet <PATH>
pop new pallet advancedOptions
<PATH>
string
interactive
Path or name for the pallet. If omitted, Pop CLI prompts for a path.
--authors, -a
string
Anonymous
Author name(s) for the pallet metadata.
--description, -d
string
Frame Pallet
Pallet description.
JSON mode
Use global --json for non-interactive generation:
pop --json new pallet my-palletJSON mode requirements:
Pallet name/path is required.
advancedmode must include one or more advanced flags (interactive advanced prompts are disabled).Existing destination paths are not overwritten in JSON mode.
Advanced mode
Use advanced to unlock more customization:
If you do not pass any advanced flags, Pop CLI runs an interactive prompt. If you pass any advanced flags, Pop CLI skips prompts and uses your inputs.
--config-common-types, -c
list
none
Add common config types to the config trait. Pass multiple values separated by spaces.
--default-config, -d
boolean
false
Add default config implementation (requires at least one config common type).
--storage, -s
list
none
Add storage items to the pallet. Pass multiple values separated by spaces.
--genesis-config, -g
boolean
false
Add a genesis config.
--custom-origin, -o
boolean
false
Add a custom origin.
Run pop new pallet advanced --help to see the available values for --config-common-types and --storage.
Behavior notes
If the pallet path is inside a Rust workspace, Pop CLI adds the pallet to the workspace manifest.
Pop CLI runs
cargo fmt --allafter generation. If formatting fails, the pallet is still generated.
Examples
Last updated