---
title: "[Contentstack Command-line Interface (CLI)] - Export Content to CSV File Using the CLI | Beta Commands"
description: Export Content to CSV File Using the CLI | V2.x.x Beta
url: https://www.contentstack.com/docs/developers/cli/export-content-to-csv-file/beta
product: Contentstack
doc_type: cli-guide
audience:
  - developers
version: V2.x.x Beta
last_updated: 2026-03-25
---

# [Contentstack Command-line Interface (CLI)] - Export Content to CSV File Using the CLI | Beta Commands

This page explains how to use the Contentstack CLI `cm:export-to-csv` command to export entries, organization users, organization teams, and taxonomy data into CSV files. It is intended for developers or organization administrators who need to generate CSV exports for backups, analysis, or reporting using the CLI.

## Export Content to CSV File Using the CLI | V2.x.x Beta

The `cm:export-to-csv` command lets you export the following data into a CSV file using Contentstack CLI:
- [Stack Entries](/docs/content-managers/author-content/about-entries)
- [Organization users’ details](/docs/developers/organization/organization-users)
- [Organization teams' details](/docs/developers/teams/about-teams)
- [Taxonomy details](/docs/developers/taxonomy/about-taxonomy)

You can use this to perform tasks such as creating content backups, analyzing data, and more.

## Prerequisites
- [Contentstack account](https://www.contentstack.com/login)
- Contentstack CLI [installed](/docs/developers/cli/install-the-cli) and [configured](/docs/developers/cli/configure-regions-in-the-cli/)
- CLI [authenticated](/docs/developers/cli/cli-authentication/)

**Note:** Only the Organization [Owner](/docs/developers/organization/organization-roles#organization-owner)/[Admin](/docs/developers/organization/organization-roles#organization-admin) has the permissions to export an organization’s user or teams’ data.

## Commands
Contentstack CLI lets you export content from the source stack to a CSV file by running the following command in your terminal:

```
csdx cm:export-to-csv
```

This command prompts the following options:
- **Export entries of a stack to a CSV file**: To export entries, you must have access to the stack.
You’ll be prompted to select the following:**Organization** where your stack resides.
- **Stack** where the content type resides.
- **Branch** of the stack, if the organization is branch-enabled.
- **Content type(s)** to which the entries belong.
- **Language** of the entries to be exported.

The CSV file gets generated in the following format:

`<stack_name>_<content_type>_<language>_entries_exports.csv`

You can also export entries to CSV using the [Management Token](/docs/developers/create-tokens/about-management-tokens) alias.
- **Export organization users' data to a CSV file**: To use this option, you must be an [Organization Owner](/docs/developers/organization/organization-roles#organization-owner) or [Organization Admin](/docs/developers/organization/organization-roles#organization-admin). The command lists only the organization(s) for which you have either role.**Note:** You must be logged in to the Contentstack app to export organization users.

When prompted, select the organization containing the user data you want to export. The CSV file is generated in the following format:

`<orgName>_users_exports.csv`

- **Export organization teams’ data to a CSV file**: Exports a selected organization’s teams data and generates **three CSV files** with the following details:**File 1:** Contains a list of **all teams** in the selected organization.The CSV file is generated in the following format:

`<org-name>_teams_export.csv`
- **File 2:**Contains a list of **all the users in a particular team** if the `team-uid` flag is passed.The CSV file is generated in the following format:

`<org-name>_team_<team-uid>_User_Details_export.csv`
- Contains a list of **all the users in all the teams** if the `team-uid` flag is not passed.The CSV file is generated in the following format:

`<org-name>_team_User_Details_export.csv`
- **File 3:**Contains a list of **all the stack role details of a particular team** if the `team-uid` flag is passed.The CSV file is generated in the following format:

`stack_role_mapping_<team-uid>.csv`
- Contains a list of **all the stack role details of all the teams** if the `team-uid` flag is not passed.The CSV file is generated in the following format:

`stack_role_mapping.csv`

- **Export taxonomies to a CSV file**: Export taxonomies and related terms to CSV files.
When you choose this option, you are prompted to select the following:The organization where your stack resides.
- The stack that contains the taxonomy you want to export.

The CSV files are generated in the following formats:

`<stack-name>_taxonomies.csv`

`<stack-name>_<taxonomy-name>_<taxonomy-uid>_terms.csv`
- **Exit**: Stops the command from executing further.

Once you select any of the above options, a “data” folder is automatically created in your current working directory. The corresponding CSV files are stored within this folder.

Alternatively, you can provide the required parameters after the command in a single line as shown below:

```
csdx cm:export-to-csv -a  -n  --action >  --org  --org-name  --locale  --content-type  --delimiter
```

**Options**:

| Flag | Short Flag | Description |
|---|---|---|
| `--action` | - | Option to export data.Supported values: `entries`, `users`, `teams`, `taxonomies` |
| `--alias` | `-a` | Alias of the management token. |
| `--org` | - | Provide the organization UID to clone organization-level users. |
| `--stack-name` | `-n` | Name of the stack to be used in the CSV file name. |
| `--stack-api-key` | `-k` | API key of the source stack. |
| `--org-name` | - | Name of the organization to be used in the CSV file name. |
| `--locale` | - | Locale of the entries to be exported. |
| `--content-type` | - | Content type of the entries to be exported. |
| `--branch` | - | Name of the branch from which entries will be exported. |
| `--team-uid` | - | Provide the UID of a specific team in an organization. |
| `--taxonomy-uid` | - | Provide the taxonomy UID of the related terms you want to export. |
| `--include-fallback` | - | [Optional] Includes fallback locale data when exporting taxonomies.When enabled, if a taxonomy term does not exist in the specified locale, it falls back to the hierarchy defined in the branch settings. |
| `--fallback-locale` | - | [Optional] Specify a fallback locale for taxonomy export.This locale is used when a taxonomy term does not exist in the primary locale.<br><br>Takes priority over branch fallback hierarchy when both are specified. |
| `--delimiter` | - | [Optional] Provide a delimiter to separate individual data fields within the CSV file.<br><br>Default: `,`<br><br>Example: `cm:export-to-csv --delimiter ','` |

**Examples**:
- Export entries to a CSV file:

```
csdx cm:export-to-csv --action  --locale  --alias  --content-type
```

- Export entries to a CSV file with a custom stack name:

```
csdx cm:export-to-csv --action  --locale  --alias  --content-type  --stack-name
```

- Export organization users to a CSV file:

```
csdx cm:export-to-csv --action  --org
```

- Export organization users to a CSV file with a custom organization name:

```
csdx cm:export-to-csv --action  --org  --org-name
```

- Export all teams in an organization:

```
csdx cm:export-to-csv --action  --org
```

- Export all the data for a specific team:

```
csdx cm:export-to-csv --action  --team-uid
```

- Export all the data for a specific team of a given organization by providing the organization UID and name:

```
csdx cm:export-to-csv --action  --org  --org-name  --team-uid
```

- Export taxonomies and related terms to a CSV file by providing the taxonomy UID:

```
csdx cm:export-to-csv --action  --alias  --taxonomy-uid
```

- Export taxonomies and respective terms to a CSV file:

```
csdx cm:export-to-csv --action  --alias
```

- Export taxonomies and respective terms to a CSV file with a delimiter:

```
csdx cm:export-to-csv --action  --alias  --delimiter
```

- Export entries to a CSV file with branch name provided:

```
csdx cm:export-to-csv --action  --locale  --alias  --content-type  --stack-name  --branch
```

- Export taxonomies with a specific locale:

```
csdx cm:export-to-csv --action  --alias  --locale
```

- Export taxonomies with a fallback locale support:

```
csdx cm:export-to-csv --action  --alias  --locale  --include-fallback
```

- Export taxonomies with a custom fallback locale:

```
csdx cm:export-to-csv --action  --alias  --locale  --include-fallback --fallback-locale
```

## Common questions

### Where are the exported CSV files stored?
Once you select any of the above options, a “data” folder is automatically created in your current working directory. The corresponding CSV files are stored within this folder.

### Who can export organization users’ or teams’ data?
Only the Organization Owner/Admin has the permissions to export an organization’s user or teams’ data.

### What values are supported for `--action`?
Supported values: `entries`, `users`, `teams`, `taxonomies`

### Can I change the delimiter used in the CSV output?
Yes, use `--delimiter`. Default: `,` Example: `cm:export-to-csv --delimiter ','`