Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
53caf2b
fix: enhance error logging in ImportAssetTypes and ImportAssets
Jun 27, 2026
9bd3f91
revert: asset localisation
Jun 29, 2026
517cdd2
docs: comprehensive README audit, package.json standardization, and s…
cs-raj Jul 5, 2026
17256f8
fix bulk operation and export-to-csv
cs-raj Jul 5, 2026
0095452
Merge branch 'v2-dev' into fix/DX-9346
Jul 6, 2026
d9ed638
Merge pull request #274 from contentstack/v2-beta
OMpawar-21 Jul 6, 2026
4caa096
Merge branch 'v2-dev' into fix/DX-9364
cs-raj Jul 6, 2026
ddd50d9
fix: resolve Snyk hardcoded secret false positives in message constants
harshitha-cstk Jul 7, 2026
a36a2eb
resolve path traversal issue
harshitha-cstk Jul 7, 2026
883a216
fix formatting
harshitha-cstk Jul 7, 2026
d153d43
fix formatting
harshitha-cstk Jul 7, 2026
a10275f
Merge pull request #271 from contentstack/fix/DX-9364
cs-raj Jul 7, 2026
88683fb
Merge branch 'v2-dev' into fix/DX-9346
naman-contentstack Jul 7, 2026
8f039f4
fix: failing test cases
Jul 7, 2026
8783af2
Merge pull request #249 from contentstack/fix/DX-9346
naman-contentstack Jul 7, 2026
23cc422
Merge branch 'v2-dev' into fix/dx-8733-snyk-fix-v2
harshitha-cstk Jul 9, 2026
02a2861
Merge pull request #275 from contentstack/fix/dx-8733-snyk-fix-v2
harshitha-cstk Jul 9, 2026
4bfbdd8
fix(personalize): fix CT linking failure from empty-audience experien…
cs-raj Jul 10, 2026
ddc69b1
test(variants): add unit tests for DX-9469 fix in experiences import
cs-raj Jul 10, 2026
fbdeb70
fix(variants): make variant-skip warning message generic [DX-9469]
cs-raj Jul 10, 2026
f866d10
chore(variants): remove unused lodash/values and lodash/cloneDeep imp…
cs-raj Jul 10, 2026
e39a8a8
Merge pull request #281 from contentstack/fix/DX-9469-v2
cs-raj Jul 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
fileignoreconfig:
- filename: pnpm-lock.yaml
checksum: 705ce49f9667e34fb64082025a41a1e3b950c1d2f968c3d4faf9461943ae599a
version: ""
checksum: 89126fab0d404140bb81c6b2d58cc54de26e5bfe9c0f1f81ee353bc5c05a0fbd
- filename: packages/contentstack-import/src/utils/import-config-handler.ts
checksum: 999092528b445b6e9de6883150f02b56bf5050dc64129335d84246c157bfe303
- filename: packages/contentstack-import-setup/src/utils/import-config-handler.ts
checksum: c13ca4996b3767fae9d2716fe9ae7d90d98b26012e064f42ea9fdd054f684761
- filename: packages/contentstack-export/src/utils/export-config-handler.ts
checksum: 68351337b78f0962475498946fe34245a681182db756528c9ff6fab7153392e3
version: ""
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CLI supports content management scripts through which you can perform the follow
## Installing CLI
### Prerequisites
Contentstack account
Node.js version 16 or above
Node.js version 22 or above

### Installation
To install CLI on your system, run the below command in your terminal:
Expand Down Expand Up @@ -55,19 +55,18 @@ $ csdx --help
## Namespaces
**auth**: To perform [authentication-related](/packages/contentstack-auth) activities

**cm**: To perform content management activities such as [bulk publish](/packages/contentstack-bulk-publish), [import](/packages/contentstack-import), and [export](/packages/contentstack-export), [export-to-csv] (/packages/contentstack-export-to-csv), [seed] (/packages/contentstack-seed)
**cm**: To perform content management activities such as [bulk operations](/packages/contentstack-bulk-operations), [import](/packages/contentstack-import), and [export](/packages/contentstack-export), [export-to-csv](/packages/contentstack-export-to-csv), [seed](/packages/contentstack-seed)

**help**: To list the helpful commands in CLI

**config**: To set regions and customize them

## Documentation

To get a more detailed documentation for every command, visit the [CLI section](https://www.contentstack.com/docs/developers/cli) in our docs.
To get a more detailed documentation for every command, visit the [CLI section](https://www.contentstack.com/docs/headless-cms/cli) in our docs.

## Useful Plugins

- [Generate TypeScript typings from a Stack](https://github.com/contentstack/cli-plugins/tree/v2-beta/packages/contentstack-cli-tsgen) (`contentstack-cli-tsgen`)
- [Generate TypeScript typings from a Stack](https://github.com/Contentstack-Solutions/contentstack-cli-tsgen)
- [Generate TypeScript typings from a Stack](https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-cli-tsgen) (`contentstack-cli-tsgen`)
- [Manage Content Types (list, details, audit, compare, diagram)](https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-content-type) (`contentstack-cli-content-type`)
- [Validate regex fields in Content Types and Global Fields](https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-cli-cm-regex-validate) (`@contentstack/cli-cm-regex-validate`)
24 changes: 12 additions & 12 deletions packages/contentstack-apps-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ $ csdx plugins:install @contentstack/apps-cli

## How to use this plugin

This plugin requires you to be authenticated using [csdx auth:login](https://www.contentstack.com/docs/developers/cli/authenticate-with-the-cli/).
This plugin requires you to be authenticated using [csdx auth:login](https://www.contentstack.com/docs/headless-cms/cli-authentication).

<!-- usage -->
```sh-session
$ npm install -g @contentstack/apps-cli
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/apps-cli/1.6.1 darwin-arm64 node-v18.20.2
@contentstack/apps-cli/2.0.0-beta.2 darwin-arm64 node-v18.20.2
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -74,7 +74,7 @@ EXAMPLES
$ csdx app:update
```

_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/index.ts)_
_See code: [src/commands/app/index.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/index.ts)_

## `csdx app:create`

Expand Down Expand Up @@ -114,7 +114,7 @@ EXAMPLES
$ csdx app:create --name App-4 --app-type organization --org <UID> --boilerplate <Ecommerce App Boilerplate>
```

_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/create.ts)_
_See code: [src/commands/app/create.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/create.ts)_

## `csdx app:delete`

Expand All @@ -139,7 +139,7 @@ EXAMPLES
$ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
```

_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/delete.ts)_
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/delete.ts)_

## `csdx app:deploy`

Expand All @@ -151,7 +151,7 @@ USAGE
[--app-url <value>] [--launch-project existing|new] [-c <value>]

FLAGS
-c, --config=<value> [optional] Please enter the path of the config file.
-c, --config=<value> Path to the optional config file.
--app-uid=<value> Provide the app UID of an existing app.
--app-url=<value> Please enter the URL of the app you want to deploy.
--hosting-type=<option> Choose a valid Hosting Type.
Expand All @@ -177,7 +177,7 @@ EXAMPLES
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <hosting-with-launch> --launch-project <new> --config <config-path>
```

_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/deploy.ts)_
_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/deploy.ts)_

## `csdx app:get`

Expand Down Expand Up @@ -207,7 +207,7 @@ EXAMPLES
$ csdx app:get --org <value> --app-uid <value> --app-type organization
```

_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/get.ts)_
_See code: [src/commands/app/get.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/get.ts)_

## `csdx app:install`

Expand All @@ -233,7 +233,7 @@ EXAMPLES
$ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
```

_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/install.ts)_
_See code: [src/commands/app/install.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/install.ts)_

## `csdx app:reinstall`

Expand All @@ -259,7 +259,7 @@ EXAMPLES
$ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
```

_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/reinstall.ts)_
_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/reinstall.ts)_

## `csdx app:uninstall`

Expand All @@ -286,7 +286,7 @@ EXAMPLES
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
```

_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/uninstall.ts)_
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/uninstall.ts)_

## `csdx app:update`

Expand All @@ -309,5 +309,5 @@ EXAMPLES
$ csdx app:update --app-manifest ./boilerplate/manifest.json
```

_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/update.ts)_
_See code: [src/commands/app/update.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/update.ts)_
<!-- commandsstop -->
1 change: 1 addition & 0 deletions packages/contentstack-apps-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"bin": "csdx",
"dirname": "apps-cli",
"commands": "./lib/commands",
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-apps-cli/<%- commandPath %>",
"hooks": {
"init": "./lib/hooks/init/load-chalk.js"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-apps-cli/src/commands/app/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Install extends AppCLIBaseCommand {
}),
"stack-api-key": flags.string({
char: "k",
description: commonMsg.STACK_API_KEY,
description: commonMsg.STACK_API_KEY_placeholder,
}),
...AppCLIBaseCommand.baseFlags,
};
Expand Down Expand Up @@ -89,7 +89,7 @@ export default class Install extends AppCLIBaseCommand {
// in case a stack app is selected and no stack-api-key is provided
if (appType === "stack" && !this.flags["stack-api-key"]) {
this.log(
$t(installAppMsg.MISSING_STACK_API_KEY, {
$t(installAppMsg.MISSING_STACK_API_KEY_placeholder, {
app: app?.name || app?.uid,
}),
"warn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Reinstall extends AppCLIBaseCommand {
}),
"stack-api-key": flags.string({
char: "k",
description: commonMsg.STACK_API_KEY,
description: commonMsg.STACK_API_KEY_placeholder,
}),
...AppCLIBaseCommand.baseFlags,
};
Expand Down Expand Up @@ -85,7 +85,7 @@ export default class Reinstall extends AppCLIBaseCommand {
appType = "stack";

this.log(
$t(reinstallAppMsg.MISSING_STACK_API_KEY, {
$t(reinstallAppMsg.MISSING_STACK_API_KEY_placeholder, {
app: app?.name || app?.uid,
}),
"warn"
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-apps-cli/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const commonMsg = {
APP_UID: "Provide the app UID of an existing app.",
APP_TYPE_DESCRIPTION: "Type of app",
CONTACT_SUPPORT: "Contact the support team for help.",
STACK_API_KEY: "API key of the stack where the app operation is to be performed.",
STACK_API_KEY_placeholder: "API key of the stack where the app operation is to be performed.",
USER_TERMINATION: "Process terminated by the user.",
CLI_APP_CLI_LOGIN_FAILED: "You're not logged in. Run $ csdx auth:login to continue."
};
Expand Down Expand Up @@ -97,7 +97,7 @@ const installAppMsg = {
CHOOSE_A_STACK: "Please select a stack",
APP_INSTALLED_SUCCESSFULLY: "{app} installed successfully in {target}.",
INSTALL_ORG_APP_TO_STACK: "{app} is an organization app. It cannot be installed to a stack. Do you want to proceed?",
MISSING_STACK_API_KEY: "As {app} is a stack app, it can only be installed in a stack. Please select a stack.",
MISSING_STACK_API_KEY_placeholder: "As {app} is a stack app, it can only be installed in a stack. Please select a stack.",
INSTALLING_APP_NOTICE: "Installing {app} on {type} {target}.",
APP_ALREADY_INSTALLED: "Please use $ csdx app:reinstall to reinstall the app.",
}
Expand All @@ -115,7 +115,7 @@ const reinstallAppMsg = {
CHOOSE_A_STACK: "Please select a stack",
APP_REINSTALLED_SUCCESSFULLY: "{app} reinstalled successfully in {target}.",
REINSTALL_ORG_APP_TO_STACK: "{app} is an organization app. It cannot be reinstalled to a stack. Do you want to proceed?",
MISSING_STACK_API_KEY: "As {app} is a stack app, it can only be reinstalled in a stack. Please select a stack.",
MISSING_STACK_API_KEY_placeholder: "As {app} is a stack app, it can only be reinstalled in a stack. Please select a stack.",
REINSTALLING_APP_NOTICE: "Reinstalling {app} on {type} {target}.",
APP_UID: "Provide the app UID of an existing app to be reinstalled.",
APP_ALREADY_LATEST_VERSION: "The application is already up to date; no new version is available.",
Expand Down
18 changes: 7 additions & 11 deletions packages/contentstack-asset-management/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @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/developers/cli/migration/).
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/blob/main/LICENSE)
[![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)
Expand All @@ -15,9 +15,9 @@ Asset Management 2.0 API adapter for Contentstack CLI export and import. Used by

This package provides:

- **AssetManagementAdapter** – HTTP client for the Asset Management API (spaces, assets, folders, fields, asset types).
- **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`, `IAssetManagementAdapter`, and related types for export/import integration.
- **Types** – `AssetManagementExportOptions`, `LinkedWorkspace`, `ICSAssetsAdapter`, and related types for export/import integration.

# Usage

Expand All @@ -30,13 +30,9 @@ await exportSpaceStructure({
linkedWorkspaces,
exportDir,
branchName: 'main',
assetManagementUrl,
csAssetsUrl,
org_uid,
context,
progressManager,
progressProcessName,
updateStatus,
downloadAsset, // optional
});
```

Expand All @@ -45,5 +41,5 @@ await exportSpaceStructure({
| Export | Description |
|--------|-------------|
| `exportSpaceStructure` | Async function to export space structure for given linked workspaces. |
| `AssetManagementAdapter` | Class to call the Asset Management API (getSpace, getWorkspaceFields, getWorkspaceAssets, etc.). |
| Types from `./types` | `AssetManagementExportOptions`, `ExportSpaceOptions`, `ChunkedJsonWriteOptions`, `LinkedWorkspace`, `SpaceResponse`, `FieldsResponse`, `AssetTypesResponse`, and related API types. |
| `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. |
7 changes: 6 additions & 1 deletion packages/contentstack-asset-management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"devPlugins": [
"@oclif/plugin-help"
],
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-cs-assets/<%- commandPath %>"
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-asset-management/<%- commandPath %>"
},
"devDependencies": {
"@types/chai": "^4.3.11",
Expand All @@ -57,5 +57,10 @@
"source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/contentstack/cli-plugins.git",
"directory": "packages/contentstack-asset-management"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@ export default class ExportAssetTypes extends CSAssetsExportAdapter {
super(apiConfig, exportContext);
}

async start(spaceUid: string): Promise<void> {
async start(spaceUid: string): Promise<number> {
await this.init();

log.debug('Starting shared asset types export process...', this.exportContext.context);
log.info('Exporting shared asset types...', this.exportContext.context);

const assetTypesData = await this.getWorkspaceAssetTypes(spaceUid, this.apiPageSize, this.apiFetchConcurrency);
const items = getArrayFromResponse(assetTypesData, 'asset_types');
const dir = this.getAssetTypesDir();
if (items.length === 0) {
log.info('No asset types to export, writing empty asset-types', this.exportContext.context);
} else {
log.debug(`Writing ${items.length} shared asset types`, this.exportContext.context);
}
await this.writeItemsToChunkedJson(
dir,
'asset-types.json',
'asset_types',
['uid', 'title', 'category', 'file_extension'],
items,
);
log.info(
items.length === 0
? 'No asset types to export'
: `Exported ${items.length} shared asset type(s)`,
this.exportContext.context,
);
this.tick(true, `asset_types (${items.length})`, null);
return items.length;
}
}
Loading
Loading