{"id":30849320,"url":"https://github.com/hahwul/cyclonedx-cr","last_synced_at":"2025-09-12T10:02:27.586Z","repository":{"id":313435660,"uuid":"1051429924","full_name":"hahwul/cyclonedx-cr","owner":"hahwul","description":"A Crystal tool for generating CycloneDX Software Bill of Materials (SBOM) from Crystal shard projects.","archived":false,"fork":false,"pushed_at":"2025-09-06T03:09:51.000Z","size":5,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-06T03:28:55.068Z","etag":null,"topics":["crystal","cyclonedx","cyclonedx-sbom","sbom","sbom-generator","security"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hahwul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-06T01:33:38.000Z","updated_at":"2025-09-06T03:03:56.000Z","dependencies_parsed_at":"2025-09-06T03:28:58.360Z","dependency_job_id":"96a5cafd-b487-4adb-b9b2-b878658c0e73","html_url":"https://github.com/hahwul/cyclonedx-cr","commit_stats":null,"previous_names":["hahwul/cyclonedx-cr"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/hahwul/cyclonedx-cr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahwul%2Fcyclonedx-cr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahwul%2Fcyclonedx-cr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahwul%2Fcyclonedx-cr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahwul%2Fcyclonedx-cr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hahwul","download_url":"https://codeload.github.com/hahwul/cyclonedx-cr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahwul%2Fcyclonedx-cr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273997104,"owners_count":25204473,"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-07T02:00:09.463Z","response_time":67,"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":["crystal","cyclonedx","cyclonedx-sbom","sbom","sbom-generator","security"],"created_at":"2025-09-07T04:44:51.840Z","updated_at":"2025-09-08T05:02:54.746Z","avatar_url":"https://github.com/hahwul.png","language":"Crystal","funding_links":[],"categories":["Security"],"sub_categories":[],"readme":"# cyclonedx-cr (Crystal)\n\nA Crystal tool for generating [CycloneDX](https://cyclonedx.org/) Software Bill of Materials (SBOM) from Crystal shard projects.\n\n## Features\n\n- 🔍 Generates CycloneDX SBOMs from Crystal `shard.yml` and `shard.lock` files\n- 📋 Supports multiple output formats: JSON, XML, CSV\n- 📊 Compatible with CycloneDX spec versions 1.4, 1.5, and 1.6\n- 🔗 Automatically generates Package URLs (PURLs) for dependencies\n- 🐳 Docker support for containerized usage\n- ⚡ Fast and lightweight implementation in Crystal\n\n## Installation\n\n### Binary Releases\n\nDownload the latest binary from the [releases page](https://github.com/hahwul/cyclonedx-cr/releases).\n\n### Homebrew (macOS/Linux)\n\n```bash\nbrew install hahwul/cyclonedx-cr/cyclonedx-cr\n```\n\n### Docker\n\n```bash\ndocker run --rm -v $(pwd):/workspace -w /workspace ghcr.io/hahwul/cyclonedx-cr:latest\n```\n\n### From Source\n\nRequirements: [Crystal](https://crystal-lang.org/) 1.6.2+\n\n```bash\ngit clone https://github.com/hahwul/cyclonedx-cr.git\ncd cyclonedx-cr\nshards install\nshards build --release\n```\n\n## Usage\n\n### Basic Usage\n\nGenerate an SBOM from your Crystal project:\n\n```bash\ncyclonedx-cr\n```\n\nThis will read `shard.yml` and `shard.lock` from the current directory and output the SBOM to stdout in JSON format.\n\n### Command Line Options\n\n```bash\nUsage: cyclonedx-cr [arguments]\n    -i FILE, --input=FILE            shard.lock file path (default: shard.lock)\n    -s FILE, --shard=FILE            shard.yml file path (default: shard.yml)\n    -o FILE, --output=FILE           Output file path (default: stdout)\n    --spec-version VERSION           CycloneDX spec version (options: 1.4, 1.5, 1.6, default: 1.6)\n    --output-format FORMAT           Output format (options: json, xml, csv, default: json)\n    -h, --help                       Show this help\n```\n\n### Examples\n\n#### Generate JSON SBOM to file\n```bash\ncyclonedx-cr -o sbom.json\n```\n\n#### Generate XML SBOM with specific spec version\n```bash\ncyclonedx-cr --output-format xml --spec-version 1.5 -o sbom.xml\n```\n\n#### Generate CSV SBOM from custom shard files\n```bash\ncyclonedx-cr -s my-shard.yml -i my-shard.lock --output-format csv -o sbom.csv\n```\n\n#### Docker usage\n```bash\n# Generate SBOM for current directory\ndocker run --rm -v $(pwd):/workspace -w /workspace ghcr.io/hahwul/cyclonedx-cr:latest -o sbom.json\n\n# With custom shard files\ndocker run --rm -v $(pwd):/workspace -w /workspace ghcr.io/hahwul/cyclonedx-cr:latest \\\n  -s custom-shard.yml -i custom-shard.lock --output-format xml -o sbom.xml\n```\n\n#### GitHub Actions\n```yaml\nname: Generate and Upload SBOM\n\non:\n  release:\n    types: [created]\n\njobs:\n  generate-sbom:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n    steps:\n      # Checkout the repository code\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      # Generate SBOM using hahwul/cyclonedx-cr action\n      - name: Generate SBOM\n        uses: hahwul/cyclonedx-cr@v1.0.0\n        with:\n          shard_file: ./shard.yml # Explicitly map to shard_file\n          lock_file: ./shard.lock # Explicitly map to lock_file\n          output_file: ./sbom.xml # Map to output_file\n          output_format: xml # Map to output_format\n          spec_version: 1.6 # Optional, specify if needed\n\n      # Upload SBOM to GitHub Release\n      - name: Upload SBOM to Release\n        uses: softprops/action-gh-release@v2\n        with:\n          files: ./sbom.xml\n          token: ${{ secrets.GITHUB_TOKEN }}\n\n```\n\n## Requirements\n\nYour Crystal project must have:\n- `shard.yml` file (project configuration)\n- `shard.lock` file (locked dependency versions)\n\nGenerate the `shard.lock` file by running `shards install` in your Crystal project.\n\n## Output Formats\n\n### JSON (Default)\nStandard CycloneDX JSON format, suitable for most SBOM tools and platforms.\n\n### XML\nCycloneDX XML format, compatible with tools that require XML input.\n\n### CSV\nSimplified comma-separated values format for basic analysis and reporting.\n\n## CycloneDX Specification Versions\n\n- **1.6** (default): Latest version with full feature support\n- **1.5**: Stable version with broad tool compatibility\n- **1.4**: Legacy version for compatibility with older tools\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -am 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Related Projects\n\n- [CycloneDX](https://cyclonedx.org/) - OWASP CycloneDX SBOM Standard\n- [Crystal](https://crystal-lang.org/) - The Crystal Programming Language\n- [Shards](https://github.com/crystal-lang/shards) - Crystal Package Manager\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhahwul%2Fcyclonedx-cr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhahwul%2Fcyclonedx-cr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhahwul%2Fcyclonedx-cr/lists"}