PHPackages                             sweetchuck/junit-merger-cli - 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. [CLI &amp; Console](/categories/cli)
4. /
5. sweetchuck/junit-merger-cli

ActiveProject[CLI &amp; Console](/categories/cli)

sweetchuck/junit-merger-cli
===========================

CLI tool to merge two or more JUnit XML files into one.

2.0.0(6mo ago)13.8k↓50%1[1 issues](https://github.com/Sweetchuck/junit-merger-cli/issues)1GPL-3.0-or-laterPHPPHP &gt;=8.4CI passing

Since Dec 18Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Sweetchuck/junit-merger-cli)[ Packagist](https://packagist.org/packages/sweetchuck/junit-merger-cli)[ Docs](https://github.com/Sweetchuck/junit-merger-cli)[ RSS](/packages/sweetchuck-junit-merger-cli/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (2)Dependencies (19)Versions (8)Used By (1)

JUnit merger
============

[](#junit-merger)

[![CircleCI](https://camo.githubusercontent.com/3a737e02fe365c0af7cbef53048e21ce1cb5c5a677620b5ca2ee827aa6bc0648/68747470733a2f2f636972636c6563692e636f6d2f67682f5377656574636875636b2f6a756e69742d6d65726765722d636c692f747265652f322e782e7376673f7374796c653d737667)](https://circleci.com/gh/Sweetchuck/junit-merger-cli/?branch=2.x)[![codecov](https://camo.githubusercontent.com/4b35ef28a4258a19929ea58e67eb36112adbb2519724b372856a2c0ec12f3733/68747470733a2f2f636f6465636f762e696f2f67682f5377656574636875636b2f6a756e69742d6d65726765722d636c692f6272616e63682f322e782f67726170682f62616467652e7376673f746f6b656e3d33314d38546c304b7472)](https://app.codecov.io/gh/Sweetchuck/junit-merger-cli/tree/2.x)

As the name suggests this CLI tool helps to merge two or more JUnit XML files into one.
Under the hood it uses the [JUnit merger library](https://github.com/Sweetchuck/junit-merger).

Usage
-----

[](#usage)

By default it reads the input file names from stdIn line by line, and puts the result XML content to the stdOutput.
So the basic usage:

```
find path/to/junit -type f -name '*.xml' | junit-merger merge:files

```

The input file names also can be provided as arguments. Like this:

```
junit-merger merge:files 1.xml 2.xml

```

The merged XML content can be put into a file by using standard shell redirections. Like this:

```
junit-merger merge:files 1.xml 2.xml > junit.xml

```

Or by using the `--output-file` CLI option. Like this:

```
junit-merger merge:files --output-file='junit.xml' 1.xml 2.xml

```

Usage - handlers
----------------

[](#usage---handlers)

Handlers are responsible for read and parse the input files and generate the merged XML content.
To which handler should be used can be controlled by the `--handler` option. Like this:

```
junit-merger merge:files --handler='dom_read_write' 1.xml 2.xml

```

There are three available option

Usage - handler - dom\_read\_write
----------------------------------

[](#usage---handler---dom_read_write)

With this handler the input files are parsed with [\\DOMDocument](https://www.php.net/manual/en/book.dom.php) and the output is also generated with it.
It is safe and reliable, but resource heavy.
On the other hand this handler recalculates all the `` attributes.
This might come handy when multiple `` comes from different input files and they are belong to the same ``.

Usage - handler - dom\_read
---------------------------

[](#usage---handler---dom_read)

With this handler the input files are parsed with [\\DOMDocument](https://www.php.net/manual/en/book.dom.php) and the output is generated with string concatenation.

Usage - handler - substr
------------------------

[](#usage---handler---substr)

The input files have to be in the same format in the terms of the position of the opening `` tag and the closing `` tag.
These position parsed from the first input file and the same positions will be used for the remaining input files.
Usually the input files are come from the same source – for example PHPUnit – so their format is identical.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance54

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 87% 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

Every ~380 days

Total

4

Last Release

99d ago

Major Versions

1.0.0 → 2.0.02025-10-19

PHP version history (2 changes)1.0.0PHP &gt;=7.4

2.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/591103?v=4)[Andor](/maintainers/Sweetchuck)[@Sweetchuck](https://github.com/Sweetchuck)

---

Top Contributors

[![Sweetchuck](https://avatars.githubusercontent.com/u/591103?v=4)](https://github.com/Sweetchuck "Sweetchuck (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

clijunitmergejunit

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sweetchuck-junit-merger-cli/health.svg)

```
[![Health](https://phpackages.com/badges/sweetchuck-junit-merger-cli/health.svg)](https://phpackages.com/packages/sweetchuck-junit-merger-cli)
```

###  Alternatives

[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

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