---
title: ci
---

import VersionLabel from '@site/src/components/Docs/VersionLabel';

The `moon ci` command is a special command that should be ran in a continuous integration (CI)
environment, as it does all the heavy lifting necessary for effectively running tasks.

By default this will run all tasks that are affected by changed files and have the
[`runInCI`](../config/project#runinci) task option enabled.

```shell
$ moon ci
```

However, you can also provide a list of targets to explicitly run, which will still be filtered down
by `runInCI`.

```shell
$ moon ci :build :lint
```

:::info

View the official [continuous integration guide](../guides/ci) for a more in-depth example of how to
utilize this command.

:::

### Reports

After execution, moon writes the generated report to `.moon/cache/ciReport.json`. The non-CI task
execution commands write the same report format to `.moon/cache/runReport.json`.

These reports live in `.moon/cache`, so they may be overwritten or deleted between runs. Copy the
report elsewhere if you need to persist it, like uploading it as a CI artifact.

### Arguments

- `...[target]` - [Task targets](../concepts/target) to run.

### Options

Inherits most options from [`moon exec`](./exec) and pre-fills with: `--affected`, `--ci`,
`--on-failure=continue`, `--summary=detailed`, `--upstream=deep`, `--downstream=direct`.

### Configuration

- [`tasks`](../config/tasks#tasks) in `.moon/tasks/*`
- [`tasks`](../config/project#tasks) in `moon.*`
- [`tasks.*.options.runInCI`](../config/project#runinci) in `moon.*`
