PHPackages                             occulo/gendiff - 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. occulo/gendiff

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

occulo/gendiff
==============

A PHP-based diff generator for files

v1.0.0(3mo ago)01MITPHPPHP &gt;=8.3CI passing

Since Mar 11Pushed 3mo agoCompare

[ Source](https://github.com/occulo/gendiff)[ Packagist](https://packagist.org/packages/occulo/gendiff)[ Docs](https://github.com/occulo/gendiff)[ RSS](/packages/occulo-gendiff/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Gendiff
=======

[](#gendiff)

[![Packagist Version](https://camo.githubusercontent.com/1579343a97d59cc8472be628c946c8e61f9fb19f104f61cb8467305adf2aca58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6363756c6f2f67656e64696666)](https://packagist.org/packages/occulo/gendiff) [![PHP CI](https://github.com/occulo/gendiff/actions/workflows/ci.yml/badge.svg)](https://github.com/occulo/gendiff/actions/workflows/ci.yml) [![Quality Gate Status](https://camo.githubusercontent.com/f2473c31cf72aa83275ec9b267a106db4eb3bc9367ab90b6182b0466c93230cf/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6f6363756c6f5f67656e64696666266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/new_code?id=occulo_gendiff)

Description
-----------

[](#description)

Gendiff is a CLI tool and library for generating differences between two configuration files. Supports multiple output formats: stylish, plain, and JSON.

Prerequisites
-------------

[](#prerequisites)

- Linux, MacOS, WSL
- PHP &gt;=8.3
- Composer &gt;=2.0
- Git
- Make

Installation
------------

[](#installation)

### Composer (recommended)

[](#composer-recommended)

If you use Composer, you can install the package locally with the following command:

```
composer require occulo/gendiff
```

Or globally:

```
composer global require occulo/gendiff
```

### Source

[](#source)

If you wish to install from source, run:

```
git clone https://github.com/occulo/gendiff.git
cd gendiff
make install
```

This will clone the repository to your machine and install all required Composer dependencies.

Supported Formats
-----------------

[](#supported-formats)

Gendiff can compare configuration files in the following formats:

- JSON (`.json`)
- YAML (`.yaml`, `.yml`)

Usage
-----

[](#usage)

```
gendiff (-h|--help)
gendiff (-v|--version)
gendiff [--format ]
```

Demo
----

[](#demo)

### Input files

[](#input-files)

#### file1.json

[](#file1json)

```
{
  "key1": "value1",
  "key2": true,
  "key3": 123
}
```

#### file2.json

[](#file2json)

```
{
  "key1": "value1",
  "key2": false,
  "key4": "new"
}
```

### Stylish format

[](#stylish-format)

```
gendiff --format stylish file1.json file2.json
```

```
{
    key1: value1
  - key2: true
  + key2: false
  - key3: 123
  + key4: new
}
```

### Plain format

[](#plain-format)

```
gendiff --format plain file1.json file2.json
```

```
Property 'key2' was updated. From true to false
Property 'key3' was removed
Property 'key4' was added with value: 'new'
```

### JSON format

[](#json-format)

```
gendiff --format json file1.json file2.json
```

```
{
    "key1": {
        "status": "unchanged",
        "value": "value1"
    },
    "key2": {
        "status": "changed",
        "value": {
            "old": true,
            "new": false
        }
    },
    "key3": {
        "status": "removed",
        "value": 123
    },
    "key4": {
        "status": "added",
        "value": "new"
    }
}
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance80

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b96686ecd68e4ae9637346b97222f65a1ac93c54cfd11e69548b3b29f39c9313?d=identicon)[occulo](/maintainers/occulo)

---

Top Contributors

[![occulo](https://avatars.githubusercontent.com/u/84308919?v=4)](https://github.com/occulo "occulo (125 commits)")

---

Tags

diffdiffer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/occulo-gendiff/health.svg)

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

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[altis/local-server

Local Server module for Altis

18217.0k2](/packages/altis-local-server)

PHPackages © 2026

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