定制 peekphp/peek 二次开发

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

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

peekphp/peek

最新稳定版本:v0.0.1

Composer 安装命令:

composer require peekphp/peek

包简介

A package to ask any AI Client to give detailed answer of improvements on PHP files/snippets.

README 文档

README

Peek is a lightweight and powerful PHP package that integrates with any AI Client to provide detailed insights, improvements, and optimization suggestions for your PHP files and code snippets.

Requires PHP 8.3+

✨ Key Features

  • 🧠 Analyze PHP files or snippets with DeepSeek for actionable improvement suggestions.
  • 🔍 Spot inefficiencies, errors, and optimization opportunities in your codebase.
  • ⚡ Easily integrate into your existing workflows via a command-line interface.

🚀 Installation

Install Peek using Composer:

composer require peekphp/peek

⚙️ Usage

Analyze a PHP File

Run the peek command to analyze an entire PHP file:

vendor/bin/peek peek path/to/your/file.php

Analyze a Code Snippet

Specify a line range within a file to analyze just a part of your code:

vendor/bin/peek peek path/to/your/file.php --lines=10:20

Example Output:

Analyzing the file: path/to/your/file.php

Suggestions:
1. Add strict types to improve type safety.
2. Replace deprecated function `md5()` with a modern hashing algorithm like `password_hash()`.
3. Optimize nested loops for better performance.

🔧 Configuration

To set up Peek in your project, use the init command:

vendor/bin/peek init

This will generate a peek.json configuration file in your project's root directory, allowing you to define client settings such as API key, URL, and model.

Example peek.json:

{
    "client": {
        "key": "your-api-key",
        "url": "https://api.example.com",
        "model": "gpt-4"
    }
}

🤦🏻 Run Tests

Run the complete test suite using PHPUnit:

composer test

Peek comes with both unit and integration tests to ensure its reliability.

🤝 Contributing

Contributions are welcome! Feel free to submit issues or pull requests to help make Peek even better.

Steps to Contribute:

  1. Fork the repository.
  2. Create a feature branch:
    git checkout -b feature/your-feature-name
  3. Commit your changes:
    git commit -m "Add your feature description"
  4. Push to your branch:
    git push origin feature/your-feature-name
  5. Submit a pull request.

We appreciate your contributions! ❤️

📚 License

Peek is open-source software licensed under the MIT License.

Crafted with ❤️ by Doekos

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-29