Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 7 additions & 3 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 648c8b938cf0536e479231c214b493b30dab92da4f2497a96c43fa4f65f5b5aa
checksum: 7ab88b768020473414a7322e16c04b5b5a73b0122742b79b57f6e48bf39ae511
- filename: pnpm-lock.yaml
checksum: 96a03383a1814bce7e81bc398630b400d0030a1d8680222000c6c2c1b72ad3d8
checksum: 1f9e4ddfd5db6a7677515bb1af1373d75bc83dbc755a99515808394df5d593d5
- filename: packages/contentstack-export/src/commands/cm/stacks/export.ts
checksum: a6cc98499a304a63f520e713c85ff707ca904044e15f095fa7498a5f602d57c5
- filename: packages/contentstack-export/README.md
checksum: 8b9f38642faa3b8fb5b2a35a6fe79b74862aeb32c318a1346a117fefea1291cd
- filename: packages/contentstack/README.md
checksum: de405506f162ba7ea116f04092bd51ae98808161768b7754e3ae893a7f0e79cb
checksum: b746ebdb433947d6117694d33739b56d679d3fe1e18bc0a177f60b6a1f553ac9
version: '1.0'
1,957 changes: 1,110 additions & 847 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/2.0.0-beta.2 darwin-arm64 node-v24.11.1
@contentstack/cli-cm-clone/2.0.0-beta.3 darwin-arm64 node-v24.11.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~2.0.0-beta.2",
"@contentstack/cli-cm-export": "~2.0.0-beta.3",
"@contentstack/cli-cm-import": "~2.0.0-beta.2",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.15.0",
Expand Down
74 changes: 10 additions & 64 deletions packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/2.0.0-beta.2 darwin-arm64 node-v24.11.1
@contentstack/cli-cm-export/2.0.0-beta.3 darwin-arm64 node-v24.11.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand All @@ -59,93 +59,39 @@ USAGE
# Commands

<!-- commands -->
* [`csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets)
* [`csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets)
* [`csdx cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport---config-value---stack-api-key-value---data-dir-value---alias-value---module-value---content-types-value---branch-value---secured-assets)

## `csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`
## `csdx cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`

Export content from a stack

```
USAGE
$ csdx cm:export cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>]
[--content-types <value>] [--branch <value>] [--secured-assets]
$ csdx cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>]
[--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]

FLAGS
-B, --branch=<value> [optional] The name of the branch where you want to export your content. If you don't
mention the branch name, then by default the content will be exported from all the
branches of your stack.
-a, --alias=<value> The management token alias of the source stack from which you will export content.
-c, --config=<value> [optional] Path of the config
-d, --data-dir=<value> The path or the location in your file system to store the exported content. For e.g.,
./content
-k, --stack-api-key=<value> API Key of the source stack
-m, --module=<value> [optional] Specific module name. If not specified, the export command will export all
the modules to the stack. The available modules are assets, content-types, entries,
environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks,
workflows, custom-roles, and taxonomies.
-t, --content-types=<value>... [optional] The UID of the content type(s) whose content you want to export. In case
of multiple content types, specify the IDs separated by spaces.
-y, --yes [optional] Force override all Marketplace prompts.
--branch-alias=<value> (Optional) The alias of the branch from which you want to export content.
--secured-assets [optional] Use this flag for assets that are secured.

DESCRIPTION
Export content from a stack

ALIASES
$ csdx cm:export

EXAMPLES
$ csdx cm:stacks:export --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>

$ csdx cm:stacks:export --config <path/to/config/dir>

$ csdx cm:stacks:export --alias <management_token_alias>

$ csdx cm:stacks:export --alias <management_token_alias> --data-dir <path/to/export/destination/dir>

$ csdx cm:stacks:export --alias <management_token_alias> --config <path/to/config/file>

$ csdx cm:stacks:export --module <single module name>

$ csdx cm:stacks:export --branch [optional] branch name
```

## `csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`

Export content from a stack

```
USAGE
$ csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types
<value>] [--branch <value>] [--secured-assets]

FLAGS
-B, --branch=<value> [optional] The name of the branch where you want to export your content. If you don't
--branch=<value> [optional] The name of the branch where you want to export your content. If you don't
mention the branch name, then by default the content will be exported from all the
branches of your stack.
-a, --alias=<value> The management token alias of the source stack from which you will export content.
-c, --config=<value> [optional] Path of the config
-d, --data-dir=<value> The path or the location in your file system to store the exported content. For e.g.,
./content
-k, --stack-api-key=<value> API Key of the source stack
-m, --module=<value> [optional] Specific module name. If not specified, the export command will export all
--branch-alias=<value> (Optional) The alias of the branch from which you want to export content.
--content-types=<value>... [optional] The UID of the content type(s) whose content you want to export. In case
of multiple content types, specify the IDs separated by spaces.
--module=<value> [optional] Specific module name. If not specified, the export command will export all
the modules to the stack. The available modules are assets, content-types, entries,
environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks,
workflows, custom-roles, and taxonomies.
-t, --content-types=<value>... [optional] The UID of the content type(s) whose content you want to export. In case
of multiple content types, specify the IDs separated by spaces.
-y, --yes [optional] Force override all Marketplace prompts.
--branch-alias=<value> (Optional) The alias of the branch from which you want to export content.
--secured-assets [optional] Use this flag for assets that are secured.

DESCRIPTION
Export content from a stack

ALIASES
$ csdx cm:export

EXAMPLES
$ csdx cm:stacks:export --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>

Expand Down
8 changes: 2 additions & 6 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down Expand Up @@ -89,12 +89,8 @@
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-export/<%- commandPath %>"
},
"csdxConfig": {
"expiredCommands": {
"cm:export": "csdx cm:stacks:export"
},
"shortCommandName": {
"cm:stacks:export": "EXPRT",
"cm:export": "O-EXPRT"
"cm:stacks:export": "EXPRT"
}
},
"repository": "https://github.com/contentstack/cli"
Expand Down
34 changes: 1 addition & 33 deletions packages/contentstack-export/src/commands/cm/stacks/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Command } from '@contentstack/cli-command';
import {
cliux,
messageHandler,
printFlagDeprecation,
managementSDKClient,
flags,
ContentstackClient,
Expand Down Expand Up @@ -35,28 +34,17 @@ export default class ExportCommand extends Command {
];

static usage: string =
'cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]';
'cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]';

static flags: FlagInput = {
config: flags.string({
char: 'c',
description: '[optional] Path of the config',
}),
'stack-uid': flags.string({
char: 's',
description: 'API key of the source stack',
hidden: true,
parse: printFlagDeprecation(['-s', '--stack-uid'], ['-k', '--stack-api-key']),
}),
'stack-api-key': flags.string({
char: 'k',
description: 'API Key of the source stack',
}),
data: flags.string({
description: 'path or location to store the data',
hidden: true,
parse: printFlagDeprecation(['--data'], ['--data-dir']),
}),
'data-dir': flags.string({
char: 'd',
description: 'The path or the location in your file system to store the exported content. For e.g., ./content',
Expand All @@ -65,36 +53,19 @@ export default class ExportCommand extends Command {
char: 'a',
description: 'The management token alias of the source stack from which you will export content.',
}),
'management-token-alias': flags.string({
description: 'alias of the management token',
hidden: true,
parse: printFlagDeprecation(['--management-token-alias'], ['-a', '--alias']),
}),
'auth-token': flags.boolean({
char: 'A',
description: 'to use auth token',
hidden: true,
parse: printFlagDeprecation(['-A', '--auth-token']),
}),
module: flags.string({
char: 'm',
description:
'[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'content-types': flags.string({
char: 't',
description:
'[optional] The UID of the content type(s) whose content you want to export. In case of multiple content types, specify the IDs separated by spaces.',
multiple: true,
parse: printFlagDeprecation(['-t'], ['--content-types']),
}),
branch: flags.string({
char: 'B',
// default: 'main',
description:
"[optional] The name of the branch where you want to export your content. If you don't mention the branch name, then by default the content will be exported from all the branches of your stack.",
parse: printFlagDeprecation(['-B'], ['--branch']),
exclusive: ['branch-alias'],
}),
'branch-alias': flags.string({
Expand All @@ -115,8 +86,6 @@ export default class ExportCommand extends Command {
}),
};

static aliases: string[] = ['cm:export'];

async run(): Promise<void> {
let exportDir: string = pathValidator('logs');
try {
Expand All @@ -125,7 +94,6 @@ export default class ExportCommand extends Command {
// Prepare the context object
const context = this.createExportContext(exportConfig.apiKey, exportConfig.authenticationMethod);
exportConfig.context = { ...context };
//log.info(`Using Cli Version: ${this.context?.cliVersion}`, exportConfig.context);

// Assign exportConfig variables
this.assignExportConfig(exportConfig);
Expand Down
Loading
Loading