定制 codemetry/laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

codemetry/laravel

最新稳定版本:v1.4.1

Composer 安装命令:

composer require codemetry/laravel

包简介

Laravel adapter for Codemetry analysis pipeline

README 文档

README

Laravel adapter for Codemetry - provides Artisan commands and service provider integration for Git repository analysis.

This package depends on codemetry/core.

Documentation | Getting Started

Requirements

  • PHP 8.2+
  • Laravel 11.x or 12.x
  • Git

Installation

composer require codemetry/laravel

This automatically installs codemetry/core as a dependency.

Publish the configuration file:

php artisan vendor:publish --tag=codemetry-config

Upgrading

Both codemetry/laravel and codemetry/core must be updated together to ensure compatibility:

composer update "codemetry/*"

Or explicitly:

composer update codemetry/laravel codemetry/core

Note: Running composer update codemetry/laravel alone may not work because both packages are versioned together and require matching versions.

Usage

# Table output (one row per day)
php artisan codemetry:analyze --days=7

# JSON output
php artisan codemetry:analyze --days=7 --format=json

# Filter by author or branch
php artisan codemetry:analyze --days=7 --author="Jane Doe" --branch=main

# Specify date range
php artisan codemetry:analyze --since=2024-01-01 --until=2024-01-31

# Enable AI-powered explanations (requires API keys in config)
php artisan codemetry:analyze --days=7 --ai=1

Configuration

After publishing, edit config/codemetry.php:

return [
    // Number of days to analyze by default
    'days' => 7,

    // Baseline period for normalization (in days)
    'baseline_days' => 56,

    // Follow-up fix detection horizon (in days)
    'follow_up_horizon_days' => 3,

    // AI configuration (optional)
    'ai' => [
        'enabled' => false,
        'engine' => 'openai', // openai, anthropic, deepseek, google
        'api_key' => env('CODEMETRY_AI_API_KEY'),
    ],
];

AI Integration

AI integration is opt-in and metrics-only. Engines never receive raw code or diffs.

Supported engines:

  • OpenAI
  • Anthropic (Claude)
  • DeepSeek
  • Google

When AI is requested but unavailable (missing keys, API failure), analysis continues normally with a warning.

Privacy

  • The AI engine receives aggregated metrics only - never raw source code, full diffs, or file contents.
  • All analysis runs locally via Git commands against your repository.
  • No data is sent to external services unless AI engines are explicitly enabled.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固