kemalyst-generator
Version, currently 0.8.249 versions
- 0.8.2latestJul 20, 2017
- 0.8.1not indexedJul 20, 2017
- 0.8.0not indexedJul 20, 2017
- 0.7.3not indexedJul 20, 2017
- 0.7.2not indexedJul 20, 2017
- 0.7.1not indexedJul 20, 2017
- 0.7.0not indexedJul 20, 2017
- 0.6.6not indexedJul 20, 2017
- 0.6.5not indexedJul 20, 2017
- 0.6.4not indexedJul 20, 2017
- 0.6.3not indexedJul 20, 2017
- 0.6.2not indexedJul 20, 2017
- 0.6.1not indexedJul 20, 2017
- 0.6.0not indexedJul 20, 2017
- 0.5.1not indexedJul 20, 2017
- 0.5.0not indexedJul 20, 2017
- 0.4.8not indexedJul 20, 2017
- 0.4.7not indexedJul 20, 2017
- 0.4.6not indexedJul 20, 2017
- 0.4.5not indexedJul 20, 2017
- 0.4.4not indexedJul 20, 2017
- 0.4.3not indexedJul 20, 2017
- 0.4.2not indexedJul 20, 2017
- 0.4.1not indexedJul 20, 2017
- 0.4.0not indexedJul 20, 2017
- 0.3.2not indexedJul 20, 2017
- 0.3.1not indexedJul 20, 2017
- 0.3.0not indexedJul 20, 2017
- 0.2.10not indexedJul 20, 2017
- 0.2.9not indexedJul 20, 2017
- 0.2.8not indexedJul 20, 2017
- 0.2.7not indexedJul 20, 2017
- 0.2.6not indexedJul 20, 2017
- 0.2.5not indexedJul 20, 2017
- 0.2.4not indexedJul 20, 2017
- 0.2.3not indexedJul 20, 2017
- 0.2.2not indexedJul 20, 2017
- 0.2.1not indexedJul 20, 2017
- 0.2.0not indexedJul 20, 2017
- 0.1.10not indexedJul 20, 2017
- 0.1.9not indexedJul 20, 2017
- 0.1.8not indexedJul 20, 2017
- 0.1.7not indexedJul 20, 2017
- 0.1.6not indexedJul 20, 2017
- 0.1.5not indexedJul 20, 2017
- 0.1.4not indexedJul 20, 2017
- 0.1.2not indexedJul 20, 2017
- 0.1.1not indexedJul 20, 2017
- 0.1.0not indexedJul 20, 2017
github.com/kemalyst/kemalyst-generator
Rails like command line for Kemalyst
Installation
# Add this to your shard.yml
dependencies:
kemalyst-generator:
github: kemalyst/kemalyst-generator
version: ~> 0.8.2Then run:
shards installshard.yml
- Crystal
0.23.1- License
- MIT
- Authors
- Dru Jensen, Arnaud Fernandés
- Target
kemalyst-generatorfrom src/kemalyst-generator.cr
Dependencies
Runtime Dependencies
- pg*github: will/crystal-pg
- cli~> 0.5.1github: mosop/cli
- icr*github: TechMagister/crystal-icr, branch: master
- mysql*github: crystal-lang/crystal-mysql
- sentry*github: TechMagister/sentry, branch: change_cli
- micrate*github: juanedi/micrate
- sqlite3*github: crystal-lang/crystal-sqlite3
- teeplate~> 0.4.4github: mosop/teeplate
README
kemalyst-generator
Rails like command line for kemalyst
Installation
You can build the kgen tool from source:
$ git clone git@github.com:kemalyst/kemalyst-generator.git
$ cd kemalyst-generator/
$ shards install
$ make
You should now have a bin/kgen file to run.
You can symlink this to a more global location like /usr/local/bin to make it easier to use:
$ ln -sf $(pwd)/bin/kgen /usr/local/bin/kgen
Optionally, you can use homebrew to install.
$ brew tap kemalyst/kgen
$ brew install kgen
Commands
$ ./bin/kgen --help
kgen [OPTIONS] SUBCOMMAND
Kemalyst Generator
Subcommands:
c alias for console
console
g alias for generate
generate
i alias for init
init
m alias for migrate
migrate
w alias for watch
watch
Options:
-h, --help show this help
-v, --version show version
Usage
kgen init app [your_app] -d [pg | mysql | sqlite] -t [slang | ecr] --deps
cd [your_app]
options: -d defaults to pg. -t defaults to slang. --deps will run crystal deps for you.
This will generate a traditional web application:
- /config - Application and HTTP::Handler config's goes here. The database.yml and routes.cr are here.
- /lib - shards are installed here.
- /public - Default location for html/css/js files. The static handler points to this directory.
- /spec - all the crystal specs go here.
- /src - all the source code goes here.
Generate scaffolding for a resource:
kgen generate scaffold Post name:string body:text draft:bool
This will generate scaffolding for a Post:
- src/controllers/post_controller.cr
- src/models/post.cr
- src/views/post/*
- db/migrations/[datetimestamp]_create_post.sql
- spec/controllers/post_controller_spec.cr
- spec/models/post_spec.cr
- appends route to config/routes.cr
- appends navigation to src/layouts/_nav.slang
Run Locally
To test the demo app locally:
- Create a new Postgres or Mysql database called
[your_app]_development - Configure your database with one of the following ways.
- Add it in
config/database.yml - Run
export DATABASE_URL=postgres://[username]:[password]@localhost:5432/[your_app]_developmentwhich overrides theconfig/database.yml.
- Migrate the database:
kgen migrate up. You should see output likeMigrating db, current version: 0, target: [datetimestamp] OK [datetimestamp]_create_shop.sql - Run the specs:
crystal spec - Start your app:
kgen watch - Then visit
http://0.0.0.0:3000/
Note: The kgen watch command uses Sentry to watch for any changes in your source files, recompiling automatically.
If you don't want to use Sentry, you can compile and run manually:
- Build the app
crystal build --release src/[your_app].cr - Run with
./[your_app] - Visit
http://0.0.0.0:3000/
Development
See opened issues.
Contributing
- Fork it ( https://github.com/kemalyst/kemalyst-generator/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- TechMagister Arnaud Fernandés - creator, maintainer
- drujensen Dru Jensen - contributor
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.8.2- Tagged
- Jul 20, 2017
- Commit
38b51914f33f- Crystal
0.23.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/kemalyst/kemalyst-generator
Metadata
- Created
- Aug 13, 2026
- Updated
- Oct 10, 2026
- Synced
- Oct 10, 2026
- Versions
- 49