Back to Ohmyzsh

Hanami Plugin

plugins/hanami/README.md

latest2.6 KB
Original Source

Hanami Plugin

This plugin adds convenient aliases to work with Hanami via console. It's inspired by Rails plugin, so if you've used it, you'll feel like home.

To use it, add hanami to the plugins array in your zshrc file:

zsh
plugins=(... hanami)

Usage

For example, type hc into your console when you're within Hanami project directory to run the application console. Have a look at available shortcuts below. You can read more about these commands on the official website.

Aliases

AliasCommandDescription
HED*HANAMI_ENV=developmentSet environment variable HANAMI_ENV to development
HEP*HANAMI_ENV=productionSet environment variable HANAMI_ENV to production
HET*HANAMI_ENV=testSet environment variable HANAMI_ENV to test
hchanami consoleRun application console
hdhanami destroyRemove specified hanami resource
hghanami generateCreate specified hanami resource
hgmhanami generate migrationCreate migration file
hshanami serverLaunch server with hanami application
hsphanami server -pLaunch server with specified port
hrhanami routesList application routes
hdchanami db createCreate application database
hddhanami db dropDelete application database
hdphanami db preparePrepare database for the current environment
hdahanami db applyRecreates a fresh schema after migrations (destructive)
hdvhanami db versionPrint current database version
hdrshdd && hdpDrop and recreate application database
hdtpHET hdpActualize test environment database
hrg`hrgrep`

* You should use these at the beginning of a command, for example:

console
$ HED hdd # equivalent to 'HANAMI_ENV=development hanami db drop'