{"id":20657782,"url":"https://github.com/boltops-tools/cli-format","last_synced_at":"2026-01-28T21:32:13.808Z","repository":{"id":43872852,"uuid":"234193936","full_name":"boltops-tools/cli-format","owner":"boltops-tools","description":"Format cli output in different ways: tab, table, csv, json, etc","archived":false,"fork":false,"pushed_at":"2024-04-27T00:27:31.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T08:51:13.652Z","etag":null,"topics":[],"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/boltops-tools.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":"2020-01-15T23:30:19.000Z","updated_at":"2024-04-27T00:27:31.000Z","dependencies_parsed_at":"2023-12-02T18:26:46.275Z","dependency_job_id":"75d8fd4f-537d-4931-bfc1-eedaf9507d45","html_url":"https://github.com/boltops-tools/cli-format","commit_stats":null,"previous_names":["tongueroo/cli-format"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/boltops-tools/cli-format","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcli-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcli-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcli-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcli-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boltops-tools","download_url":"https://codeload.github.com/boltops-tools/cli-format/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcli-format/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28852790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2024-11-16T18:23:08.865Z","updated_at":"2026-01-28T21:32:13.792Z","avatar_url":"https://github.com/boltops-tools.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cli-format\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'cli-format'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\n```ruby\nrequire \"cli-format\"\n\noptions = {header: true, format: \"table\"}\nheader = [\"Name\", \"Food\", \"Color\"]\ndata = [\n  [\"Tung\", \"Apple\", \"Yellow\"],\n  [\"Bob\", \"Pear\", \"Blue\"],\n]\n\npresenter = CliFormat::Presenter.new(options)\npresenter.header = header\ndata.each do |row|\n  presenter.rows \u003c\u003c row\nend\npresenter.show\n```\n\nFormat table shows:\n\n    +------+-------+--------+\n    | Name | Food  | Color  |\n    +------+-------+--------+\n    | Tung | Apple | Yellow |\n    | Bob  | Pear  | Blue   |\n    +------+-------+--------+\n\nFormat csv shows:\n\n    Name,Food,Color\n    Tung,Apple,Yellow\n    Bob,Pear,Blue\n\nFormat json shows:\n\n```json\n{\n  \"header\": [\n    \"Name\",\n    \"Food\",\n    \"Color\"\n  ],\n  \"data\": [\n    [\n      \"Tung\",\n      \"Apple\",\n      \"Yellow\"\n    ],\n    [\n      \"Bob\",\n      \"Pear\",\n      \"Blue\"\n    ]\n  ]\n}\n```\n\n## Thor CLI Options\n\nTo expose the format in Thor CLI options, you can use `CliFormat.formats`. Example:\n\n```ruby\noption :format, desc: \"Output formats: #{CliFormat.formats.join(', ')}\"\n```\n\n## Text\n\nIf you would like to grab just the text and not it shown, use the `text` method.\n\n```ruby\npresenter.text\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cli_format.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltops-tools%2Fcli-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboltops-tools%2Fcli-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltops-tools%2Fcli-format/lists"}