All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Break Versioning.
- Add
--nameoption tohanami new, to specify a custom module namespace while using the positional argument as the directory path. For example,hanami new my_bookshelf --name=bookshelfcreates the app inmy_bookshelf/withBookshelfas the module name. (@aaronmallen in #387) - Add
--template-engineoption tohanami generateandhanami newto specify which template engine should be used for generated template files. Supportserb,hamlandslim. (@katafrakt in #280, #389, #390) - Add
--testoption tohanami newto specify which test framework to use. Supportsrspec(default) andminitest. (@timriley in #399) - Add
--forceoption to all generators (except migration), which will override existing files instead of exiting early (@katafrakt in #397)
hanami newputsdry-validationin the app'sGemfileinstead ofhanami-validations. Hanami Validations will no longer be used; Hanami Action now checks for Dry Validation directly. (@timriley)- Update for
hanami-controllergem rename tohanami-action. (@cllns in #402)
- In
assetscommands, provide the node command with the assets config path relative to app root instead of an absolute path (config/assets.jsinstead of/full/path/to/config/assets.js). This allows the assets commands to work in environments where Node.js is "sandboxed" in such a way that it doesn't share the same absolute path. (@haileys in #381).
2.3.4 - 2026-01-23
- Avoid an unhandled exception in the "are we inside a Hanami app?" check that happens at the beginning of every CLI invocation. This would occur when a bundled gem is already activated (from our testing: bigdecimal) but in conflict with the required version of that gem by a Hanami dependency. (@timriley in #380).
2.3.3 - 2025-12-04
- Support the newly released Bundler v4 by removing the upper version bound from our dependency. (@timriley in #373)
2.3.2 - 2025-11-16
- Fix potential deadlocks with
db structure dumpfor large structure files. (@timriley in #370, report from @pat in #369) - Decouple the hanami-assets npm package version from the current Hanami version in generated
package.json, using the stable minor version (e.g.^2.3.0) instead of the exact version (e.g.^2.3.1). This allows Hanami patch releases without requiring a corresponding hanami-assets npm package release. (@timriley in #270)
2.3.1 - 2025-11-14
- Fix stray wording in
README.mdin new apps. (@davidcelis in #368)
2.3.0 - 2025-11-12
- Generate a
bin/setupwhen generating new apps. (@davidcelis in #359) - Generate
bin/hanamiandbin/rakebinstubs when generating new apps. (@jaredcwhite in #344) - Generate a view context class when generating new apps or slices. (@afomera in #350)
- Add
--gem-sourceoption tohanami new, to specify the gem source for yourGemfile. For example:hanami new my_app --gem-source=gem.coop. (@svooop in #356)
- Print a one-time warning when accessing an un-booted slice’s
keysin the console. (@timriley in #349) - Add
--bootflag toconsolecommand, which boots the Hanami app before loading the console. (@kyleplump in #331) - In new apps, require dry-operation v1.0.1 in the generated
Gemfile. This is necessary to pull in a fix required for Hanami’s automatic integration of Dry Operation with the database layer. (@timriley in #351) - When generating new apps with
--head, use the new GitHub repo names in theGemfile("hanami/hanami-view"instead of"hanami/view"). (@afomera in #354) - When generating new apps with
--head, add"hanami-utils"to theGemfile. (@timriley in #362) - In new apps, include a patch-level version (e.g. "~> 2.3.0") for Hanami gems in generated
Gemfile, ensuring updates to the next minor version are only done intentionally. (@timriley in #367)
- When running
db rollbackin development, also rollback the test database. (@timriley in #355) - Remove "restrict" and "unrestrict" statements (which constantly change, even if there are no structure changes) from Postgres structure dumps. (@rickenharp in #336)
- Remove "-- Dumped from" version comments from Postgres dumps (which will change based on the local client version). (@davidcelis in #358)
- Check for Postgres database existence in a more robust way. The previous method could fail if both the Postgres username and database name were the same. (@rickenharp in #332)
- Fix structure dump and load for MySQL 9.5.0. (@timriley in #348)
- Preserve Bundler environment variables when commands make system calls. (@robyurkowski in 346)
2.3.0.beta2 - 2025-10-17
- Add
hanami runcommand, to run your own code. For example,hanami run path/to/script.rborhanami run 'puts Hanami.app["repos.user_repo"].all.count'. (@afomera in #338)
- Add
--skip-testsflag togenerate actioncommand. (@kyleplump in #335) - In new apps, updated generated types module to
Dry.Types(default: :strict). (@minaslater in #323) - When generators add routes, add those routes to per-slice routes files (
config/routes.rbwithin slice directories) if they exist. (@stephannv in #342) - Drop support for Ruby 3.1
- Handle mixed case names given to
generatesubcommands. (@cllns in #327)
2.3.0.beta1 - 2025-10-03
- Running
hanami generatecommands within a slice directory will generate the file in that slice. (@krzykamil in #298) - Add
db rollbackcommand, supporting rolling back a single database at a time. (@krzykamil in #300) consolecommand loads configured extensions from app config. Add these using e.g.config.console.include MyModule, AnotherModule. (@alassek in #324)consolecommand uses REPL engine configured in app config. Set this using e.g.config.console.engine = :pry; valid options are:irb(default) and:pry. (@alassek in #324)
- Prevent
hanami newfrom creating apps with confusing names (currently: "app" or "slice"). (@seven1m in #272) - Provide more helpful instructions in generated app README. (@hanarimawi in #273)
- Prevent generators from overwriting files. (@maxemitchell in #274, @stephannv in #319)
- Add irb as a gem dependency to avoid default gem warnings. (@y-yagi in #294)
- Expand on comments
config/assets.jsand enable customization function by default. (@robyurkowski in #293) - Run
git initat the end ofhanami new. (@krzykamil in #295) - Prevent blank lines from showing when generating classes without deep module nesting. (@cllns)
- Add
--skip-viewflag tohanami new. (@kyleplump in #308) - Support Rack 3 in addition to Rack 2 (for
hanami servercommand). (@kyleplump in #289) - Ensure compatibility with MySQL 9.4's CLI tools in
db structure loadcommand. (@timriley in #315) - Generated
Rakefilewill load tasks defined inlib/tasks/. (@AlexanderZagaynov in #318)
- Allow generated
public/400.htmlandpublic/500.htmlto go into source control. (@kyleplump in #290) - Properly show database errors from failed
db dropcommands. (@katafrakt in #281) - Ensure consistent env var loading by disallowing Foreman's own env processing in generated
bin/devscript. (@cflipse in #305) - Use the configured app inflector (and any custom inflections) for all commands. (@timriley in #312)
- For app generated with
hanami newwith--head, includehanami-cliin theGemfile. (@afomera in #328)
2.2.1 - 2024-11-12
- Run a bundle install inside
hanami install. Combined with first-party extension gems modifying the new app'sGemfilevia abefore "install"command hook, this ensures that all necessary gems are installed during thehanami newcommand. (@timriley in #269)
- Allow
hanami newto be called with--skip-db. (@timriley in #266)
2.2.0 - 2024-11-05
- Add
--gatewayoption togenerate relation. (@kyleplump in #261) - Depend on stable release of dry-operation in new app
Gemfile. (@timriley in #262) - Depend on newer dry-types with a simpler version constraint in new app
Gemfile. (@timriley in #263) - Point to Hanami's own migrations guide from generated migration files. (@alassek in #264)
2.2.0.rc1 - 2024-10-29
- Generate a
config/db/seeds.rbfile in new apps. (@timriley, @fbeausoleil in #255, #256)
- Add
--envand-eoptions to all app commands, for setting the Hanami env. (@timriley in #246) - Keep test database in sync by applying
hanami dbcommands to both development and test databases when invoked in development environment. (@timriley in #247) - Add
--skip-routeflag togenerate actionandgenerate slicecommands. (@kyleplump in #227) - Include a
change doblock in generated migrations. (@timriley in #254) - Generate MySQL database URL in
.envthat works with standard Homebrew MySQL installation. (@timriley in #249) - Remove ROM extension boilerplate in operations generated by
hanami newandgenerate operation(this is now applied automatically). (@timriley, @alassek in #240, #252) - Print a warning when running
db seedbut expected seeds files could not be found. (@fbeausoleil in #256) - Only register
generatesubcommands if the relevant gems are bundled. (@swilgosz in #242) - When both IRB and pry are loaded, use IRB as the default engine for
hanami console. (@asaunders in #182)
- Fix error dumping structure when there are no migrations. (@timriley in #244)
- Stop erroneous misconfigured DB warnings from
hanami dbcommands when a database is configured once but shared across slices. (@timriley in #253)
2.2.0.beta2 - 2024-09-25
- MySQL support for
dbcommands. (@timriley in #226) - Support for multiple gateways in
dbcommands. (@timriley in #232, #234, #237, #238)
- Delete
.keepfiles when generating new files into previously empty directory. (@kyleplump, @timriley in #224) - Add
db/*.sqliteto the.gitignorein new apps. (@cllns in #210) - Print warnings for misconfigured databases when running
dbcommands. (@cllns in #211)
2.2.0.beta1 - 2024-07-16
- Generate db files in
hanami newandgenerate slice. (@cllns) - Add
dbcommands:create,drop,migrate,structure dumpstructure load,seedprepare,version. (@timriley) - Support SQLite and Postgres for
dbcommands. (@timriley) - Add
generatecommands for db components:generate migration,generate relation,generate repo,generate struct. (@cllns) - Add
generate componentcommand. (@krzykamil) - Add
generate operationcommand. (@cllns)
- Drop support for Ruby 3.0
2.1.1 - 2024-03-19
- Properly pass INT signal to child processes when interrupting
hanami assets watchcommand. (@ryanbigg)
2.1.0 - 2024-02-27
- Underscore slice names in
public/assets/to avoid naming conflicts with nested asset entry points. In this arrangement, an "admin" slice will have its assets compiled intopublic/assets/_admin/. (@timriley)
2.1.0.rc3 - 2024-02-16
- For
hanami assetscommands, run a separate assets compilation process per slice (in parallel). (@timriley) - Generate compiled assets into separate folders per slice, each with its own
assets.jsmanifest file:public/assets/for the app, andpublic/assets/[slice_name]/for each slice. (@timriley) - For
hanami assetscommands, directly detect and invoke theconfig/assets.jsfiles. Look for this file within each slice, and fall back to the app-level file. (@timriley) - Do not generate
"scripts": {"assets": "..."}section in new app'spackage.json. (@timriley) - Subclasses of
Hanami::CLI::Commandreceive default args to their#initializemethods, and do not need to re-declare default args themselves. (@timriley) - Alphabetically sort hanami gems in the new app
Gemfile. (@parndt)
- Strip invalid characters from module name when generating new app. (@nishiki)
2.1.0.rc2 - 2023-11-08
- Add
--skip-testsforhanami generatecommands. This CLI option will skip tests generation. (@timriley)
- Set
"type": "module"in package.json, enabling ES modules by default. (@timriley) - Rename
config/assets.mjstoconfig/assets.js(use a plain.jsfile extension). (@timriley)
- Use correct helper names in generated app layout. (@timriley)
- Ensure to generate apps with correct pre-release version of
hanami-assetsNPM package. (@lucaguidi) - Print to stderr NPM installation errors when running
hanami install. (@cllns) - Ensure to install missing gems after
hanami installis ran. (@cllns)
2.1.0.rc1 - 2023-11-01
hanami newto generatebin/devas configuration forhanami dev. (@timriley)- Introducing
hanami generate partto generate view parts. (@lucaguidi)
hanami newgenerates aconfig/assets.mjsas Assets configuration. (@timriley)hanami newgenerates a leanerpackage.json. (@timriley)hanami newdoesn't generate a default root route anymore. (@timriley)hanami newto generate a redesigned 404 and 500 error pages. (@aaronmoodie, @timriley)hanami newgenerates a fully documented Puma configuration inconfig/puma.rb. (@lucaguidi)- When generating a RESTful action, skip
create, ifnewis present, andupdate, ifeditis present. (@lucaguidi)
2.1.0.beta2 - 2023-10-04
hanami newgeneratesProcfile.dev. (@lucaguidi)hanami newgenerates basic app assets, ifhanami-assetsis bundled by the app. (@lucaguidi)hanami newaccepts--headto generate the app using Hanami HEAD version from GitHub. (@lucaguidi)hanami generate slicegenerates basic slice assets, ifhanami-assetsis bundled by the app. (@lucaguidi)hanami generate actiongenerates corresponding view, ifhanami-viewis bundled by the app. (@ryanbigg)hanami assets compileto compile assets at the deploy time. (@lucaguidi)hanami assets watchto watch and compile assets at the development time. (@lucaguidi)hanami devto start the processes inProcfile.dev. (@lucaguidi)
hanami newgenerates aGemfilewithhanami-webconsolein:developmentgroup. (@lucaguidi)hanami newgenerates aGemfilewith versionedhanami-webconsole,hanami-rspec, andhanami-reloader. (@lucaguidi)
2.1.0.beta1 - 2023-06-29
hanami newto generate default views, templates, and helpers. (@timriley)hanami generate sliceto generate default views, templates, and helpers. (@timriley)hanami generate actionto generate associated view and template. (@timriley)- Introduced
hanami generate view. (@timriley) hanami newto generateGemfilewithhanami-viewandhanami-webconsolegems. (@timriley)hanami newto generate default error pages for404and500HTTP errors. (@timriley)
hanami serverto start only one Puma worker by default. (@parndt)
2.0.3 - 2023-02-01
- Generate a default
.gitignorewhen usinghanami new. (@lucaguidi)
- Ensure to run automatically bundle gems when using
hanami newon Windows. (@dsisnero) - Ensure to generate the correct action identifier in routes when using
hanami generate actionwith deeply nested action name. (@lucaguidi)
2.0.2 - 2022-12-25
- Official support for Ruby 3.2. (@lucaguidi)
2.0.1 - 2022-12-06
- Ensure to load
.envfiles during CLI commands execution. (@lucaguidi) - Ensure
hanami serverto respect HTTP port used in.envor the value given as CLI argument (--port). (@lucaguidi)
2.0.0 - 2022-11-22
- Use Zeitwerk to autoload the gem. (@timriley)
- In case of internal exception, don't print the stack trace to stderr, print the error message, exit with 1. (@lucaguidi)
- Ensure to be able to run
hanamiCLI in Hanami app subdirectories. (@timriley) - Return an error when trying to run
hanami newwith an existing target path (file or directory). (@cllns)
2.0.0.rc1 - 2022-11-08
2.0.0.beta4 - 2022-10-24
- Show output when generating files (e.g. in
hanami new). (@cllns in #49) - Advertise Bundler and Hanami install steps when running
hanami new. (@lucaguidi in #54)
2.0.0.beta3 - 2022-09-21
- New applications to support Puma server out of the box. Add the
pumagem toGemfileand generateconfig/puma.rb. (@lucaguidi) - New applications to support code reloading for
hanami serverviahanami-reloader. This gem is added to app'sGemfile. (@lucaguidi) - Introduce code reloading for
hanami consolevia#reloadmethod to be invoked within the console context. (@mbusque)
hanami generate actionto add routes toconfig/routes.rbwithout thedefineblock context. See hanami/hanami#1208. (@solnic)
- Respect plural when generating code via
hanami newandhanami generate. Example:hanami new code_insights=>CodeInsightsinstead ofCodeInsight. (@lucaguidi) - Ensure
hanami generate actionto not crash when invoked with non-RESTful action names. Example:hanami generate action talent.apply. (@lucaguidi)
2.0.0.beta2 - 2022-08-16
- Added
hanami generate slicecommand, for generating a new slice. (@lucaguidi in #32) - Added
hanami generate actioncommand, for generating a new action in the app or a slice. (@lucaguidi in #33) - Added
hanami middlewarescommand, for listing middleware configured in app and/or inconfig/routes.rb. (@mbusque in #30)
hanamicommand will detect the app even when called inside nested subdirectories. (@mbusque, @timriley in #34)- Include hanami-validations in generated app's
Gemfile, allowing action classes to specify.params. (@swilgosz in #31) - Include dry-types in generated app's
Gemfile, which is used by the types module defined inlib/[app_name]/types.rb(dry-types is no longer a hard dependency of the hanami gem as of 2.0.0.beta2). (@timriley in #29) - Include dotenv in generated app's
Gemfile, allowingENVvalues to be loaded from.env*files. (@timriley in #29)
2.0.0.beta1 - 2022-07-20
- Implemented
hanami newto generate a new Hanami app. (@lucaguidi) - Implemented
hanami consoleto start an interactive console (REPL). (@solnic) - Implemented
hanami serverto start a HTTP server based on Rack. (@mbusque) - Implemented
hanami routesto print app routes. (@mbusque) - Implemented
hanami versionto print app Hanami version. (@lucaguidi)
2.0.0.alpha8.1 - 2022-05-23
- Ensure CLI starts properly by fixing use of
Slice.slice_name. (@timriley)
2.0.0.alpha8 - 2022-05-19
- Respect HANAMI_ENV env var to set Hanami env if no
--envoption is supplied. (@croomes) - Ensure Sequel migrations extension is loaded before related
dbcommands are run. (@waiting-for-dev)
2.0.0.alpha7 - 2022-03-11
- [Internal] Update console slice readers to work with new
Hanami::Application.slicesAPI. (@timriley)
2.0.0.alpha6.1 - 2022-02-11
- Ensure
hanami dbcommands to work withhanamiv2.0.0.alpha6. (@vietqhoang)
2.0.0.alpha6 - 2022-02-10
- Official support for Ruby: MRI 3.1. (@lucaguidi)
- Drop support for Ruby: MRI 2.6, and 2.7. (@lucaguidi)
2.0.0.alpha4 - 2021-12-07
- Display a custom prompt when using irb-based console (consistent with pry-based console). (@timriley)
- Support
postgresql://URL schemes (in addition to existingpostgres://support) fordbsubcommands. (@parndt)
- Ensure slice helper methods work in console (e.g. top-level
mainmethod will returnMain::Sliceif an app has a "main" slice defined). (@timriley)
2.0.0.alpha3 - 2021-11-09
2.0.0.alpha2 - 2021-05-04
- Official support for Ruby: MRI 3.0. (@lucaguidi)
- Dynamically change the set of available commands depending on the context (outside or inside an Hanami app). (@lucaguidi)
- Dynamically change the set of available commands depending on Hanami app architecture. (@lucaguidi)
- Implemented
hanami version(available both outside and inside an Hanami app). (@lucaguidi) - Implemented
db *commands (available both outside and inside an Hanami app) (sqlite and postgres only for now). (@solnic) - Implemented
consolecommand with support forIRBandPry(pryis auto-detected). (@solnic)
- Changed the purpose of this gem: the CLI Ruby framework has been extracted into
dry-cligem.hanami-cliis now thehanamicommand line. (@lucaguidi) - Drop support for Ruby: MRI 2.5. (@lucaguidi)
1.0.0.alpha1 - 2019-01-30
- Inheriting from subclasses of
Hanami::CLI::Command, allows to inherit arguments, options, description, and examples. (@lucaguidi) - Allow to use
superfrom#call. (@lucaguidi)
- Drop support for Ruby: MRI 2.3, and 2.4. (@lucaguidi)
0.3.1 - 2019-01-18
- Official support for Ruby: MRI 2.6. (@lucaguidi)
- Support
bundler2.0+. (@lucaguidi)
0.3.0 - 2018-10-24
0.3.0.beta1 - 2018-08-08
- Introduce array type for arguments (
foo exec test spec/bookshelf/entities spec/bookshelf/repositories). (@davydovanton, @AlfonsoUceda) - Introduce array type for options (
foo generate config --apps=web,api). (@davydovanton, @AlfonsoUceda) - Introduce variadic arguments (
foo run ruby:latest -- ruby -v). (@AlfonsoUceda) - Official support for JRuby 9.2.0.0. (@lucaguidi)
- Print informative message when unknown or wrong option is passed (
"test" was called with arguments "--framework=unknown"). (@davydovanton)
0.2.0 - 2018-04-11
0.2.0.rc2 - 2018-04-06
0.2.0.rc1 - 2018-03-30
0.2.0.beta2 - 2018-03-23
- Support objects as callbacks. (@davydovanton, @lucaguidi)
- Ensure callbacks' context of execution (aka
self) to be the command that is being executed. (@davydovanton, @lucaguidi)
0.2.0.beta1 - 2018-02-28
- Register
before/aftercallbacks for commands. (@davydovanton)
0.1.1 - 2018-02-27
- Official support for Ruby: MRI 2.5. (@lucaguidi)
- Ensure default values for arguments to be sent to commands. (@AlfonsoUceda)
- Ensure to fail when a missing required argument isn't provided, but an option is provided instead. (@AlfonsoUceda)
0.1.0 - 2017-10-25
0.1.0.rc1 - 2017-10-16
0.1.0.beta3 - 2017-10-04
0.1.0.beta2 - 2017-10-03
- Allow default value for arguments. (@AlfonsoUceda)
0.1.0.beta1 - 2017-08-11
- Commands banner and usage. (@AlfonsoUceda, @lucaguidi)
- Added support for subcommands. (@AlfonsoUceda)
- Validations for arguments and options. (@AlfonsoUceda)
- Commands arguments and options. (@AlfonsoUceda)
- Commands description. (@AlfonsoUceda)
- Commands aliases. (@AlfonsoUceda, @oana-sipos)
- Exit on unknown command. (@lucaguidi)
- Command lookup. (@lucaguidi, @AlfonsoUceda, @oana-sipos)
- Trie based registry to register commands and allow third-parties to override/add commands. (@lucaguidi, @timriley)