---
title: Contentsquare CLI - Flutter
description: How to use the Contentsquare CLI plugin
lastUpdated: 05 December 2025
source_url:
  html: https://docs.contentsquare.com/en/csq-sdk-flutter/experience-analytics/contentsquare-cli/
  md: https://docs.contentsquare.com/en/csq-sdk-flutter/experience-analytics/contentsquare-cli/index.md
---

A Dart plugin that offers a command-line interface for users of the Contentsquare package.

## Installation

Add `contentsquare_cli` as a **dev dependency**.

```shell
flutter pub add -d contentsquare_cli
```

```yaml
dev_dependencies:
  contentsquare_cli: ^1.0.0
```

then run

```shell
dart run contentsquare_cli
```

## Usage

### upload-debug-files command

This command enables you to upload debug files generated by the `flutter build` command to Contentsquare. This allows you to read the [Flutter errors](../error-analysis/#error-reporter) generated in an [obfuscated or de-symbolized](../error-analysis/#symbolization-and-de-obfuscation) app.

#### Configuration

To use the command, provide the following identification elements. These can be passed directly as arguments each time you run the command or set up in a configuration file within your project for a more streamlined command usage.

The required information includes:

* **The targeted platform**

  `ios` or `android`, corresponding to the `flutter build` command.

* **The project ID**

  1. Login to the Contentsquare platform on [https://app.contentsquare.com ↗](https://app.contentsquare.com)
  2. Make sure to be on the right project
  3. The project ID can be found in the URL query parameter `project`: `https://app.contentsquare.com/#/{MODULE_NAME}?project={PROJECT_ID}&hash={HASH}]`

* **Valid API credentials**

  Follow the dedicated documentation from the Help Center to get the client ID and client Secret: [How to create API credentials ↗](https://support.contentsquare.com/hc/en-us/articles/37271728104593).

* **The debug info directory**

  Provided to the `--split-debug-info` option during build command

* **The obfuscation map path (optional)**

  If you use the `--obfuscate` option during the build process, you can specify the path for the obfuscation map by adding the build option `--extra-gen-snapshot-options=--save-obfuscation-map=[YOUR DESIRED FILE PATH]`.

##### Using the YAML configuration file

You can supply this information by adding a `contentsquare_cli.yaml` file to the root of your project.

```yaml
contentsquare_cli:
  android:
    client_id: "[ANDROID CLIENT ID]"
    client_secret: "[ANDROID CLIENT SECRET]"
    project_id: "[ANDROID PROJECT ID]"
    debug_info_dir: "[PATH PROVIDED TO THE --split-debug-info option]"
    obfuscation_mapping_file: "[PATH TO THE OBFUSCATION MAP]"
  ios:
    client_id: "[IOS CLIENT ID]"
    client_secret: "[IOS CLIENT SECRET]"
    project_id: "[IOS PROJECT ID]"
    debug_info_dir: "[PATH PROVIDED TO THE --split-debug-info option]"
    obfuscation_mapping_file: "[PATH TO THE OBFUSCATION MAP]"
```

##### Using the command line arguments

Alternatively, this information can be provided directly as arguments on the command line.

| Option | Description |
| - | - |
| --platform | The target platform for which the debug files are uploaded |
| --client-id | The client ID of [API credentials ↗](https://support.contentsquare.com/hc/en-us/articles/37271728104593) |
| --client-secret | The client SECRET of [API credentials ↗](https://support.contentsquare.com/hc/en-us/articles/37271728104593) |
| --project-id | The contentsquare project ID |
| --debug-info-dir | The path from `--split-debug-info` option |
| --obfuscation-mapping-file | The generated obfuscation map path |

Note

Use `--help` option for further information

Tip

You can combine these two approaches: for example, use the YAML file to store paths and the project ID, while providing the client identifier and secret as command-line arguments.

#### Examples

Let's take the case of debug files generated by this `flutter build` command:

```shell
flutter build apk --release --split-debug-info=myDebugInfoDir --obfuscate --extra-gen-snapshot-options=--save-obfuscation-map=app.android.map.json
```

Using this configuration file:

```yaml
contentsquare_cli:
  android:
    client_id: "my-client-id-android"
    client_secret: "myClientSecretAndroid"
    project_id: "00000"
    debug_info_dir: "myDebugInfoDir"
    obfuscation_mapping_file: "app.android.map.json"
  ios:
    client_id: "my-client-id-ios"
    client_secret: "myClientSecretIos"
    project_id: "00001"
    debug_info_dir: "myDebugInfoDir"
    obfuscation_mapping_file: "app.ios.map.json"
```

You can invoke the upload-debug-files command as follows:

```shell
dart run contentsquare_cli upload-debug-files --platform=android
```

If you prefer using the command line only:

```shell
dart run contentsquare_cli upload-debug-files --platform=android --client-id=my-client-id-android --client-secret="myClientSecretAndroid" --project-id=00000 --debug-info-dir=./myDebugInfoDir --obfuscation-mapping-file=./app.android.map.json
```

Note

For automatic execution, integrate this command in a release script or in a CI/CD pipeline.

## Changelog

### 1.0.1 - 2024.12.10

* Update package metadata

### 1.0.0 - 2024.11.05

* Introduce the `upload-debug-files` command
