承接 sagautam5/composer-insights 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sagautam5/composer-insights

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sagautam5/composer-insights

包简介

CLI tool to audit and analyze your composer dependencies.

README 文档

README

GitHub stars Latest Stable Version Total Downloads Issues Forks GitHub Actions Status

Composer Insights is a CLI tool that analyzes your PHP project's composer dependencies and provides insightful GitHub and Packagist statistics for each top-level dependency.

✨ Features

  • 🔍 Analyze direct dependencies from composer
  • ⭐ Fetch GitHub repository data: stars, forks, open issues, last update
  • 📈 Get download stats from Packagist
  • 🧹 Clean tabular output in the terminal
  • 🛑 Gracefully skips non-GitHub packages
  • ⚡ Fast, dependency-free CLI experience
  • 📊 Clean color-coded analysis summary

💡Example Output

vendor\bin\composer-insights analyze

Sample Console Output

Exports

JSON
vendor\bin\composer-insights analyze --export=json

JSON file will be exported to .composer-insights/output/data.json by default

Sample JSON Output

CSV
vendor\bin\composer-insights analyze --export=csv

CSV file will be exported to .composer-insights/output/data.csv by default

Sample CSV Output

📋 Requirements

  • PHP 8.2 or higher
  • A Composer-based project
  • Internet connection

📥 Installation

You can install it in any Composer-based local PHP project as dev dependency:

composer require sagautam5/composer-insights --dev

Make sure your project has both composer.json and composer.lock files.

To avoid GitHub API rate limits and to enable access to public repositories, set your GitHub token as an environment variable:

export GITHUB_TOKEN=your_github_token

You can generate a personal access token from https://github.com/settings/tokens

📸 Screenshots

Classic Token Option

Classic Token Option

Privillages For Token

Privillages For Token

🧪 Usage

Run the following command to start the analysis:

vendor/bin/composer-insights analyze

🔧 Command Options for analyze

Here are the available options for the analyze command:

Option Description
--days=180 (Optional) Number of days to look back for health check (default: 180).
--dev Include only development dependencies in the analysis.
--prod Include only production dependencies in the analysis.
--export=FORMAT Export results to a file. Accepts json or csv.
--no-summary Do not show summary statistics in the console output.
--no-table Do not show the table view in the console output.
--no-cache Fetch fresh dependency insights without using cached data.

By default, all dependencies (both production and development) will be analyzed.

🛠️ What This Command Does

  • Parses your composer.json and composer.lock
  • Analyzes only direct dependencies (ignores transitive)
  • Fetches GitHub and Packagist stats
  • Displays a clean, color-coded CLI table
  • Displays a clean, color-coded summary
  • Caches the insights collected for each package in json

🪪 License

This package is open-sourced under the MIT License.

🔐 Security

If you discover a security vulnerability within this package, please send an e-mail to sagautam5@gmail.com, All security vulnerabilities will be promptly addressed.

🤝 Contributing

Want to contribute to Composer Insights ? Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

We welcome all contributions, whether it's:

  • Reporting a bug
  • Discussing the current state of the code
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

🙌 Contributors

Enjoy analyzing your dependencies! 🎉

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-30