{"id":13483801,"url":"https://github.com/kemalyst/kemalyst-generator","last_synced_at":"2025-03-27T15:30:34.415Z","repository":{"id":146156052,"uuid":"77373142","full_name":"kemalyst/kemalyst-generator","owner":"kemalyst","description":"Rails like command line for Kemalyst","archived":true,"fork":false,"pushed_at":"2017-07-20T04:16:52.000Z","size":195,"stargazers_count":12,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T17:48:18.321Z","etag":null,"topics":["crystal","kemalyst","kemalyst-generator"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kemalyst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-26T09:25:01.000Z","updated_at":"2023-06-21T15:30:41.000Z","dependencies_parsed_at":"2023-03-30T08:22:36.704Z","dependency_job_id":null,"html_url":"https://github.com/kemalyst/kemalyst-generator","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalyst%2Fkemalyst-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalyst%2Fkemalyst-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalyst%2Fkemalyst-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalyst%2Fkemalyst-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kemalyst","download_url":"https://codeload.github.com/kemalyst/kemalyst-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245871682,"owners_count":20686246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal","kemalyst","kemalyst-generator"],"created_at":"2024-07-31T17:01:15.420Z","updated_at":"2025-03-27T15:30:33.652Z","avatar_url":"https://github.com/kemalyst.png","language":"HTML","funding_links":[],"categories":["Project Generators"],"sub_categories":[],"readme":"# kemalyst-generator\n[![Build Status](https://travis-ci.org/kemalyst/kemalyst-generator.svg?branch=master)](https://travis-ci.org/kemalyst/kemalyst-generator)\n\nRails like command line for kemalyst\n\n## Installation\n\nYou can build the `kgen` tool from source:\n```shellsession\n$ git clone git@github.com:kemalyst/kemalyst-generator.git\n$ cd kemalyst-generator/\n$ shards install\n$ make\n```\n\nYou should now have a bin/kgen file to run.\n\nYou can symlink this to a more global location like /usr/local/bin to make it easier to use:\n\n`$ ln -sf $(pwd)/bin/kgen /usr/local/bin/kgen`\n\nOptionally, you can use homebrew to install.\n\n```shellsession\n$ brew tap kemalyst/kgen\n$ brew install kgen\n```\n\n## Commands\n\n``` shell\n$ ./bin/kgen --help\nkgen [OPTIONS] SUBCOMMAND\n\nKemalyst Generator\n\nSubcommands:\n  c         alias for console\n  console\n  g         alias for generate\n  generate\n  i         alias for init\n  init\n  m         alias for migrate\n  migrate\n  w         alias for watch\n  watch\n\nOptions:\n  -h, --help     show this help\n  -v, --version  show version\n```\n\n## Usage\n\n```sh\nkgen init app [your_app] -d [pg | mysql | sqlite] -t [slang | ecr] --deps \ncd [your_app]\n```\noptions: `-d` defaults to pg. `-t` defaults to slang. `--deps` will run `crystal deps` for you.\n\nThis will generate a traditional web application:\n - /config - Application and HTTP::Handler config's goes here.  The database.yml and routes.cr are here.\n - /lib - shards are installed here.\n - /public - Default location for html/css/js files.  The static handler points to this directory.\n - /spec - all the crystal specs go here.\n - /src - all the source code goes here.\n\n\nGenerate scaffolding for a resource:\n```sh\nkgen generate scaffold Post name:string body:text draft:bool\n```\n\nThis will generate scaffolding for a Post:\n - src/controllers/post_controller.cr\n - src/models/post.cr\n - src/views/post/*\n - db/migrations/[datetimestamp]_create_post.sql\n - spec/controllers/post_controller_spec.cr\n - spec/models/post_spec.cr\n - appends route to config/routes.cr\n - appends navigation to src/layouts/_nav.slang\n\n### Run Locally\nTo test the demo app locally:\n\n1. Create a new Postgres or Mysql database called `[your_app]_development`\n2. Configure your database with one of the following ways.\n  * Add it in `config/database.yml`\n  * Run `export DATABASE_URL=postgres://[username]:[password]@localhost:5432/[your_app]_development` which overrides the `config/database.yml`.\n3. Migrate the database: `kgen migrate up`. You should see output like `\nMigrating db, current version: 0, target: [datetimestamp]\nOK   [datetimestamp]_create_shop.sql`\n4. Run the specs: `crystal spec`\n5. Start your app: `kgen watch`\n6. Then visit `http://0.0.0.0:3000/`\n\nNote: The `kgen watch` command uses [Sentry](https://github.com/samueleaton/sentry) to watch for any changes in your source files, recompiling automatically.\n\nIf you don't want to use Sentry, you can compile and run manually:\n\n1. Build the app `crystal build --release src/[your_app].cr`\n2. Run with `./[your_app]`\n3. Visit `http://0.0.0.0:3000/`\n\n\n## Development\n\nSee opened issues.\n\n## Contributing\n\n1. Fork it ( https://github.com/kemalyst/kemalyst-generator/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [TechMagister](https://github.com/TechMagister) Arnaud Fernandés - creator, maintainer\n- [drujensen](https://github.com/drujensen) Dru Jensen - contributor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemalyst%2Fkemalyst-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkemalyst%2Fkemalyst-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemalyst%2Fkemalyst-generator/lists"}