{"id":46064143,"url":"https://github.com/ugolnikove/langstat","last_synced_at":"2026-03-01T12:01:52.313Z","repository":{"id":324106070,"uuid":"1093018378","full_name":"ugolnikovE/langstat","owner":"ugolnikovE","description":"CLI tool to visualize programming language statistics for public GitHub repositories","archived":false,"fork":false,"pushed_at":"2025-11-13T20:38:17.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-13T22:05:50.850Z","etag":null,"topics":["cli","github","github-api","lua","statistics"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/ugolnikovE.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-09T18:46:38.000Z","updated_at":"2025-11-13T21:05:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ugolnikovE/langstat","commit_stats":null,"previous_names":["ugolnikove/langstat"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ugolnikovE/langstat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugolnikovE%2Flangstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugolnikovE%2Flangstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugolnikovE%2Flangstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugolnikovE%2Flangstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ugolnikovE","download_url":"https://codeload.github.com/ugolnikovE/langstat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugolnikovE%2Flangstat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29969243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T11:43:06.159Z","status":"ssl_error","status_checked_at":"2026-03-01T11:43:03.887Z","response_time":124,"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":["cli","github","github-api","lua","statistics"],"created_at":"2026-03-01T12:01:51.720Z","updated_at":"2026-03-01T12:01:52.304Z","avatar_url":"https://github.com/ugolnikovE.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# langstat\n\nlangstat is a lightweight Lua-based CLI tool that analyzes programming language usage across your public GitHub repositories.\n\nIt is a small utility written in Lua to quickly visualize language distribution for any GitHub user.\n\n## ✨ Features\n\n* Fetches all public repositories of a GitHub user\n* Aggregates language usage using the official GitHub API\n* Displays language share visually using text-based bar charts\n* Supports optional CLI flags:\n\n  * `-h`, `--help` — show usage\n  * `-r N`, `--row-counts N` — show the top **N** languages\n* Configurable via `config.lua` or `config_local.lua`\n* Logs errors to file\n\n## 💻 Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/ugolnikovE/langstat.git\ncd langstat\n```\n\nInstall Lua dependencies:\n\n* Lua 5.1+ or LuaJIT\n* `luasec` for HTTPS requests\n* `dkjson` for JSON parsing\n* `dotenv` for loading environment variables\n\nInstall dependencies using LuaRocks:\n\n```bash\nluarocks install luasec\nluarocks install dkjson\nluarocks install dotenv\n```\n\n\u003e `ltn12` is included with LuaSocket, which often comes bundled with Lua distributions.\n\n## ⚙️ Configuration\n\nCreate a `.env` file in the project root:\n\n```\nGITHUB_TOKEN=your_github_token\n```\n\nCopy and adjust `config.lua`:\n\n```lua\nrequire(\"dotenv\").config()\n\nlocal config = {\n    name = \"your_github_username\",\n    token = os.getenv(\"GITHUB_TOKEN\") or nil,\n    log_level = \"ERROR\"\n}\n\nreturn config\n```\n\n### About GitHub tokens\n\n* If you do not provide a token, GitHub allows **60 API requests per hour**.\n* With a personal access token, the limit increases to **5000 requests per hour**.\n* If your user has many repositories, it is recommended to provide a token to avoid hitting rate limits.\n* You can create a personal access token in GitHub Settings → Developer settings → Personal access tokens → Tokens (classic) → Generate new token (no scopes needed for public repo access).\n\n## ▶️ Usage\n\nRun the tool:\n\n```bash\nlua main.lua\n```\n\nShow help:\n\n```bash\nlua main.lua --help\n```\n\nShow only the top 5 languages:\n\n```bash\nlua main.lua -r 5\n```\n\nExample output:\n\n```\n============================================\nlangstat — GitHub Language Statistics\nUser: ugolnikovE\nGenerated at: 2025-11-13 23:16:58\n============================================\nLua              █████████░░░░░░░░░░░ 47.93%\nC                █████████░░░░░░░░░░░ 45.12%\nCMake            █░░░░░░░░░░░░░░░░░░░  6.62%\nDockerfile       ░░░░░░░░░░░░░░░░░░░░  0.34%\n```\n\n## 🗂 Project Structure\n\n```\n.\n├── src/\n│   ├── github_api.lua\n│   ├── language_analytics.lua\n│   └── logger.lua\n├── tests/\n│   ├── github_agent_spec.lua\n│   └── language_analytics_spec.lua\n├── config.lua\n├── main.lua\n├── README.md\n├── LICENSE\n└── .gitignore\n```\n\n## 💡 Motivation\n\nThis project was created to experiment with Lua and build a simple tool to visualize programming language usage in GitHub repositories.\n\n## 📄 License\n\nThis project is licensed under the MIT License — see `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fugolnikove%2Flangstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fugolnikove%2Flangstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fugolnikove%2Flangstat/lists"}