create-ruby-gem

Create Ruby gems with an interactive CLI wizard, which remembers your choices!
No morebundle gemflags look-ups 🙌
Table of Contents
- Supported Versions
- Installation
- Quick Start
- Interactive Wizard
- Preset System
- Compatibility Matrix
- Configuration
- CLI Reference
- Development
- Contributing
- Changelog
- Versioning
- License
Supported Versions
Ruby 3.2+ and Bundler 2.4+ are required.
Installation
gem install create-ruby-gem
Quick Start
create-ruby-gem my_awesome_gem
The wizard detects your Ruby and Bundler versions, walks you through every supported option, shows a summary of the bundle gem command it will run, and lets you edit or confirm before executing.
Interactive Wizard
Running create-ruby-gem <name> starts the step-by-step wizard:
- Version detection — detects Ruby, RubyGems, and Bundler versions at runtime.
- Option filtering — shows only options your Bundler version supports (see Compatibility Matrix).
- Smart defaults — uses your last-used choices as defaults, falling back to Bundler's own settings.
- Back-navigation — press
Ctrl+Bto revisit the previous step. - Summary — displays the exact
bundle gemcommand with color-coded arguments. - Edit-again loop — choose "edit again" to change options, or "create" to execute.
- Preset save prompt — after creation, optionally save your choices as a named preset.
Press Ctrl+C at any time to exit.
Preset System
Save, load, and manage option presets:
# Save options as a preset during gem creation
create-ruby-gem my_gem --save-preset oss-defaults
# Create a gem using a saved preset (non-interactive)
create-ruby-gem my_gem --preset oss-defaults
# List all saved presets
create-ruby-gem --list-presets
# Show a preset's options
create-ruby-gem --show-preset oss-defaults
# Delete a preset
create-ruby-gem --delete-preset oss-defaults
Compatibility Matrix
Options available depend on your Bundler version. The wizard automatically hides unsupported options.
| Option | Bundler 2.4–2.x | Bundler 3.x | Bundler 4.x |
|---|---|---|---|
--exe / --no-exe |
✓ | ✓ | ✓ |
--coc / --no-coc |
✓ | ✓ | ✓ |
--changelog / --no-changelog |
— | ✓ | ✓ |
--ext |
c | c | c, go, rust |
--git |
✓ | ✓ | ✓ |
--github-username |
✓ | ✓ | ✓ |
--mit / --no-mit |
✓ | ✓ | ✓ |
--test |
minitest, rspec, test-unit | minitest, rspec, test-unit | minitest, rspec, test-unit |
--ci |
circle, github, gitlab | circle, github, gitlab | circle, github, gitlab |
--linter |
— | rubocop, standard | rubocop, standard |
--edit |
✓ | ✓ | ✓ |
--bundle / --no-bundle |
✓ | ✓ | ✓ |
Configuration
Config is stored at ~/.config/create-ruby-gem/config.yml (or $XDG_CONFIG_HOME/create-ruby-gem/config.yml).
The file contains:
version— schema version (currently1)last_used— the options from your most recent gem creationpresets— named option sets saved via--save-presetor the post-creation prompt
CLI Reference
| Flag | Description |
|---|---|
<name> |
Gem name (prompted interactively if omitted) |
--preset NAME |
Use a saved preset (non-interactive) |
--save-preset NAME |
Save the selected options as a preset |
--list-presets |
List all saved preset names |
--show-preset NAME |
Show a preset's options |
--delete-preset NAME |
Delete a saved preset |
--dry-run |
Print the bundle gem command without executing |
--bundler-version VERSION |
Override the detected Bundler version |
--doctor |
Print runtime versions and supported options |
--version |
Print the create-ruby-gem version |
Development
After checking out the repo, run bin/setup to install dependencies.
Then, run bundle exec rake to run the tests and linter.
You can also run bin/console for an interactive prompt.
bundle exec rake # tests + rubocop (default task)
bundle exec rake spec # tests only
bundle exec rake yard # generate YARD docs into doc/
exe/create-ruby-gem # run the CLI locally
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Make your changes and run tests (
bundle exec rake) - Commit using Conventional Commits format (
git commit -m 'feat: add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Changelog
See CHANGELOG.md for a detailed history of changes, following Keep a Changelog format.
Versioning
This project follows Semantic Versioning 2.0.0.
License
The gem is available as open source under the terms of the MIT License.