# is-in-ci

> Check if the process is running in a Continuous Integration (CI) environment

Latest version **2.0.0** (published 2025-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-in-ci
pnpm add is-in-ci
yarn add is-in-ci
bun add is-in-ci
```

Provides the command `is-in-ci`.

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2025-08-17 |
| First published | 2023-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | ci, continuous, integration, environment, server, check, detect, determine, test, cli, cli-app |

## Links

- npm: https://www.npmjs.com/package/is-in-ci
- Repository: https://github.com/sindresorhus/is-in-ci
- Homepage: https://github.com/sindresorhus/is-in-ci#readme
- Issues: https://github.com/sindresorhus/is-in-ci/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-in-ci

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2025-08-17
- 1.0.0 — 2024-07-26
- 0.1.0 — 2023-10-27

## README

# is-in-ci

> Check if the process is running in a [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) environment

## Install

```sh
npm install is-in-ci
```

## Usage

```js
import isInCi from 'is-in-ci';

if (isInCi) {
	console.log('Running in a CI environment');
}
```

It looks for these environment variables: `CI` and `CONTINUOUS_INTEGRATION`.

## CLI

```sh
is-in-ci && echo 'Running in a CI environment'
```

Exits with code `0` in CI environments and `1` otherwise.

## FAQ

### How can I add a CI service?

Request the CI service to include the `CI` environment variable. Most already do.

### How is this different from [`is-ci`](https://github.com/watson/is-ci)?

The `is-ci` package attempts to detect every CI service, which is unsustainable. It also has a higher risk of false-positives. For example, it detects the environment variable `RUN_ID` as CI-specific, although other services could use it. Constant updates for new CIs create version fragmentation, resulting in inconsistent behavior across dependent packages. Pushing for CI services to use a standardized CI environment variable is a more robust solution.

## Related

- [is-inside-container](https://github.com/sindresorhus/is-inside-container) - Check if the process is running inside a container
- [is-interactive](https://github.com/sindresorhus/is-interactive) - Check if stdout or stderr is interactive

---
_Source: https://npm.io/package/is-in-ci · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
