# @contentstack/cli-asset-management

> Contentstack Assets API adapter for export and import

Latest version **1.0.1** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @contentstack/cli-asset-management
pnpm add @contentstack/cli-asset-management
yarn add @contentstack/cli-asset-management
bun add @contentstack/cli-asset-management
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-09-15 |
| First published | 2026-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 229.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | mynk, cloudaccounts |
| Keywords | contentstack, cs-assets, contentstack-assets, cli |

## Links

- npm: https://www.npmjs.com/package/@contentstack/cli-asset-management
- Repository: https://github.com/contentstack/cli-plugins
- Homepage: https://github.com/contentstack/cli-plugins#readme
- Issues: https://github.com/contentstack/cli-plugins/issues
- npm.io page: https://npm.io/package/@contentstack/cli-asset-management

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [lodash](https://npm.io/package/lodash.md) ^4.18.1
- [@contentstack/cli-utilities](https://npm.io/package/@contentstack/cli-utilities.md) ~2.0.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2026-09-15
- 1.0.0-beta.8 (beta) — 2026-07-29
- 1.0.0 — 2026-08-12
- 1.0.0-beta.7 — 2026-07-20
- 1.0.0-beta.6 — 2026-07-13
- 1.0.0-beta.5 — 2026-06-29
- 1.0.0-beta.4 — 2026-06-08
- 1.0.0-beta.3 — 2026-06-01
- 1.0.0-beta.2 — 2026-05-25
- 1.0.0-beta.1 — 2026-05-18
- 1.0.0-beta.0 — 2026-04-28

## README

# @contentstack/cli-asset-management

Asset Management 2.0 API adapter for Contentstack CLI export and import. Used by the export and import plugins when Asset Management (AM 2.0) is enabled. To learn how to export and import content in Contentstack, refer to the [Migration guide](https://www.contentstack.com/docs/headless-cms/cli/migration/).

[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli-plugins/blob/main/LICENSE)

<!-- toc -->
* [@contentstack/cli-asset-management](#contentstackcli-asset-management)
* [Overview](#overview)
* [Usage](#usage)
* [Exports](#exports)
<!-- tocstop -->

# Overview

This package provides:

- **CSAssetsAdapter** – HTTP client for the Asset Management API (spaces, assets, folders, fields, asset types).
- **exportSpaceStructure** – Exports space metadata and full workspace structure (metadata, folders, assets, fields, asset types) for linked workspaces.
- **Types** – `AssetManagementExportOptions`, `LinkedWorkspace`, `ICSAssetsAdapter`, and related types for export/import integration.

# Usage

This package is consumed by the export and import plugins. When using the export CLI with the `--asset-management` flag (or when the host app enables AM 2.0), the export plugin calls `exportSpaceStructure` with linked workspaces and options:

```ts
import { exportSpaceStructure } from '@contentstack/cli-asset-management';

await exportSpaceStructure({
  linkedWorkspaces,
  exportDir,
  branchName: 'main',
  csAssetsUrl,
  org_uid,
  context,
});
```

# Exports

| Export | Description |
|--------|-------------|
| `exportSpaceStructure` | Async function to export space structure for given linked workspaces. |
| `CSAssetsAdapter` | Class to call the Asset Management API (getSpace, getWorkspaceFields, getWorkspaceAssets, etc.). |
| Types from `./types` | `AssetManagementExportOptions`, `ExportContext`, `ChunkedJsonWriteOptions`, `LinkedWorkspace`, `SpaceResponse`, `FieldsResponse`, `AssetTypesResponse`, and related API types. |

---
_Source: https://npm.io/package/@contentstack/cli-asset-management · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
