{"id":20737626,"url":"https://github.com/michalspano/clocrt","last_synced_at":"2026-05-27T21:31:48.072Z","repository":{"id":54095874,"uuid":"519626134","full_name":"michalspano/clocrt","owner":"michalspano","description":"clocrt - transform cloc output into a Markdown table","archived":false,"fork":false,"pushed_at":"2022-08-09T21:37:03.000Z","size":5691,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T11:35:02.767Z","etag":null,"topics":["cli","cloc","go","unix"],"latest_commit_sha":null,"homepage":"","language":"Go","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/michalspano.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}},"created_at":"2022-07-30T21:42:14.000Z","updated_at":"2022-08-07T12:20:10.000Z","dependencies_parsed_at":"2022-08-13T06:40:54.883Z","dependency_job_id":null,"html_url":"https://github.com/michalspano/clocrt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/michalspano/clocrt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalspano%2Fclocrt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalspano%2Fclocrt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalspano%2Fclocrt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalspano%2Fclocrt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michalspano","download_url":"https://codeload.github.com/michalspano/clocrt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalspano%2Fclocrt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","cloc","go","unix"],"created_at":"2024-11-17T06:15:04.823Z","updated_at":"2026-05-27T21:31:48.056Z","avatar_url":"https://github.com/michalspano.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n                    ***\n\n                ~/README.md\n    https://github.com/michalspano/clocrt\n                @michalspano\n\n                    ***\n--\u003e\n\n# `clocrt` - Count Lines of Code _Redefined Tables_\n\n\u003c!-- GitHub Shields --\u003e\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![Contributors][contributors-shield]][contributors-url]\n[![Release][release-shield]][release-url]\n[![MIT License][license-shield]][license-url]\n\n## Table of Contents\n\n  * [Introduction](#introduction)\n  * [Requirements](#requirements)\n    * [Additional](#additional)\n  * [Installation](#installation)\n    * [Build from the source](#build-from-the-source)\n  * [Example](#example)\n  * [Usage](#usage)\n    * [`cloc` docs](#cloc-docs)\n  * [Contributing](#contributing)\n\n## Introduction\n\nA simple, lightweight __CLI__ tool to transform a `cloc` output into a `Markdown` table written in `Go`. \n\n## Requirements\n\n1. A `unix`-like operating system (with either `bash` or `sh`, etc.);\n2. The [`cloc`](https://github.com/AlDanial/cloc) command-line utility;\n3. The [`wget`](https://savannah.gnu.org/git/?group=wget) command-line utility.\n\n\\*The `wget` command-line utility is used to download the `clocrt` binary. Indeed, `clocrt` is not a fork of `cloc`, and therefore, `cloc` is a direct dependency of `clocrt`.\n\n### Additional\n\nA copy of the `Go` binary is needed to install the `clocrt` binary from the source. The `Go` binary is available [here](https://golang.org/dl/).\n\n## Installation\n\nThe __automated installation__ is carried with a single command:\n\n```sh\n$ curl -s https://raw.githubusercontent.com/michalspano/clocrt/main/install | sh\n```\n\n#### Build from the source\n\n```sh\n$ git clone https://github.com/michalspano/clocrt.git \u0026\u0026 cd clocrt\n$ go build -o clocrt src/main.go\n$ ./clocrt --version  # validates the installation\n```\n\n## Example\n\nSuppose the following __working tree__ with some _dummy_ files:\n\n```text\n$ tree ./test\n\ntest\n├── docs\n│   └── foo.md\n├── foo.go\n└── foo.py\n```\n\nRunning `cloc` would yield the following output:\n\n```text\n$ cloc ./test\n\n       3 text files.\n       3 unique files.                              \n       0 files ignored.\n\ngithub.com/AlDanial/cloc v 1.94  T=0.00 s (626.3 files/s, 1878.9 lines/s)\n-------------------------------------------------------------------------------\nLanguage                     files          blank        comment           code\n-------------------------------------------------------------------------------\nGo                               1              2              0              5\nMarkdown                         1              0              0              1\nPython                           1              0              0              1\n-------------------------------------------------------------------------------\nSUM:                             3              2              0              7\n-------------------------------------------------------------------------------\n```\n\nWhich we transform into a `Markdown` table with `clocrt`:\n\n```sh\n$ clocrt \"`cloc ./test`\"\n```\n\n### github.com/AlDanial/cloc v 1.94  T=0.00 s (626.3 files/s, 1878.9 lines/s)\n| Language | files | blank | comment | code |\n| :------: | :---: | :---: | :-----: | :--: |\n| Go       | 1     | 2     | 0       | 5    |\n| Markdown | 1     | 0     | 0       | 1    |\n| Python   | 1     | 0     | 0       | 1    |\n| SUM:     | 3     | 2     | 0       | 7    |\n\n\\*`Markdown` table syntax: [link](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables)\n\n_Voila!_ :confetti_ball:\n\n## Usage\n\n```text\n$ clocrt -h \n$ clocrt --help\n\nNAME\n        clocrt - count lines of code redefined tables\n\nDESCRIPTION\n        A simple, lightweight CLI tool to transform a cloc output into a Markdown table.\n\nUSAGE\n        clocrt \"`[CLOC-PATTERN]`\" [OPTIONS]\n\nOPTIONS\n        --help, -h                       show the usage\n        --version, -v                    fetch and display the current version\n\n        --print, -pr                     print the result to stdout\n        --cell-align|-ca=\u003calign\u003e         center|c (default), left|l, right|r\n        --output-path|-op=\u003cpath\u003e         output file path (default: out.md)\nBUGS\n         Don't forget to quote the pattern per the example: \"`[CLOC-PATTERN]`\"\n\n```\n\n#### `cloc` docs\n\nDocumentation of the `cloc` command-line utility can be found [here](https://github.com/AlDanial/cloc#options-).\n\n## Contributing\n\nI'm open to any contribution to the repository. If you have any suggestions or feedback, please open an issue or pull request. :+1:\nWith the respect to the `MIT` License provided within the project: [link](https://github.com/michalspano/clocrt/blob/main/LICENSE).\n\n\u003c!-- GitHub Shields --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/michalspano/clocrt.svg?style=for-the-badge\n[contributors-url]: https://github.com/michalspano/clocrt/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/michalspano/clocrt.svg?style=for-the-badge\n[forks-url]: https://github.com/michalspano/clocrt/network/members\n[stars-shield]: https://img.shields.io/github/stars/michalspano/clocrt.svg?style=for-the-badge\n[stars-url]: https://github.com/michalspano/clocrt/stargazers\n[issues-shield]: https://img.shields.io/github/issues/michalspano/clocrt.svg?style=for-the-badge\n[issues-url]: https://github.com/michalspano/clocrt/issues\n[license-shield]: https://img.shields.io/github/license/michalspano/clocrt.svg?style=for-the-badge\n[license-url]: https://github.com/michalspano/clocrt/blob/main/LICENSE\n[release-shield]: https://img.shields.io/github/tag/michalspano/clocrt.svg?style=for-the-badge\n[release-url]: https://github.com/michalspano/clocrt/tags/latest","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalspano%2Fclocrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichalspano%2Fclocrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalspano%2Fclocrt/lists"}