{"id":15512679,"url":"https://github.com/tongueroo/cli-template","last_synced_at":"2026-02-28T17:32:16.862Z","repository":{"id":66286109,"uuid":"120945887","full_name":"tongueroo/cli-template","owner":"tongueroo","description":"Generate a CLI tool quickly","archived":false,"fork":false,"pushed_at":"2020-03-20T23:03:51.000Z","size":167,"stargazers_count":16,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T06:39:39.669Z","etag":null,"topics":["cli","command","generator","thor"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/tongueroo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-09T19:20:28.000Z","updated_at":"2025-06-17T10:10:46.000Z","dependencies_parsed_at":"2023-05-18T18:15:51.638Z","dependency_job_id":null,"html_url":"https://github.com/tongueroo/cli-template","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/tongueroo/cli-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tongueroo%2Fcli-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tongueroo%2Fcli-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tongueroo%2Fcli-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tongueroo%2Fcli-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tongueroo","download_url":"https://codeload.github.com/tongueroo/cli-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tongueroo%2Fcli-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29944767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","command","generator","thor"],"created_at":"2024-10-02T09:53:47.271Z","updated_at":"2026-02-28T17:32:16.843Z","avatar_url":"https://github.com/tongueroo.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# CLI Template\n\n[![CircleCI](https://circleci.com/gh/tongueroo/cli-template.svg?style=svg)](https://circleci.com/gh/tongueroo/cli-template)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c6c4f26aaafccab10baf/maintainability)](https://codeclimate.com/github/tongueroo/cli-template/maintainability)\n\n[![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)\n\n`cli-template` is a generator tool that builds a starter CLI project based on [Thor](http://whatisthor.com/). It is the successor tool to [thor_template](https://github.com/tongueroo/thor_template), which is also a tool that generates CLI projects.\n\nThe predecessor tool is covered in this original blog post, [Build Thor CLI Project in Under a Second](https://blog.boltops.com/2017/09/14/build-thor-cli-project-in-under-a-second). It covers usage and also contains a video demo.  An updated blog post will eventually be made, for now, refer to the original blog post.\n\nThe generated CLI project comes with:\n\n* example passing specs\n* auto-completion\n\n## Usage\n\n    cli-template new mycli\n    cd mycli\n    exe/mycli hello world\n\nThe above generated a starter CLI project called `mycli` with a working hello command.  The created project also has starter specs for you 😁\n\n    $ rake\n    Mycli::CLI\n      mycli\n        should hello world\n        should goodbye world\n\n    Finished in 1.12 seconds (files took 0.71706 seconds to load)\n    2 examples, 0 failures\n\n### Subcommands\n\nUse the `--subcommand` to have the generator also include a subcommand example.\n\n    cli-template new mycli --subcommand\n    cd mycli\n    exe/foo sub goodbye # subcommand example\n\n## Release\n\nOnce you are satisfied with the CLI tool, you can release it as a gem.\n\n    1. edit the mycli.gemspec\n    2. edit lib/mycli/version.rb\n    3. update the CHANGELOG.md\n\nAnd run:\n\n    rake release\n\nWhen installed as a gem, you no longer have to prepend exe in front of the command.  For example, `exe/mycli` becomes the `mycli` command.\n\n## Different starter templates\n\nThere are 2 different templates that the tool generates from:\n\n1. basic thor project: A standard CLI tool based on basic usage of Thor.\n2. colon namespaced project: The generated CLI project still uses Thor but it does some manipulation in order to allow defining namespaced methods with colons instead of spaces.  Example: `mycli sub:command` vs `mycli sub command`.\n\nTo use the different templates:\n\n    TEMPLATE=colon_namespaces cli-template new mycli\n    TEMPLATE=default cli-template new mycli\n    cli-template new mycli # same as TEMPLATE=default\n\n## Auto Completion\n\nThere is support for TAB completion in the newly generated CLI project for the default template.  To enable auto completion, add this to `~/.bashrc` or `~/.profile`:\n\n    eval $(mycli completion_script)\n\nRemember to re-load the shell. Note, the auto completion will only work if the cli command is avaialble in your PATH.  You can do this by installing the gem.  You can also create a wrapper bash script that calls to your development cli command like so:\n\n    cat \u003e /usr/local/bin/mycli \u003c\u003c 'EOL'\n    #!/bin/bash\n    exec ~/src/mycli/exe/mycli \"$@\"\n    EOL\n    chmod a+x /usr/local/bin/mycli\n\n### Experimental Auto Completion Support for colon_namespaces Template\n\nThe auto-completion for the colon_namespaces template CLI project is experimental. Ran into a few issues:\n\n1. Slow as to make auto-completion useless. This because the generated CLI invokes autoloading when it detects the methods for the completion words. Ideas on speeding this would be appreciated! Right now it takes about 1 second.\n2. Does not work with colons currently.  Will have to look into this post [Bash Command-Line Tab Completion Colon Character\n](https://stackoverflow.com/questions/25362968/bash-command-line-tab-completion-colon-character).\n3. Does not work with the last two characters are `--`.\n\nSuggestions to are appreciated!\n\n## Installation\n\n    gem install cli-template\n\n## Contributing\n\n1. Fork it\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 new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftongueroo%2Fcli-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftongueroo%2Fcli-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftongueroo%2Fcli-template/lists"}