> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# reporters

- **Type:**

```ts
type Reporter = ReporterName | [ReporterName, ReporterOptions];
type Reporters = Reporter | Reporter[];
```

- **Reporter options reference:** Reporter option types are defined in [`packages/core/src/types/reporter.ts`](https://github.com/web-infra-dev/rstest/blob/main/packages/core/src/types/reporter.ts)

- **Default:**

```ts
process.env.GITHUB_ACTIONS === 'true'
  ? ['default', 'github-actions']
  : ['default'];
```

- **CLI:** `--reporters=<name> --reporters=<name1>` (`--reporter` is also accepted as an alias)

Configure which reporters to use for test result output.

Built-in reporter names include `default`, `dot`, `verbose`, `md`, `github-actions`, `junit`, `json`, and `blob`.

:::info AI agent environments
If you haven't explicitly configured any reporters (no `reporters` in config and no `--reporters` flags), Rstest defaults to `['md']` and outputs AI agent-friendly markdown to stdout.
:::

### Usage

#### Basic example

You can specify reporters in the `rstest.config.ts` file or via the CLI.


**CLI**

```bash
npx rstest --reporters=default
```


**rstest.config.ts**

```ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  reporters: 'default',
});
```


#### Multiple reporters

You can use multiple reporters to output test results in different formats simultaneously. This is useful when you want both console output and a file report for CI/CD pipelines.

```ts title=rstest.config.ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  reporters: ['default', 'junit'],
});
```

#### Configuring reporters with options

Many reporters support configuration options. Pass them as a tuple `[reporterName, options]`:

```ts title=rstest.config.ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  reporters: [
    ['default', { verbose: true }],
    ['github-actions', { verbose: true }],
    ['junit', { outputPath: './test-results.xml' }],
  ],
});
```

#### Using custom reporters

You can create and use custom reporters by providing a reporter class or object that implements the reporter interface:

```ts title=rstest.config.ts
import { defineConfig } from '@rstest/core';
import { CustomReporter } from './custom-reporter';

export default defineConfig({
  reporters: [CustomReporter],
});
```

### Related documentation

- [Reporters guide](/guide/basic/reporters.md) - Usage examples and built-in reporter details
- [Reporter API reference](/api/javascript-api/reporter.md) - Custom reporter implementation
