PHPackages                             chris-moreton/uci-chess - 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. chris-moreton/uci-chess

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

chris-moreton/uci-chess
=======================

Wrappers to run UCI chess engines, matches and tournaments

v2.0.0(9y ago)4531[1 issues](https://github.com/chris-moreton/uci-chess/issues)MITPHPPHP &gt;=5.4.0

Since Oct 5Pushed 9y ago2 watchersCompare

[ Source](https://github.com/chris-moreton/uci-chess)[ Packagist](https://packagist.org/packages/chris-moreton/uci-chess)[ RSS](/packages/chris-moreton-uci-chess/feed)WikiDiscussions master Synced 4w ago

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

uci-chess
=========

[](#uci-chess)

PHP wrapper classes for interfacing with UCI chess engines.

Getting started
---------------

[](#getting-started)

From the root of your application

```
composer require chris-moreton/uci-chess

```

Unless using a framework where autoloading is already taken care of, you'll need to

```
include 'vendor/autoload.php';

```

Then, include the classes that you want to use, e.g.

```
use Netsensia\Uci\Engine;
use Netsensia\Uci\Match;
use Netsensia\Uci\Tournament\RoundRobin;

```

Search for a move
-----------------

[](#search-for-a-move)

```
$engine = new Engine();

// Native application or Jar file?
$engine->setApplicationType(Engine::APPLICATION_TYPE_JAR);

// The location of the chess engine on the local file system
// You can download my engine, RivalChess from https://github.com/chris-moreton/rival-chess-android-engine/tree/master/dist
// If the engine requires any parameters, simply add them after the path
$engine->setEngineLocation('/path/to/engine.jar [params]');

// Set engine parameters
$engine->setMode(Engine::MODE_NODES);
$engine->setModeValue(100000);

// Set the starting position of the match (before any moves have been played)
$engine->setPosition(Engine::STARTPOS);

// Send the move history and get the move
$move = $engine->getMove('e2e4 d7d5');

// Important! - remove the process
$engine->unloadEngine();

```

Run a match
-----------

[](#run-a-match)

```
$whiteEngine = new Engine('/path/to/engine1.jar');

// No reason why you can't use the same engine if you want to test against different parameters
$blackEngine = new Engine('/path/to/engine2.jar');

$whiteEngine->setMode(Engine::MODE_NODES);
$whiteEngine->setModeValue(100);
$whiteEngine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
$whiteEngine->setLogEngineOutput(false);

$blackEngine->setMode(Engine::MODE_NODES);
$blackEngine->setModeValue(10000);
$blackEngine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
$blackEngine->setLogEngineOutput(false);

$match = new Match($whiteEngine, $blackEngine);

$result = $match->play();

echo $result['fen'] . PHP_EOL;

switch ($result['result']) {
    case Match::DRAW: echo 'Draw';
        break;
    case Match::WHITE_WIN: echo 'White win';
        break;
    case Match::BLACK_WIN: echo 'Black win';
        break;
}

$whiteEngine->unloadEngine();
$blackEngine->unloadEngine();

```

Run a tournament
----------------

[](#run-a-tournament)

```
$tournament = new RoundRobin();

// for each engine...
$engine = new Engine('/path/to/engine1.jar');
$engine->setMode(Engine::MODE_NODES);
$engine->setModeValue(100);
$engine->setApplicationType(Engine::APPLICATION_TYPE_JAR);
$engine->setLogEngineOutput(false);
$engine->setName('Engine 1');
$tournament->addEngine($engine);

...

foreach ($tournament->matches() as $match) {
    echo $match->getWhite()->getName() . ' v ' . $match->getBlack()->getName() . PHP_EOL;
    $tournament->play($match);
    $echo $tournament->table();
}

$tournament->showTable();

$tournament->close();

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~2 days

Total

5

Last Release

3546d ago

Major Versions

v0.1.0 → v1.0.02016-10-05

v1.0.2 → v2.0.02016-10-14

### Community

Maintainers

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

---

Top Contributors

[![chris-moreton](https://avatars.githubusercontent.com/u/1436601?v=4)](https://github.com/chris-moreton "chris-moreton (49 commits)")

### Embed Badge

![Health badge](/badges/chris-moreton-uci-chess/health.svg)

```
[![Health](https://phpackages.com/badges/chris-moreton-uci-chess/health.svg)](https://phpackages.com/packages/chris-moreton-uci-chess)
```

###  Alternatives

[reisraff/phulp

The task manager for PHP

29312.2k10](/packages/reisraff-phulp)[limingxinleo/happy-join-hyperf

组件嗨化计划

255.1k16](/packages/limingxinleo-happy-join-hyperf)

PHPackages © 2026

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