CLI tool for generating and managing Spree Commerce extensions.
| spree_extension | Spree |
|---|---|
| 2.x | 6.0+ |
| 1.x | 5.x |
To scaffold an extension for Spree 5, install the 1.x version: gem install spree_extension -v '~> 1.0'.
gem install spree_extensionspree-extension create my_extensionThis creates a spree_my_extension directory with a complete extension scaffold: a Rails engine depending on spree_core and spree_api, directories for models, Store and Admin API controllers and serializers, services and event subscribers, an initializer for permission scopes and workflow hooks, a test setup based on spree_dev_tools, and CI configuration.
An extension is backend code only. Admin screens for your extension are built as a dashboard plugin, scaffolded with:
npx @spree/cli plugin new my-extensionspree-extension versioncd spree_my_extension
bundle install
bundle exec rake test_app
bundle exec rspecFor a walkthrough of building an extension, see Creating a Spree extension.
Spree Extension is released under the MIT License.