PHPackages                             peekphp/peek - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. peekphp/peek

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

peekphp/peek
============

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

v0.0.1(1y ago)06MITPHPPHP ^8.3.0CI failing

Since Jan 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/peekphp/peek)[ Packagist](https://packagist.org/packages/peekphp/peek)[ RSS](/packages/peekphp-peek/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Peek
====

[](#peek)

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+](https://php.net/releases/)**

---

✨ Key Features
--------------

[](#-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
--------------

[](#-installation)

Install Peek using [Composer](https://getcomposer.org):

```
composer require peekphp/peek
```

---

⚙️ Usage
--------

[](#️-usage)

### Analyze a PHP File

[](#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

[](#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:

[](#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
---------------

[](#-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-tests)

Run the complete test suite using PHPUnit:

```
composer test
```

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

---

🤝 Contributing
--------------

[](#-contributing)

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

### Steps to Contribute:

[](#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
---------

[](#-license)

Peek is open-source software licensed under the [MIT License](LICENSE).

---

Crafted with ❤️ by [Doekos](https://github.com/doekos)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance41

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

519d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10770165?v=4)[Bas Visser](/maintainers/Doekos)[@Doekos](https://github.com/Doekos)

---

Top Contributors

[![Doekos](https://avatars.githubusercontent.com/u/10770165?v=4)](https://github.com/Doekos "Doekos (5 commits)")

---

Tags

phppackageboilerplate

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/peekphp-peek/health.svg)

```
[![Health](https://phpackages.com/badges/peekphp-peek/health.svg)](https://phpackages.com/packages/peekphp-peek)
```

###  Alternatives

[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k5.2k](/packages/shlinkio-shlink)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[eliashaeussler/typo3-solver

Solver - Extends TYPO3's exception handling with AI generated solutions. Problems can also be solved from command line. Several OpenAI parameters are configurable and prompts and solution providers can be customized as desired.

302.1k](/packages/eliashaeussler-typo3-solver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
