{"id":30694238,"url":"https://github.com/trinhminhtriet/gloc","last_synced_at":"2025-09-02T06:04:58.247Z","repository":{"id":285387241,"uuid":"957794660","full_name":"trinhminhtriet/gloc","owner":"trinhminhtriet","description":"🚀 gloc – A blazing-fast LOC (Lines of Code) counter in Go, inspired by tokei. Simple \u0026 efficient!","archived":false,"fork":false,"pushed_at":"2025-08-12T18:14:51.000Z","size":85,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T20:21:10.918Z","etag":null,"topics":["cli","cloc","code-analysis","code-lines","go","golang"],"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/trinhminhtriet.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-31T06:26:51.000Z","updated_at":"2025-08-12T18:14:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"3807a10b-a18d-4dd4-8b44-a619d9fd56cf","html_url":"https://github.com/trinhminhtriet/gloc","commit_stats":null,"previous_names":["trinhminhtriet/gloc"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/trinhminhtriet/gloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinhminhtriet","download_url":"https://codeload.github.com/trinhminhtriet/gloc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgloc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273238777,"owners_count":25069765,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"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","code-analysis","code-lines","go","golang"],"created_at":"2025-09-02T06:04:57.549Z","updated_at":"2025-09-02T06:04:58.231Z","avatar_url":"https://github.com/trinhminhtriet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 gloc\n\n```text\n\n       _\n  __ _| | ___   ___\n / _` | |/ _ \\ / __|\n| (_| | | (_) | (__\n \\__, |_|\\___/ \\___|\n |___/\n```\n\n🚀 gloc – A blazing-fast LOC (Lines of Code) counter in Go, inspired by tokei. Simple \u0026 efficient!\n\n## ✨ Features\n\n### Features\n\n- 🚀 **Fast and Efficient** – Quickly counts lines of code with minimal overhead.\n- 🏗️ **Multi-Language Support** – Supports a wide range of programming languages.\n- 🛠️ **Simple CLI Interface** – Easy-to-use command-line tool with straightforward commands.\n- 📊 **Detailed Statistics** – Displays blank, comment, and code lines per language.\n- 🐳 **Docker Support** – Run via Docker without local installation.\n- ⚡ **Optimized Performance** – Faster than traditional `cloc` in most scenarios.\n- 🔄 **CI/CD Integration** – Works seamlessly with Jenkins, GitHub Actions, and other CI/CD tools.\n- 🎯 **Custom Exclusions** – Exclude specific files and extensions for precise analysis.\n\n## 🚀 Installation\n\nDownload from [latest releases ](https://github.com/trinhminhtriet/gloc/releases)\n\n## 💡 Usage\n\n### Basic Usage\n\n```sh\nmake build\nrm -rf /usr/local/bin/gloc\nln -s $(pwd)/bin/gloc /usr/local/bin/gloc\ngloc --version\ngloc .\n```\n\n```\n$ gloc .\n-------------------------------------------------------------------------------\nLanguage                     files          blank        comment           code\n-------------------------------------------------------------------------------\nMarkdown                         3              8              0             18\nGo                               1             29              1            323\n-------------------------------------------------------------------------------\nTOTAL                            4             37              1            341\n-------------------------------------------------------------------------------\n```\n\n### Via Docker\n\nwith [dockerhub](https://hub.docker.com/repository/docker/trinhminhtriet/gloc)\n\n```sh\ndocker pull trinhminhtriet/gloc\ndocker run --rm -v \"${PWD}\":/workdir trinhminhtriet/gloc .\n```\n\n### Integration Jenkins CI\n\nuse [SLOCCount Plugin](https://wiki.jenkins-ci.org/display/JENKINS/SLOCCount+Plugin).\n\n```\n$ cloc --by-file --output-type=sloccount . \u003e sloccount.scc\n```\n\n```\n$ cat sloccount.scc\n398 Go      ./main.go\n190 Go      ./language.go\n132 Markdown        ./README.md\n24  Go      ./xml.go\n18  Go      ./file.go\n15  Go      ./option.go\n```\n\n## Support Languages\n\nuse `--show-lang` option\n\n```\n$ gloc --show-lang\n```\n\n## Performance\n\n- CPU 3.8GHz 8core Intel Core i7 / 32GB 2667MHz DDR4 / MacOSX 13.3.1\n- cloc 1.96\n- tokei 12.1.2 compiled with serialization support: json\n- gloc v0.1.1 [1dfa360](https://github.com/trinhminhtriet/gloc/commit/1dfa360c412270a7d9e12346eec7052c0d904ff4)\n- target repository is [golang/go commit:f742ddc](https://github.com/golang/go/tree/f742ddc349723667fc9af5d0f16233f7762aeaa0)\n\n### cloc\n\n```\n$ time cloc .\n   12003 text files.\n   11150 unique files.\n    1192 files ignored.\n\n8 errors:\nLine count, exceeded timeout:  ./src/cmd/dist/build.go\nLine count, exceeded timeout:  ./src/cmd/trace/static/webcomponents.min.js\nLine count, exceeded timeout:  ./src/net/http/requestwrite_test.go\nLine count, exceeded timeout:  ./src/vendor/golang.org/x/net/idna/tables10.0.0.go\nLine count, exceeded timeout:  ./src/vendor/golang.org/x/net/idna/tables11.0.0.go\nLine count, exceeded timeout:  ./src/vendor/golang.org/x/net/idna/tables12.0.0.go\nLine count, exceeded timeout:  ./src/vendor/golang.org/x/net/idna/tables13.0.0.go\nLine count, exceeded timeout:  ./src/vendor/golang.org/x/net/idna/tables9.0.0.go\n\ngithub.com/AlDanial/cloc v 1.96  T=35.07 s (317.9 files/s, 78679.3 lines/s)\n-----------------------------------------------------------------------------------\nLanguage                         files          blank        comment           code\n-----------------------------------------------------------------------------------\nGo                                9081         205135         337681        1779107\nText                              1194          11530              0         210849\nAssembly                           563          15549          21625         122329\nHTML                                17           3197             78          24983\nC                                  139           1324            982           6895\nJSON                                20              0              0           3122\nCSV                                  1              0              0           2119\nMarkdown                            27            674            106           1949\nBourne Shell                        16            253            868           1664\nJavaScript                          10            234            221           1517\nPerl                                10            173            171           1111\nC/C++ Header                        26            145            346            724\nBourne Again Shell                  16            120            263            535\nPython                               1            133            104            375\nCSS                                  3              4             13            337\nDOS Batch                            5             56             66            207\nWindows Resource File                4             23              0            146\nLogos                                2             16              0            101\nDockerfile                           2             13             15             47\nC++                                  2             11             14             24\nmake                                 5              9             10             21\nObjective-C                          1              2              3             11\nFortran 90                           2              1              3              8\nawk                                  1              1              6              7\nYAML                                 1              0              0              5\nMATLAB                               1              1              0              4\n-----------------------------------------------------------------------------------\nSUM:                             11150         238604         362575        2158197\n-----------------------------------------------------------------------------------\ncloc .  33.70s user 1.48s system 99% cpu 35.237 total\n```\n\n### tokei\n\n```\n$ time tokei --sort code  --exclude \"**/*.txt\" .\n===============================================================================\n Language            Files        Lines         Code     Comments       Blanks\n===============================================================================\n Go                   9242      2330107      1812147       318036       199924\n GNU Style Assembly    565       159534       127093        16888        15553\n C                     143         9272         6949         1000         1323\n JSON                   21         3122         3122            0            0\n Shell                  16         2785         2267          342          176\n JavaScript             10         1972         1520          218          234\n Perl                    9         1360         1032          170          158\n C Header               27         1222          727          349          146\n BASH                   16          918          521          279          118\n Python                  1          612          421           70          121\n CSS                     3          354          337           13            4\n Autoconf                9          283          274            0            9\n Batch                   5          329          207           66           56\n Alex                    2          117          101            0           16\n Dockerfile              2           75           47           15           13\n C++                     2           49           24           14           11\n Makefile                5           40           20           10           10\n Objective-C             2           21           15            3            3\n FORTRAN Modern          2           12            8            3            1\n Markdown               18         2402            0         1853          549\n-------------------------------------------------------------------------------\n HTML                   17        19060        18584           49          427\n |- CSS                  4         2071         1852           10          209\n |- HTML                 1          219          212            0            7\n |- JavaScript           8         6920         6876           16           28\n (Total)                          28270        27524           75          671\n===============================================================================\n Total               10117      2533646      1975416       339378       218852\n===============================================================================\ntokei --sort code --exclude \"**/*.txt\" .  0.76s user 0.50s system 562% cpu 0.224 total\n```\n\n### gloc\n\n```\ntime gloc --exclude-ext=txt .\n-------------------------------------------------------------------------------\nLanguage                     files          blank        comment           code\n-------------------------------------------------------------------------------\nGo                            9096         205242         352844        1764503\nAssembly                       563          15555          21624         122324\nHTML                            17           3197            212          24849\nC                              139           1324            983           6894\nJSON                            20              0              0           3122\nBASH                            27            345           1106           2122\nMarkdown                        18            549             28           1825\nJavaScript                      10            234            218           1520\nC Header                        26            145            346            724\nPerl                            10            173            584            698\nPython                           1            133            104            375\nCSS                              3              4             13            337\nBatch                            5             56              0            273\nPlan9 Shell                      4             23             50             96\nBourne Shell                     5             28             24             78\nC++                              2             11             14             24\nMakefile                         5             10             10             20\nObjective-C                      2              3              3             15\nFORTRAN Modern                   2              1              3              8\nAwk                              1              1              6              7\n-------------------------------------------------------------------------------\nTOTAL                         9956         227034         378172        1929814\n-------------------------------------------------------------------------------\ngloc --exclude-ext=txt .  0.65s user 0.51s system 119% cpu 0.970 total\n```\n\n## 🤝 How to contribute\n\nWe welcome contributions!\n\n- Fork this repository;\n- Create a branch with your feature: `git checkout -b my-feature`;\n- Commit your changes: `git commit -m \"feat: my new feature\"`;\n- Push to your branch: `git push origin my-feature`.\n\nOnce your pull request has been merged, you can delete your branch.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinhminhtriet%2Fgloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinhminhtriet%2Fgloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinhminhtriet%2Fgloc/lists"}