{"id":29296288,"url":"https://github.com/zmh-program/bytes-radar","last_synced_at":"2025-07-11T00:03:33.637Z","repository":{"id":303144783,"uuid":"1013879198","full_name":"zmh-program/bytes-radar","owner":"zmh-program","description":"A fast code analysis tool for remote repositories with multi-platform support.","archived":false,"fork":false,"pushed_at":"2025-07-06T00:16:20.000Z","size":141,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-06T00:18:06.986Z","etag":null,"topics":["cli","cloc","code","code-statistics","github","gitlab","rust","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmh-program.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-07-04T16:08:42.000Z","updated_at":"2025-07-06T00:16:23.000Z","dependencies_parsed_at":"2025-07-06T00:18:09.421Z","dependency_job_id":"ce3b98ef-6afc-46b4-ab71-a7413a19b594","html_url":"https://github.com/zmh-program/bytes-radar","commit_stats":null,"previous_names":["zmh-program/bytes-radar"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zmh-program/bytes-radar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmh-program%2Fbytes-radar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmh-program%2Fbytes-radar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmh-program%2Fbytes-radar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmh-program%2Fbytes-radar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmh-program","download_url":"https://codeload.github.com/zmh-program/bytes-radar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmh-program%2Fbytes-radar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263833411,"owners_count":23517371,"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","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","code-statistics","github","gitlab","rust","wasm"],"created_at":"2025-07-06T15:10:13.419Z","updated_at":"2025-07-08T20:02:02.668Z","avatar_url":"https://github.com/zmh-program.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bytes Radar\n\n[![CI](https://github.com/zmh-program/bytes-radar/workflows/CI/badge.svg)](https://github.com/zmh-program/bytes-radar/actions)\n[![Crates.io](https://img.shields.io/crates/v/bytes-radar.svg)](https://crates.io/crates/bytes-radar)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![Rust](https://img.shields.io/badge/rust-1.70+-orange.svg)](https://www.rust-lang.org)\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button.svg)](https://deploy.workers.cloudflare.com/?url=https://github.com/zmh-program/bytes-radar)\n\nHyper-fast **CLOC** *(\\*count lines of code)* tool for remote repositories.\n\n![Banner](docs/banner.jpg)\n\n## Features\n\n- **Asynchronous Repository Processing**: Non-blocking HTTP client with async streaming request processing for efficient remote repository fetching and decompression, optimized for **low memory usage** and **serverless environments** (always `\u003c32MiB` runtime memory usage for large files)\n- **Multi-Platform URL Resolution**: Features intelligent URL parsing engine that normalizes different Git hosting platform APIs (GitHub, GitLab, Bitbucket, Codeberg) into unified archive endpoints with branch/commit resolution\n- **Streaming Archive Analysis**: Processes tar.gz archives directly in memory using streaming decompression without temporary file extraction, reducing I/O overhead and memory footprint\n- **Language Detection Engine**: Implements rule-based file extension and content analysis system supporting 150+ programming languages with configurable pattern matching and statistical computation (use tokei [languages map](https://github.com/XAMPPRocky/tokei/blob/master/languages.json))\n- **Real-time Progress Monitoring**: Features bandwidth-aware progress tracking with download speed calculation, ETA estimation, and adaptive UI rendering for terminal environments\n- **Structured Data Serialization**: Provides multiple output format engines (Table, JSON, CSV, XML) with schema validation and type-safe serialization for integration with external tools\n- **Authentication Layer**: Implements OAuth token management with secure credential handling for accessing private repositories across different hosting platforms\n- **Cross-Platform Binary Distribution**: Supports native compilation targets for Linux, macOS, and Windows with platform-specific optimizations and dependency management\n\n## Installation\n\n### From Cargo (Recommended)\n\n```bash\ncargo install bytes-radar\n```\n\n### From Releases\n\nDownload the latest binary from [GitHub Releases](https://github.com/zmh-program/bytes-radar/releases)\n\n### From Source\n\n```bash\ngit clone https://github.com/zmh-program/bytes-radar.git\ncd bytes-radar\ncargo build --release\n```\n\n## Usage\n\n```bash\nbradar [OPTIONS] \u003cURL\u003e\n```\n\n### Examples\n\n#### Basic Repository Analysis\n\nAnalyze GitHub repositories using shorthand notation:\n\n```bash\nbradar torvalds/linux\nbradar microsoft/typescript\nbradar rust-lang/cargo\n```\n\n#### Branch and Commit Targeting\n\nSpecify particular branches or commit hashes for analysis:\n\n```bash\nbradar microsoft/vscode@main\nbradar kubernetes/kubernetes@release-1.28\nbradar rust-lang/rust@abc1234567\n```\n\n#### Multi-Platform Repository Support\n\nAnalyze repositories from different Git hosting platforms:\n\n```bash\nbradar https://gitlab.com/gitlab-org/gitlab\nbradar https://bitbucket.org/atlassian/stash\nbradar https://codeberg.org/forgejo/forgejo\n```\n\n#### Output Format Configuration\n\nGenerate analysis results in structured data formats:\n\n```bash\nbradar -f json torvalds/linux\nbradar -f csv microsoft/typescript\nbradar -f xml rust-lang/cargo\n```\n\n#### Private Repository Access\n\nAuthenticate with platform tokens for private repository analysis:\n\n```bash\nbradar --token ghp_xxxxxxxxxxxxxxxxxxxx private-org/confidential-repo\nbradar --token glpat-xxxxxxxxxxxxxxxxxxxx https://gitlab.com/private-group/project\n```\n\n#### Performance and Output Control\n\nConfigure analysis behavior and output verbosity:\n\n```bash\nbradar --quiet --no-progress user/repo\nbradar --timeout 600 --detailed large-org/massive-repo\n```\n\n## Usage Environments\n\n### CLI\n\nSee the CLI Options section below for command-line usage.\n\n## Output Formats\n\n### Table (Default)\n```shell\n$ bradar torvalds/linux\nAnalyzing: https://github.com/torvalds/linux\nAnalysis completed in 123.76s\n\n================================================================================\n Project                                                  linux@main\n Total Files                                              89,639\n Total Lines                                              40,876,027\n Code Lines                                               32,848,710\n Comment Lines                                            2,877,885\n Blank Lines                                              5,149,432\n Languages                                                51\n Primary Language                                         C\n Code Ratio                                               80.4%\n Documentation                                            8.8%\n================================================================================\n Language                Files        Lines     Code   Comments   Blanks   Share%\n================================================================================\n C                      35,586   25,268,107 18,782,347  2,836,806 3,648,954    61.8%\n C Header               25,845   10,247,647 9,481,722          0  765,925    25.1%\n Device Tree             5,789    1,831,396 1,589,630          0  241,766     4.5%\n ReStructuredText        3,785      782,387  593,628          0  188,759     1.9%\n JSON                      961      572,657  572,655          0        2     1.4%\n Text                    5,100      566,733  499,590          0   67,143     1.4%\n YAML                    4,862      548,408  458,948          0   89,460     1.3%\n GNU Style Assembly      1,343      373,956  326,745          0   47,211     0.9%\n Shell                     960      189,965  155,974          0   33,991     0.5%\n Plain Text              1,298      128,205  105,235          0   22,970     0.3%\n Python                    293       89,285   69,449      5,770   14,066     0.2%\n Makefile                3,115       82,692   57,091     13,109   12,492     0.2%\n SVG                        82       53,409   53,316          0       93     0.1%\n Perl                       58       43,986   33,264      4,406    6,316     0.1%\n Rust                      158       39,561   19,032     16,697    3,832     0.1%\n XML                        24       22,193   20,971          0    1,222     0.1%\n PO File                     7        6,711    5,605          0    1,106     0.0%\n Happy                      10        6,078    5,352          0      726     0.0%\n Assembly                   11        5,361    4,427          0      934     0.0%\n Lex                        10        2,996    2,277        347      372     0.0%\n AWK                        12        2,611    1,777        487      347     0.0%\n C++                         7        2,267    1,932          0      335     0.0%\n ...\n================================================================================\n Total                  89,639   40,876,027 32,848,710  2,877,885 5,149,432   100.0%\n```\n\n### JSON Output\n```json\n{\n  \"project_name\": \"linux@master\",\n  \"summary\": {\n    \"total_files\": 75823,\n    \"total_lines\": 28691744,\n    \"code_lines\": 22453891,\n    \"comment_lines\": 3891234,\n    \"blank_lines\": 2346619\n  },\n  \"language_statistics\": [...]\n}\n```\n\n## Supported Platforms\n\n| Platform | URL Format | Example |\n|----------|------------|---------|\n| **GitHub** | `user/repo` or full URL | `torvalds/linux` |\n| **GitLab** | Full URL | `https://gitlab.com/user/repo` |\n| **Bitbucket** | Full URL | `https://bitbucket.org/user/repo` |\n| **Codeberg** | Full URL | `https://codeberg.org/user/repo` |\n| **Direct** | tar.gz URL | `https://example.com/file.tar.gz` |\n\n## CLI Options\n\n```bash\nbradar [OPTIONS] \u003cURL\u003e\n\nARGUMENTS:\n  \u003cURL\u003e  URL to analyze: user/repo, user/repo@branch, or full URL\n\nOPTIONS:\n  -f, --format \u003cFORMAT\u003e        Output format [table|json|csv|xml]\n      --detailed               Show detailed file-by-file statistics\n  -d, --debug                  Enable debug output\n      --token \u003cTOKEN\u003e          GitHub token for private repositories\n      --timeout \u003cSECONDS\u003e      Request timeout in seconds [default: 300]\n      --allow-insecure         Allow insecure HTTP connections\n      --no-progress           Disable progress bar\n      --quiet                 Quiet mode - minimal output\n  -h, --help                  Print help\n  -V, --version               Print version\n```\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](docs/CONTRIBUTING.md) for guidelines.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/zmh-program/bytes-radar.git\ncd bytes-radar\n\n# Install dependencies\ncargo build\n\n# Run tests\ncargo test --all-features\n\n# Format code\ncargo fmt\n\n# Lint code\ncargo clippy --all-targets --all-features\n```\n\n## Deployment\n\n### Cloudflare Workers\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button.svg)](https://deploy.workers.cloudflare.com/?url=https://github.com/zmh-program/bytes-radar)\n\n\u003e [!TIP]\n\u003e The Free Tier of Cloudflare Workers has a **20s request timeout limit** (wall time). Analysis of large repositories may fail due to this limitation. Consider upgrading to Cloudflare Workers Pro or using alternative deployment methods for processing large repositories.\n\nFor detailed deployment instructions and API documentation, see [DEPLOYMENT.md](docs/DEPLOYMENT.md).\n\n## Usage Environments\n\n### CLI\n\nSee the CLI Options section below for command-line usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmh-program%2Fbytes-radar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmh-program%2Fbytes-radar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmh-program%2Fbytes-radar/lists"}