From 41b73639afd0f62f7c27845bc9dbebaa678cafd9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Jun 2026 16:50:23 +0530 Subject: [PATCH 1/3] added org plan check --- .talismanrc | 17 +- packages/contentstack-auth/README.md | 2 +- packages/contentstack-config/README.md | 32 +- .../src/commands/config/set/region.ts | 9 + .../src/interfaces/index.ts | 1 + .../src/utils/region-handler.ts | 2 + packages/contentstack-utilities/package.json | 2 +- .../src/feature-status/build-auth-headers.ts | 43 + .../feature-status/feature-status-handler.ts | 49 + .../src/feature-status/feature-uids.ts | 6 + .../src/feature-status/index.ts | 5 + .../src/feature-status/resolve-auth-host.ts | 13 + .../src/feature-status/types.ts | 16 + packages/contentstack-utilities/src/index.ts | 4 +- packages/contentstack/README.md | 2154 +---------------- packages/contentstack/package.json | 5 +- .../src/hooks/prerun/plan-guard.ts | 110 + .../contentstack/src/utils/context-handler.ts | 4 +- pnpm-lock.yaml | 8 +- 19 files changed, 428 insertions(+), 2054 deletions(-) create mode 100644 packages/contentstack-utilities/src/feature-status/build-auth-headers.ts create mode 100644 packages/contentstack-utilities/src/feature-status/feature-status-handler.ts create mode 100644 packages/contentstack-utilities/src/feature-status/feature-uids.ts create mode 100644 packages/contentstack-utilities/src/feature-status/index.ts create mode 100644 packages/contentstack-utilities/src/feature-status/resolve-auth-host.ts create mode 100644 packages/contentstack-utilities/src/feature-status/types.ts create mode 100644 packages/contentstack/src/hooks/prerun/plan-guard.ts diff --git a/.talismanrc b/.talismanrc index 1e16250529..44edf300c4 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,6 +1,13 @@ fileignoreconfig: - - filename: pnpm-lock.yaml - checksum: 0f2e17618b7c8286c5f76d4e25a98b830d3eb2d29acc6f8099f3501ff150d4f4 - - filename: packages/contentstack-utilities/src/message-handler.ts - checksum: e7221e8413005b9efe3a230cd91aff130850976addc41c0acb10745a56ec3245 -version: '1.0' \ No newline at end of file + +- filename: pnpm-lock.yaml + checksum: 0f2e17618b7c8286c5f76d4e25a98b830d3eb2d29acc6f8099f3501ff150d4f4 +- filename: packages/contentstack-utilities/src/message-handler.ts + checksum: e7221e8413005b9efe3a230cd91aff130850976addc41c0acb10745a56ec3245 +- filename: packages/contentstack-utilities/src/feature-status/build-auth-headers.ts + checksum: 9360dfbce41aa9c8a62889f4821c37fc222b04b8b1c552d1dfbcd8f2854d49e0 +- filename: packages/contentstack/src/hooks/prerun/plan-guard.ts + checksum: 74eeb5c98e9ae48bf6f2918e75a7cfca23915396ffdd177b8716acba35c287da +- filename: packages/contentstack/README.md + checksum: c0f958f9650e7a26133758e4d0ceae34cdf736e7f54e1cf9114694e9c041f2a0 + version: '1.0' diff --git a/packages/contentstack-auth/README.md b/packages/contentstack-auth/README.md index 61f0f8814d..b08bed4f57 100644 --- a/packages/contentstack-auth/README.md +++ b/packages/contentstack-auth/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-auth/2.0.0-beta.10 darwin-arm64 node-v22.13.1 +@contentstack/cli-auth/2.0.0-beta.13 darwin-arm64 node-v24.18.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-config/README.md b/packages/contentstack-config/README.md index 5fcf593234..7e6d5fa5c7 100644 --- a/packages/contentstack-config/README.md +++ b/packages/contentstack-config/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-config/2.0.0-beta.7 darwin-arm64 node-v22.13.1 +@contentstack/cli-config/2.0.0-beta.11 darwin-arm64 node-v24.18.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -457,25 +457,25 @@ Set region for CLI ``` USAGE $ csdx config:set:region [REGION] [--cda --cma --ui-host -n ] [--developer-hub - ] [--personalize ] [--launch ] [--studio ] [--asset-management ] + ] [--personalize ] [--launch ] [--studio ] [--cs-assets ] [--auth-api ] ARGUMENTS [REGION] Name for the region FLAGS - -n, --name= Name for the region, if this flag is added then cda, cma and ui-host flags are - required - --asset-management= Custom host to set for Asset Management API - --cda= Custom host to set for content delivery API, if this flag is added then cma, ui-host - and name flags are required - --cma= Custom host to set for content management API, , if this flag is added then cda, - ui-host and name flags are required - --developer-hub= Custom host to set for Developer hub API - --launch= Custom host to set for Launch API - --personalize= Custom host to set for Personalize API - --studio= Custom host to set for Studio API - --ui-host= Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are - required + -n, --name= Name for the region, if this flag is added then cda, cma and ui-host flags are required + --auth-api= Custom host to set for Auth API + --cda= Custom host to set for content delivery API, if this flag is added then cma, ui-host and + name flags are required + --cma= Custom host to set for content management API, , if this flag is added then cda, ui-host + and name flags are required + --cs-assets= Custom host to set for Contentstack Assets API + --developer-hub= Custom host to set for Developer hub API + --launch= Custom host to set for Launch API + --personalize= Custom host to set for Personalize API + --studio= Custom host to set for Studio API + --ui-host= Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are + required DESCRIPTION Set region for CLI @@ -507,7 +507,7 @@ EXAMPLES $ csdx config:set:region --cma --cda --ui-host --name "India" --studio - $ csdx config:set:region --cma --cda --ui-host --name "India" --asset-management + $ csdx config:set:region --cma --cda --ui-host --name "India" --cs-assets $ csdx config:set:region --cda --cma --ui-host --name "India" --developer-hub --launch --personalize --studio ``` diff --git a/packages/contentstack-config/src/commands/config/set/region.ts b/packages/contentstack-config/src/commands/config/set/region.ts index 5671515955..dcfd663918 100644 --- a/packages/contentstack-config/src/commands/config/set/region.ts +++ b/packages/contentstack-config/src/commands/config/set/region.ts @@ -49,6 +49,9 @@ export default class RegionSetCommand extends BaseCommand { + const host = resolveAuthHost(ctx); + const headers = buildAuthHeaders(ctx); + + const client = new HttpClient(); + client.baseUrl(host).headers(headers); + + const res = await client.get( + `/v1/feature-status?feature_uid=${encodeURIComponent(featureUid)}`, + ); + + if (res.status < 200 || res.status >= 300) { + throw new Error(`PLAN_CHECK: feature-status API returned ${res.status} for "${featureUid}".`); + } + + return res.data as FeatureStatus; +} + +export async function assertFeatureEnabled(featureUid: string, ctx?: FeatureCtx): Promise { + let status: FeatureStatus; + try { + status = await isFeatureEnabled(featureUid, ctx); + } catch (e) { + throw new Error( + `Could not verify your plan for "${featureUid}". ` + + `This command requires a confirmed plan status to run. ` + + `Please retry; if the problem persists contact support. (${(e as Error).message})`, + ); + } + + if (!status.is_part_of_plan) { + throw new Error( + `"${featureUid}" is not part of your current plan. Please upgrade your plan to use this feature.`, + ); + } + + if (status.status !== 'enabled') { + throw new Error( + `"${featureUid}" is not enabled for your plan (status: ${status.status}).`, + ); + } + + return status; +} diff --git a/packages/contentstack-utilities/src/feature-status/feature-uids.ts b/packages/contentstack-utilities/src/feature-status/feature-uids.ts new file mode 100644 index 0000000000..d333ffb81f --- /dev/null +++ b/packages/contentstack-utilities/src/feature-status/feature-uids.ts @@ -0,0 +1,6 @@ +export const FEATURE = { + ASSET_MANAGEMENT: 'amAssets', + // ASSET_SCANNING: 'asset_scanning', // uncomment when uid confirmed with platform team +} as const; + +export type FeatureUid = typeof FEATURE[keyof typeof FEATURE]; diff --git a/packages/contentstack-utilities/src/feature-status/index.ts b/packages/contentstack-utilities/src/feature-status/index.ts new file mode 100644 index 0000000000..97531ef9a3 --- /dev/null +++ b/packages/contentstack-utilities/src/feature-status/index.ts @@ -0,0 +1,5 @@ +export * from './types'; +export * from './feature-uids'; +export { resolveAuthHost } from './resolve-auth-host'; +export { buildAuthHeaders } from './build-auth-headers'; +export { isFeatureEnabled, assertFeatureEnabled } from './feature-status-handler'; diff --git a/packages/contentstack-utilities/src/feature-status/resolve-auth-host.ts b/packages/contentstack-utilities/src/feature-status/resolve-auth-host.ts new file mode 100644 index 0000000000..a86e4786ee --- /dev/null +++ b/packages/contentstack-utilities/src/feature-status/resolve-auth-host.ts @@ -0,0 +1,13 @@ +import configHandler from '../config-handler'; + +export function resolveAuthHost(ctx?: { region?: { authUrl?: string } }): string { + const region = (ctx?.region ?? configHandler.get('region')) as { authUrl?: string } | undefined; + const authUrl = region?.authUrl; + if (!authUrl) { + throw new Error( + 'PLAN_CHECK: Auth host is not configured for the current region. ' + + "Re-run `csdx config:set:region` to refresh region endpoints.", + ); + } + return String(authUrl).replace(/\/$/, ''); +} diff --git a/packages/contentstack-utilities/src/feature-status/types.ts b/packages/contentstack-utilities/src/feature-status/types.ts new file mode 100644 index 0000000000..136c3fee66 --- /dev/null +++ b/packages/contentstack-utilities/src/feature-status/types.ts @@ -0,0 +1,16 @@ +export interface FeatureStatus { + org_uid: string; + feature_key: string; + status: 'enabled' | 'disabled' | string; + limit: number; + max_limit: number; + is_part_of_plan: boolean; +} + +export interface FeatureCtx { + apiKey?: string; + orgUid?: string; + managementToken?: string; + authToken?: string; + region?: { authUrl?: string; name?: string; cma?: string }; +} diff --git a/packages/contentstack-utilities/src/index.ts b/packages/contentstack-utilities/src/index.ts index a8adeef224..e0cdc38983 100644 --- a/packages/contentstack-utilities/src/index.ts +++ b/packages/contentstack-utilities/src/index.ts @@ -89,4 +89,6 @@ export { ProgressStrategyRegistry, CustomProgressStrategy, DefaultProgressStrategy -} from './progress-summary'; \ No newline at end of file +} from './progress-summary'; + +export * from './feature-status'; \ No newline at end of file diff --git a/packages/contentstack/README.md b/packages/contentstack/README.md index 2e12d2bdc8..6b2efafcfa 100644 --- a/packages/contentstack/README.md +++ b/packages/contentstack/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli/2.0.0-beta.19 darwin-arm64 node-v22.13.1 +@contentstack/cli/2.0.0-beta.25 darwin-arm64 node-v24.18.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -41,25 +41,15 @@ USAGE * [`csdx cm:branches:delete [-uid ] [-k ]`](#csdx-cmbranchesdelete--uid-value--k-value) * [`csdx cm:branches:diff [--base-branch ] [--compare-branch ] [-k ][--module ] [--format ] [--csv-path ]`](#csdx-cmbranchesdiff---base-branch-value---compare-branch-value--k-value--module-value---format-value---csv-path-value) * [`csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]`](#csdx-cmbranchesmerge--k-value--compare-branch-value---no-revert---export-summary-path-value---use-merge-summary-value---comment-value---base-branch-value) -<<<<<<< HEAD -======= * [`csdx cm:branches:merge-status -k --merge-uid `](#csdx-cmbranchesmerge-status--k-value---merge-uid-value) -* [`csdx cm:bulk-publish`](#csdx-cmbulk-publish) -* [`csdx cm:stacks:audit`](#csdx-cmstacksaudit) -* [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix) -* [`csdx cm:stacks:bulk-assets`](#csdx-cmstacksbulk-assets) -* [`csdx cm:stacks:bulk-entries`](#csdx-cmstacksbulk-entries) +* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) +* [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) * [`csdx cm:stacks:clone [--source-branch ] [--target-branch ] [--source-management-token-alias ] [--destination-management-token-alias ] [-n ] [--type a|b] [--source-stack-api-key ] [--destination-stack-api-key ] [--import-webhook-status disable|current]`](#csdx-cmstacksclone---source-branch-value---target-branch-value---source-management-token-alias-value---destination-management-token-alias-value--n-value---type-ab---source-stack-api-key-value---destination-stack-api-key-value---import-webhook-status-disablecurrent) * [`csdx cm:stacks:export [--config ] [--stack-api-key ] [--data-dir ] [--alias ] [--module ] [--content-types ] [--branch ] [--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:import [--config ] [--stack-api-key ] [--data-dir ] [--alias ] [--module ] [--backup-dir ] [--branch ] [--import-webhook-status disable|current]`](#csdx-cmstacksimport---config-value---stack-api-key-value---data-dir-value---alias-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent) * [`csdx cm:stacks:import-setup [-k ] [-d ] [-a ] [--modules ]`](#csdx-cmstacksimport-setup--k-value--d-value--a-value---modules-valuevalue) * [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) -* [`csdx cm:stacks:publish`](#csdx-cmstackspublish) -* [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs) -* [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure) -* [`csdx cm:stacks:publish-revert`](#csdx-cmstackspublish-revert) -* [`csdx cm:stacks:seed [--repo ] [--org ] [-k ] [-n ] [-y ] [-s ] [--locale ]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value---locale-value) -* [`csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]`](#csdx-csdx-cmstacksunpublish--a-value--e-value--c-value--y---locale-value---branch-value---retry-failed-value---bulk-unpublish-value---content-type-value---delivery-token-value---only-assets---only-entries) +* [`csdx cm:stacks:seed [--repo ] [--org ] [--stack-api-key ] [--stack-name ] [-y] [--alias ] [--locale ]`](#csdx-cmstacksseed---repo-value---org-value---stack-api-key-value---stack-name-value--y---alias-value---locale-value) * [`csdx config:get:base-branch`](#csdx-configgetbase-branch) * [`csdx config:get:ea-header`](#csdx-configgetea-header) * [`csdx config:get:early-access-header`](#csdx-configgetearly-access-header) @@ -86,6 +76,7 @@ USAGE * [`csdx launch:functions`](#csdx-launchfunctions) * [`csdx launch:logs`](#csdx-launchlogs) * [`csdx launch:open`](#csdx-launchopen) +* [`csdx launch:rollback`](#csdx-launchrollback) * [`csdx login`](#csdx-login) * [`csdx logout`](#csdx-logout) * [`csdx plugins`](#csdx-plugins) @@ -432,1632 +423,94 @@ EXAMPLES $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" - $ csdx cm:branches:diff --compare-branch "develop" - - $ csdx cm:branches:diff --compare-branch "develop" --stack-api-key "bltxxxxxxxx" - - $ csdx cm:branches:diff --compare-branch "develop" --module "content-types" - - $ csdx cm:branches:diff --module "content-types" --format "detailed-text" - - $ csdx cm:branches:diff --compare-branch "develop" --format "detailed-text" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" --compare-branch "develop" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" --module "content-types" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" --compare-branch "develop" --module "content-types" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" --compare-branch "develop" --module "content-types" --format "detailed-text" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" --compare-branch "develop" --module "content-types" --format "compact-text" - - $ csdx cm:branches:diff --stack-api-key "bltxxxxxxxx" --base-branch "main" --compare-branch "develop" --module "content-types" --format "detailed-text" --csv-path "./reports/diff-report.csv" -``` - -_See code: [@contentstack/cli-cm-branches](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/branches/diff.ts)_ - -## `csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] [--use-merge-summary ] [--comment ] [--base-branch ]` - -Merge changes from a branch - -``` -USAGE - $ csdx cm:branches:merge [-k ][--compare-branch ] [--no-revert] [--export-summary-path ] - [--use-merge-summary ] [--comment ] [--base-branch ] - -FLAGS - -k, --stack-api-key= [optional] Provide stack API key to show the difference between the branches. - --base-branch= [optional] Base branch (Target branch). - --comment= [optional] Pass a comment. - --compare-branch= [optional] Compare branch (Source branch). - --export-summary-path= [optional] Export summary file path. - --no-revert [optional] If passed, will not create the new revert branch. - --use-merge-summary= [optional] Path of merge summary file. - -DESCRIPTION - Merge changes from a branch - -EXAMPLES - $ csdx cm:branches:merge --stack-api-key bltxxxxxxxx --compare-branch feature-branch - - $ csdx cm:branches:merge --stack-api-key bltxxxxxxxx --comment "merge comment" - - $ csdx cm:branches:merge -k bltxxxxxxxx --base-branch base-branch - - $ csdx cm:branches:merge --export-summary-path file/path - - $ csdx cm:branches:merge --use-merge-summary file-path - - $ csdx cm:branches:merge -k bltxxxxxxxx --no-revert - - $ csdx cm:branches:merge -k bltxxxxxxxx --compare-branch feature-branch --no-revert -``` - -_See code: [@contentstack/cli-cm-branches](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/branches/merge.ts)_ - -<<<<<<< HEAD -======= -## `csdx cm:branches:merge-status -k --merge-uid ` - -Check the status of a branch merge job - -``` -USAGE - $ csdx cm:branches:merge-status -k --merge-uid - -FLAGS - -k, --stack-api-key= (required) Provide your stack API key. - --merge-uid= (required) Merge job UID to check status for. - -DESCRIPTION - Check the status of a branch merge job - -EXAMPLES - $ csdx cm:branches:merge-status -k bltxxxxxxxx --merge-uid merge_abc123 - - $ csdx cm:branches:merge-status --stack-api-key bltxxxxxxxx --merge-uid merge_abc123 -``` - -_See code: [@contentstack/cli-cm-branches](https://github.com/contentstack/cli/blob/main/packages/contentstack-export/src/commands/cm/branches/merge-status.ts)_ - -## `csdx cm:bulk-publish` - -Bulk Publish script for managing entries and assets - -``` -USAGE - $ csdx cm:bulk-publish - -DESCRIPTION - Bulk Publish script for managing entries and assets -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/index.js)_ - -## `csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]` - -Add fields from updated content types to their respective entries - -``` -USAGE - $ csdx cm:bulk-publish:add-fields cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] - [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -t, --contentTypes=... The Contenttypes from which entries will be published. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type ID whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --force Update and publish all entries even if no fields have been added. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Add fields from updated content types to their respective entries - The update-and-publish command is used to update existing entries with the updated schema of the respective content - type - - Note: Content types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:add-fields - -EXAMPLES - General Usage - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:update-and-publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:update-and-publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:update-and-publish --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] -``` - -## `csdx cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] [--source-env ]` - -Publish assets to the specified environments - -``` -USAGE - $ csdx cm:bulk-publish:assets cm:assets:publish [-a ] [--retry-failed ] [-e ] [--folder-uid ] - [--bulk-publish ] [-c ] [-y] [--locales ] [--branch ] [--delivery-token ] - [--source-env ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the assets from the - main branch will be published. - -a, --alias= Alias (name) for the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which assets will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --delivery-token= The delivery token of the source environment. - --folder-uid= (optional) The UID of the Assets’ folder from which the assets need to be published. - The default value is cs_root. - --retry-failed= Use this option to retry publishing the failed assets from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish assets to the specified environments - The assets command is used to publish assets from the specified stack, to the specified environments - - Note: Environment(s) and Locale(s) are required to execute the command successfully - But, if retryFailed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:assets - -EXAMPLES - General Usage - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:assets:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:assets:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:assets:publish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key flag - - $ csdx cm:assets:publish --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE] --stack-api-key [STACK API KEY] -``` - -## `csdx cm:bulk-publish:clear` - -Clear the log folder - -``` -USAGE - $ csdx cm:bulk-publish:clear [--log-files-count] [-y] - -FLAGS - -y, --yes Delete all files without asking for confirmation - --log-files-count List number of log files - -DESCRIPTION - Clear the log folder - -ALIASES - $ csdx cm:bulk-publish:clear - -EXAMPLES - $ csdx cm:stacks:publish-clear-logs - - $ csdx cm:stacks:publish-clear-logs --log-files-count - - $ csdx cm:stacks:publish-clear-logs --yes - - $ csdx cm:stacks:publish-clear-logs -y -``` - -## `csdx cm:bulk-publish:configure` - -The configure command is used to generate a configuration file for publish scripts. - -``` -USAGE - $ csdx cm:bulk-publish:configure [-a ] [-k ] - -FLAGS - -a, --alias= Name (alias) of the management token you want to use. You must use either the --alias - flag or the --stack-api-key flag. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -DESCRIPTION - The configure command is used to generate a configuration file for publish scripts. - -ALIASES - $ csdx cm:bulk-publish:configure - -EXAMPLES - $ csdx cm:stacks:publish-configure - - $ csdx cm:stacks:publish-configure -a - - $ csdx cm:stacks:publish-configure --alias - - $ csdx cm:stacks:publish-configure --stack-api-key -``` - -## `csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] [--branch ] [--onlyAssets] [--onlyEntries] [--include-variants]` - -Publish entries and assets from one environment to other environments - -``` -USAGE - $ csdx cm:bulk-publish:cross-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-type ] - [--locales ] [--source-env ] [--environments ] [--delivery-token ] [-c ] [-y] - [--branch ] [--onlyAssets] [--onlyEntries] [--include-variants] - -FLAGS - -B, --branch= [default: main] Specify the branch to fetch the content (by default the main branch is - selected) - -a, --alias= Alias(name) for the management token - -c, --config= Path to the config file - -k, --stack-api-key= Stack API key to be used - -y, --yes Agree to process the command with the current configuration - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-type=... The Contenttypes from which entries will be published - --delivery-token= The delivery token of the source environment. - --environments=... Destination Environments - --include-variants Include Variants flag will publish all associated variant entries. - --locales= Source locale - --onlyAssets Unpublish only assets - --onlyEntries Unpublish only entries - --retry-failed= (optional) Retry publishing failed entries from the logfile (this flag overrides all - other flags) - --source-env= Source Env - -DESCRIPTION - Publish entries and assets from one environment to other environments - The cross-publish command is used to publish entries and assets from one environment to other environments - - Note: Content Type, Environment, Destination Environment(s) and Locale are required to execute the command - successfully - But, if retryFailed flag is set, then only a logfile is required - - -EXAMPLES - General Usage - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] -a [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:bulk-publish:cross-publish --config [PATH TO CONFIG FILE] - - $ csdx cm:bulk-publish:cross-publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:bulk-publish:cross-publish --retry-failed [LOG FILE NAME] - - $ csdx cm:bulk-publish:cross-publish -r [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] -a [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants flag - - $ csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] [--include-variants] -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/cross-publish.js)_ - -## `csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants]` - -Publish entries from multiple contenttypes to multiple environments and locales - -``` -USAGE - $ csdx cm:bulk-publish:entries cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] - [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch - ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. This flag is - set to true, by default. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify the IDs separated by spaces. - --delivery-token= The delivery token of the source environment. - --entry-uid= Entry Uid for publish all associated variant entries. - --include-variants Include Variants flag will publish all associated variant entries with base entry. - --publish-all-content-types (optional) Set it to true to bulk publish entries from all content types. If the - --content-types option is already used, then you cannot use this option. - --retry-failed= (optional) Use this option to retry publishing the failed entries/ assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish entries from multiple contenttypes to multiple environments and locales - The publish command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content Types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key - - $ csdx cm:entries:publish -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] [--include-variants] - - - - Using --entry-uid and --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] --entry-uid [ENTRY UID] [--include-variants] -``` - -## `csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish edited entries from a specified content type to the given locales and environments - -``` -USAGE - $ csdx cm:bulk-publish:entry-edits cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] - [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch - ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment(s) on which the entries will be published. In case of - multiple environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type(s) whose edited entries you want to publish in bulk. In - case of multiple content types, specify the IDs separated by spaces. - --retry-failed= (optional) Use this option to retry publishing the failed entries/assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish edited entries from a specified content type to the given locales and environments - The publish-modified command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Locale(s) are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entry-edits - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish-modified --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-modified -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-modified --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish-modified -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY] -``` - -## `csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]` - -Publish non-localized fields for the given content types, from a particular source environment to the specified environments - -``` -USAGE - $ csdx cm:bulk-publish:nonlocalized-field-changes cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] - [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch - ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= The name of the source environment. - -DESCRIPTION - Publish non-localized fields for the given content types, from a particular source environment to the specified - environments - The non-localized field changes command is used to publish non-localized field changes from the given content types to - the specified environments - - Note: Content types, Environments and Source Environment are required to execute this command successfully. - But, if retryFailed flag is set, then only a logfile is required - -ALIASES - $ csdx cm:bulk-publish:nonlocalized-field-changes - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-non-localized-fields --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-non-localized-fields -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:entries:publish-non-localized-fields --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV] -``` - -## `csdx cm:bulk-publish:revert` - -Revert publish operations by using a log file - -``` -USAGE - $ csdx cm:bulk-publish:revert [--retry-failed ] [--log-file ] - -FLAGS - --log-file= Path of the success logfile of a particular publish action. - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. Specify - the name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Revert publish operations by using a log file - The revert command is used to revert all publish operations performed using bulk-publish script. - A log file name is required to execute revert command - - -ALIASES - $ csdx cm:bulk-publish:revert - -EXAMPLES - Using --log-file - - cm:bulk-publish:revert --log-file [LOG FILE NAME] - - - - Using --retry-failed - - cm:bulk-publish:revert --retry-failed [LOG FILE NAME] -``` - -## `csdx csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token ] [--only-assets] [--only-entries]` - -Unpublish entries or assets of given content types from the specified environment - -``` -USAGE - $ csdx cm:bulk-publish:unpublish csdx cm:stacks:unpublish [-a ] [-e ] [-c ] [-y] [--locale ] - [--branch ] [--retry-failed ] [--bulk-unpublish ] [--content-type ] [--delivery-token - ] [--only-assets] [--only-entries] - -FLAGS - -B, --branch= [default: main] Specify the branch to fetch the content from (default is main branch) - -a, --alias= Alias(name) for the management token - -c, --config= Path to the config file - -e, --environment= Source Environment - -k, --stack-api-key= Stack API key to be used - -l, --locale= Locale filter - -y, --yes Agree to process the command with the current configuration - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-unpublish= [default: true] This flag is set to true by default. It indicates that contentstack's - bulkpublish API will be used to unpublish the entries and assets - --content-type= Content type filter - --delivery-token= The delivery token of the source environment. - --retry-failed= Retry publishing failed entries from the logfile (optional, overrides all other flags) - -DESCRIPTION - Unpublish entries or assets of given content types from the specified environment - The unpublish command is used to unpublish entries or assets from given environment - - Environment (Source Environment) and Locale are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - A content type can be specified for unpublishing entries, but if no content-type(s) is/are specified and --only-assets - is not used, - then all entries from all content types will be unpublished from the source environment - - Note: --only-assets can be used to unpublish only assets and --only-entries can be used to unpublish only entries. - (--only-assets and --only-entries cannot be used together at the same time) - - -ALIASES - $ csdx cm:bulk-publish:unpublish - -EXAMPLES - General Usage - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] ----delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure --alias [ALIAS]` - - $ csdx cm:stacks:unpublish --config [PATH TO CONFIG FILE] - - $ csdx cm:stacks:unpublish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:stacks:unpublish --retry-failed [LOG FILE NAME] - - - - No content type - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] (Will unpublish all entries from all content types and assets from the source environment) - - - - Using --only-assets - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] --only-assets (Will unpublish only assets from the source environment) - - - - Using --only-entries - - $ csdx cm:stacks:unpublish --environment [SOURCE ENV] --locale [LOCALE] --only-entries (Will unpublish only entries, all entries, from the source environment) - - $ csdx cm:stacks:unpublish --contentType [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --only-entries (Will unpublish only entries, (from CONTENT TYPE) from the source environment) - - - - Using --branch flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] -``` - -## `csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish unpublished entries from the source environment, to other environments and locales - -``` -USAGE - $ csdx cm:bulk-publish:unpublished-entries cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish - ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] - [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -b, --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --locales= Locale in which entries will be published, e.g., en-us - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. It - is optional. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish unpublished entries from the source environment, to other environments and locales - The publish-only-unpublished command is used to publish unpublished entries from the source environment, to other - environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Source Locale are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:unpublished-entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] -source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-only-unpublished --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-only-unpublished -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-only-unpublished --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV] -``` - -## `csdx cm:entries:migrate-html-rte` - -Migration script to migrate content from HTML RTE to JSON RTE - -``` -USAGE - $ csdx cm:entries:migrate-html-rte [-c ] [-a ] [--stack-api-key ] [--content-type ] - [--global-field] [-y] [--branch ] [--html-path --json-path ] [--delay ] [--locale - ] [--batch-limit ] - -FLAGS - -a, --alias= Enter the alias name. You must use either the --alias flag or the --stack-api-key flag. - -c, --config-path= Specify the path where your config file is located. - -y, --yes Avoids reconfirmation of your configuration. - --batch-limit= [default: 50] Provide batch limit for updating entries (default: 50). - --branch= The name of the branch to be used. - --content-type= Specify the UID of the content type for which you want to migrate HTML RTE content. - --delay= [default: 1000] To set the interval time between the migration of HTML RTE to JSON RTE in - subsequent entries of a content type. The default value is 1,000 milliseconds. - --global-field Checks whether the specified UID belongs to a content type or a global field. This flag - is set to false by default. - --html-path= Enter the path to the HTML RTE whose content you want to migrate. - --json-path= Enter the path to the JSON RTE to which you want to migrate the HTML RTE content. - --locale= The locale from which entries will be migrated. - --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -DESCRIPTION - Migration script to migrate content from HTML RTE to JSON RTE - -ALIASES - $ csdx cm:migrate-rte - -EXAMPLES - General Usage - - $ csdx cm:entries:migrate-html-rte --config-path path/to/config.json - - - - Using Flags - - $ csdx cm:entries:migrate-html-rte --alias alias --content-type content_type_uid --html-path html-path --json-path json-path - - - - Nested RTE - - $ csdx cm:entries:migrate-html-rte --alias alias --content-type content_type_uid --html-path modular_block_uid.block_uid.html_rte_uid --json-path modular_block_uid.block_uid.json_rte_uid - - - - $ csdx cm:entries:migrate-html-rte --alias alias --content-type content_type_uid --html-path group_uid.html_rte_uid --json-path group_uid.json_rte_uid - - - - Global Field - - $ csdx cm:entries:migrate-html-rte --alias alias --content-type global_field_uid --global-field --html-path html-path --json-path json-path -``` - -_See code: [@contentstack/cli-cm-migrate-rte](https://github.com/contentstack/cli/blob/main/packages/contentstack-migrate-rte/src/commands/cm/entries/migrate-html-rte.js)_ - -## `csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token ] [--source-env ] [--entry-uid ] [--include-variants]` - -Publish entries from multiple contenttypes to multiple environments and locales - -``` -USAGE - $ csdx cm:entries:publish [-a ] [--retry-failed ] [--bulk-publish ] [--publish-all-content-types] - [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] [--delivery-token - ] [--source-env ] [--entry-uid ] [--include-variants] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. This flag is - set to true, by default. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify the IDs separated by spaces. - --delivery-token= The delivery token of the source environment. - --entry-uid= Entry Uid for publish all associated variant entries. - --include-variants Include Variants flag will publish all associated variant entries with base entry. - --publish-all-content-types (optional) Set it to true to bulk publish entries from all content types. If the - --content-types option is already used, then you cannot use this option. - --retry-failed= (optional) Use this option to retry publishing the failed entries/ assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= Source environment - -DESCRIPTION - Publish entries from multiple contenttypes to multiple environments and locales - The publish command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content Types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --source-env - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --stack-api-key - - $ csdx cm:entries:publish -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] [--include-variants] - - - - Using --entry-uid and --include-variants - - $ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN] --entry-uid [ENTRY UID] [--include-variants] -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish.js)_ - -## `csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish edited entries from a specified content type to the given locales and environments - -``` -USAGE - $ csdx cm:entries:publish-modified [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] - [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment(s) on which the entries will be published. In case of - multiple environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type(s) whose edited entries you want to publish in bulk. In - case of multiple content types, specify the IDs separated by spaces. - --retry-failed= (optional) Use this option to retry publishing the failed entries/assets from the - logfile. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish edited entries from a specified content type to the given locales and environments - The publish-modified command is used to publish entries from the specified content types, to the - specified environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Locale(s) are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:entry-edits - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:publish-modified --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-modified -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-modified --retry-failed [LOG FILE NAME] - - $ csdx cm:entries:publish-modified -r [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY] -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-modified.js)_ - -## `csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [-e ] [-c ] [-y] [--branch ]` - -Publish non-localized fields for the given content types, from a particular source environment to the specified environments - -``` -USAGE - $ csdx cm:entries:publish-non-localized-fields [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] - [--content-types ] [-e ] [-c ] [-y] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - --source-env= The name of the source environment. - -DESCRIPTION - Publish non-localized fields for the given content types, from a particular source environment to the specified - environments - The non-localized field changes command is used to publish non-localized field changes from the given content types to - the specified environments - - Note: Content types, Environments and Source Environment are required to execute this command successfully. - But, if retryFailed flag is set, then only a logfile is required - -ALIASES - $ csdx cm:bulk-publish:nonlocalized-field-changes - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-non-localized-fields --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-non-localized-fields -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:entries:publish-non-localized-fields --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV] -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-non-localized-fields.js)_ - -## `csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ]` - -Publish unpublished entries from the source environment, to other environments and locales - -``` -USAGE - $ csdx cm:entries:publish-only-unpublished [-a ] [--retry-failed ] [--bulk-publish ] [--source-env ] - [--content-types ] [--locales ] [-e ] [-c ] [-y] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don't mention the branch name, then by default the entries from main - branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -b, --bulk-publish= [default: true] Set this flag to use Contentstack's Bulk Publish APIs. It is true, by - default. - -c, --config= (optional) The path of the optional configuration JSON file containing all the - options for a single run. Refer to the configure command to create a configuration - file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].. - --content-types=... The UID of the content type(s) whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --locales= Locale in which entries will be published, e.g., en-us - --retry-failed= (optional) Use this option to retry publishing the failed entries from the logfile. It - is optional. Specify the name of the logfile that lists failed publish calls. If this - option is used, it will override all other flags. - --source-env= The name of the source environment where the entries were initially published. - -DESCRIPTION - Publish unpublished entries from the source environment, to other environments and locales - The publish-only-unpublished command is used to publish unpublished entries from the source environment, to other - environments and locales - - Note: Content type(s), Source Environment, Destination Environment(s) and Source Locale are required to execute the - command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:unpublished-entries - -EXAMPLES - General Usage - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] -source-env [SOURCE ENV] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]` - - $ csdx cm:entries:publish-only-unpublished --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:publish-only-unpublished -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:publish-only-unpublished --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV] - - - - Using --stack-api-key - - $ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV] -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-only-unpublished.js)_ - -## `csdx cm:entries:unpublish` - -Unpublish entries from the given environment - -``` -USAGE - $ csdx cm:entries:unpublish [-a ] [-k ] [-e ] [-c ] [-y] [--locale ] [--branch - ] [--retry-failed ] [--bulk-unpublish ] [--api-version ] [--content-type ] - [--delivery-token ] [--include-variants] - -FLAGS - -a, --alias= Alias (name) for the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) Path to the configuration JSON file containing all options for a single run. - Refer to the configure command to create a configuration file. - -e, --environment= The name of the environment from where entries/assets need to be unpublished. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the --alias - flag. - -y, --yes Set to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --branch= [default: main] Specify the branch to fetch the content. If not mentioned, the main - branch will be used by default. - --bulk-unpublish= [default: true] This flag is set to true by default. It indicates that Contentstack's - Bulk Publish APIs will be used to unpublish the entries. - --content-type= The UID of the content type whose entries you want to unpublish in bulk. - --delivery-token= The delivery token of the source environment. - --include-variants Include Variants flag will unpublish all associated variant entries. - --locale= Locale from which entries/assets will be unpublished, e.g., en-us. - --retry-failed= (optional) Use this option to retry unpublishing the failed entries from the logfile. - Specify the name of the logfile that lists failed unpublish calls. If used, this option - will override all other flags. - -DESCRIPTION - Unpublish entries from the given environment - The unpublish command is used to unpublish entries from the given environment - - Note: Environment (Source Environment) and Locale are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - -EXAMPLES - General Usage - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:bulk-publish:configure --alias [ALIAS]` - - $ csdx cm:stacks:unpublish --config [PATH TO CONFIG FILE] - - $ csdx cm:stacks:unpublish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed flag - - $ csdx cm:stacks:unpublish --retry-failed [LOG FILE NAME] - - - - Using --branch flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME] - - - - Using --stack-api-key flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] - - - - Using --include-variants flag - - $ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN] --include-variants -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/unpublish.js)_ - -## `csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t ] [-e ] [-c ] [-y] [--locales ] [--branch ]` - -Add fields from updated content types to their respective entries - -``` -USAGE - $ csdx cm:entries:update-and-publish [-a ] [--retry-failed ] [--bulk-publish ] [--content-types ] [-t - ] [-e ] [-c ] [-y] [--locales ] [--branch ] - -FLAGS - -B, --branch= [default: main] The name of the branch where you want to perform the bulk publish - operation. If you don’t mention the branch name, then by default the content from the - main branch will be published. - -a, --alias= Alias (name) of the management token. You must use either the --alias flag or the - --stack-api-key flag. - -c, --config= (optional) The path of the optional configuration JSON file containing all the options - for a single run. Refer to the configure command to create a configuration file. - -e, --environments=... The name of the environment on which entries will be published. In case of multiple - environments, specify their names separated by spaces. - -k, --stack-api-key= API key of the source stack. You must use either the --stack-api-key flag or the - --alias flag. - -l, --locales=... Locales in which entries will be published, e.g., en-us. In the case of multiple - locales, specify the codes separated by spaces. - -t, --contentTypes=... The Contenttypes from which entries will be published. - -y, --yes Set it to true to process the command with the current configuration. - --api-version= API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2]. - --bulk-publish= [default: true] Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by - default. - --content-types=... The UID of the content type ID whose entries you want to publish in bulk. In case of - multiple content types, specify their IDs separated by spaces. - --force Update and publish all entries even if no fields have been added. - --retry-failed= Use this option to retry publishing the failed entries from the logfile. Specify the - name of the logfile that lists failed publish calls. If this option is used, it will - override all other flags. - -DESCRIPTION - Add fields from updated content types to their respective entries - The update-and-publish command is used to update existing entries with the updated schema of the respective content - type - - Note: Content types, Environments and Locales are required to execute the command successfully - But, if retry-failed flag is set, then only a logfile is required - - -ALIASES - $ csdx cm:bulk-publish:add-fields - -EXAMPLES - General Usage - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] - - - - Using --config or -c flag - - Generate a config file at the current working directory using `csdx cm:stacks:publish-configure -a [ALIAS]` - - $ csdx cm:entries:update-and-publish --config [PATH TO CONFIG FILE] - - $ csdx cm:entries:update-and-publish -c [PATH TO CONFIG FILE] - - - - Using --retry-failed - - $ csdx cm:entries:update-and-publish --retry-failed [LOG FILE NAME] - - - - Using --branch - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] - - - - Using --stack-api-key - - $ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] -``` - -_See code: [@contentstack/cli-cm-bulk-publish](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/update-and-publish.js)_ - -## `csdx cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] [--content-types ] [--branch ] [--secured-assets]` - -Export content from a stack - -``` -USAGE - $ csdx cm:export cm:stacks:export [-c ] [-k ] [-d ] [-a ] [--module ] - [--content-types ] [--branch ] [--secured-assets] - -FLAGS - -B, --branch= [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= The management token alias of the source stack from which you will export content. - -c, --config= [optional] Path of the config - -d, --data-dir= The path or the location in your file system to store the exported content. For e.g., - ./content - -k, --stack-api-key= API Key of the source stack - -m, --module= [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, taxonomies, and studio. - -t, --content-types=... [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= (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 --data-dir - - $ csdx cm:stacks:export --config - - $ csdx cm:stacks:export --alias - - $ csdx cm:stacks:export --alias --data-dir - - $ csdx cm:stacks:export --alias --config - - $ csdx cm:stacks:export --module - - $ csdx cm:stacks:export --branch [optional] branch name -``` - ->>>>>>> development -## `csdx cm:export-to-csv` - -Export entries, taxonomies, terms or organization users to csv using this command - -``` -USAGE - $ csdx cm:export-to-csv [--action entries|users|teams|taxonomies] [-a ] [--org ] [-n ] [-k - ] [--org-name ] [--locale ] [--content-type ] [--branch ] [--team-uid ] - [--taxonomy-uid ] [--include-fallback] [--fallback-locale ] [--delimiter ] - -FLAGS - -a, --alias= Alias of the management token. - -k, --stack-api-key= API Key of the source stack. - -n, --stack-name= Name of the stack that needs to be created as CSV filename. - --action=