PHPackages                             ondram/ci-detector-standalone - 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. ondram/ci-detector-standalone

Abandoned → [OndraM/ci-detector](/?search=OndraM%2Fci-detector)ArchivedLibrary[CLI &amp; Console](/categories/cli)

ondram/ci-detector-standalone
=============================

Standalone CLI command to detect continuous integration environment and provide unified access to properties of current build

3.4.0(6y ago)610[3 PRs](https://github.com/OndraM/ci-detector-standalone/pulls)MITPHPPHP ^7.1

Since Jan 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/OndraM/ci-detector-standalone)[ Packagist](https://packagist.org/packages/ondram/ci-detector-standalone)[ RSS](/packages/ondram-ci-detector-standalone/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (11)Versions (15)Used By (0)

CI Detector standalone command
==============================

[](#ci-detector-standalone-command)

[![Latest Stable Version](https://camo.githubusercontent.com/006e62c406f97bcb95148204cb1cdb5e82847fe4091319030100a87be0b7f315/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6e6472616d2f63692d6465746563746f722d7374616e64616c6f6e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ondram/ci-detector-standalone)[![Build Status](https://camo.githubusercontent.com/ba827d02d49709e99566e058747d3f14f210a7c26b81bb8b79fcae1c0c442b76/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4f6e6472614d2f63692d6465746563746f722d7374616e64616c6f6e652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/OndraM/ci-detector-standalone)[![Coverage Status](https://camo.githubusercontent.com/393656ee4b9268125d20e8a5a3bdb64bc7efc22048dbbe0813e7edf5faa41ebd/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4f6e6472614d2f63692d6465746563746f722d7374616e64616c6f6e652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/OndraM/ci-detector-standalone?branch=master)

Standalone CLI command wrapper for [ci-detector](https://github.com/OndraM/ci-detector) PHP library.

It is used to detect continuous integration environment and to provide a unified interface to read the build information. You can use the command to make your scripts (and especially CLI tools) portable for multiple build environments.

The detection is based on environment variables injected to the build environment by continuous integration server. However, these variables are named differently in each CI. **This command is based on lightweight [ci-detector](https://github.com/OndraM/ci-detector) PHP library**, which provides adapter for each supported CI server.

If you need the detection inside PHP script (so you don't need the CLI command), you can just use directly the [ci-detector](https://github.com/OndraM/ci-detector) library.

Releases are matched to the versions of the parent [ci-detector](https://github.com/OndraM/ci-detector) library. See [changelog](https://github.com/OndraM/ci-detector/blob/master/CHANGELOG.md) there for the list of the latest changes.

Usage
-----

[](#usage)

```
$ ./ci-detector.phar # return status code 0 if CI detected, 1 otherwise
$ echo $? # to print status code of previous command
0

$ ./ci-detector.phar detect ci-name
Travis CI

$ ./ci-detector.phar detect build-number
11.3

$ ./ci-detector.phar detect build-url
https://travis-ci.org/OndraM/ci-detector-standalone/jobs/189809581

$ ./ci-detector.phar detect branch
feature/test

$ ./ci-detector.phar detect commit
f45e5809cefdbb819913f9357381f4d291fd49a9

$ ./ci-detector.phar detect repository-url # Not supported on Travis CI, will print empty string

$ ./ci-detector.phar detect is-pull-request
Yes

$ ./ci-detector.phar detect branch
main
```

See [method reference](https://github.com/OndraM/ci-detector#api-methods-reference) for a documentation of each property.

Dump all available properties
-----------------------------

[](#dump-all-available-properties)

`dump` command will show all properties detected in current environment by ci-detector:

```
$ ./ci-detector.phar dump
+-----------------+---------------------------------------------------------------+
| Property name   | Current value                                                 |
+-----------------+---------------------------------------------------------------+
| ci-name         | Travis CI                                                     |
| build-number    | 164.1                                                         |
| build-url       | https://travis-ci.org/OndraM/ci-detector-standalone/jobs/1337 |
| commit          | 9b232f6813915ddb1f226de93366cb924c72e400                      |
| branch          | feature/dump-command                                          |
| target-branch   | main                                                          |
| repository-name | ondram/ci-detector                                            |
| repository-url  | ssh://git@gitserver:7999/project/repo.git                     |
| is-pull-request | Yes                                                           |
+-----------------+---------------------------------------------------------------+
```

This is basically a table with output of `describe()` method of `CiInterface` (see [method reference](https://github.com/OndraM/ci-detector#api-methods-reference)).

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

[](#installation)

### Install as a standalone PHAR file

[](#install-as-a-standalone-phar-file)

CI Detector could be installed as a standalone executable PHAR file (`ci-detector.phar`). Download latest version from [Releases page](https://github.com/OndraM/ci-detector-standalone/releases/latest).

To run CI Detector use command `./ci-detector.phar` in the directory where you saved the file (or `php ci-detector.phar` if the file itself is not executable).

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

[](#install-using-composer)

```
$ composer require ondram/ci-detector-standalone
```

To run CI Detector use command `vendor/bin/ci-detector`.

If you need the detection inside PHP script (and you don't need the CLI command), you can just use directly the lightweight [ci-detector](https://github.com/OndraM/ci-detector) library.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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 ~175 days

Recently: every ~205 days

Total

8

Last Release

2230d ago

Major Versions

1.0.0 → 2.1.02017-05-26

2.1.0 → 3.0.02017-10-27

PHP version history (2 changes)1.0.0PHP ^5.6 || ^7.0

3.0.0PHP ^7.1

### Community

Maintainers

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

---

Top Contributors

[![OndraM](https://avatars.githubusercontent.com/u/793041?v=4)](https://github.com/OndraM "OndraM (38 commits)")

---

Tags

continuous-integrationphpstandalone-librarycontinuous integrationcommand

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ondram-ci-detector-standalone/health.svg)

```
[![Health](https://phpackages.com/badges/ondram-ci-detector-standalone/health.svg)](https://phpackages.com/packages/ondram-ci-detector-standalone)
```

###  Alternatives

[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9184.1M24](/packages/phparkitect-phparkitect)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136400.8k14](/packages/rector-rector-src)

PHPackages © 2026

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