Migrating from @contentstack/cli-cm-bulk-publish (v1.x) to New Unified Commands @contentstack/cli-bulk-operations (v1.x)
We've consolidated 15 separate commands into 2 simple commands with flags:
Before (v1.x):
- ❌
cm:entries:publish - ❌
cm:entries:publish-modified - ❌
cm:entries:publish-only-unpublished - ❌
cm:entries:unpublish - ❌
cm:assets:publish - ❌
cm:assets:unpublish - ❌
cm:stacks:unpublish - ❌
cm:bulk-publish:cross-publish - ❌ And 7 more commands...
After (v2.0):
csdx cm:stacks:bulk-entries(for all entry operations)csdx cm:stacks:bulk-assets(for all asset operations)
# OLD csdx cm:entries:publish --content-types blog --environments prod --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-entries --operation publish --content-types blog --environments prod --locales en-us -k blt123
What changed:
- Command renamed from
cm:entries:publishtocm:stacks:bulk-entries - Added required
--operation publishflag
# OLD csdx cm:entries:publish-modified --content-types blog --source-env staging --environments prod --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-entries --operation publish --filter modified --content-types blog --source-env staging --environments prod --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-entries - Added
--filter modifiedflag instead of separate command
# OLD csdx cm:entries:publish-only-unpublished --content-types blog --environments prod --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-entries --operation publish --filter unpublished --content-types blog --environments prod --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-entries - Added
--filter unpublishedflag
# OLD csdx cm:entries:publish-non-localized-fields --content-types blog --source-env staging --environments prod -k blt123 # NEW csdx cm:stacks:bulk-entries --operation publish --filter non-localized --content-types blog --source-env staging --environments prod --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-entries - Added
--filter non-localizedflag --localesflag is now required
# OLD csdx cm:entries:unpublish --content-types blog --environments staging --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-entries --operation unpublish --content-types blog --environments staging --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-entries - Added
--operation unpublishflag
# OLD csdx cm:assets:publish --environments prod --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-assets --operation publish --environments prod --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-assets - Added
--operation publishflag
# OLD csdx cm:assets:publish --folder-uid images_folder --environments prod --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-assets --operation publish --folder-uid images_folder --environments prod --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-assets - Added
--operation publishflag --folder-uidflag remains the same
# OLD csdx cm:assets:unpublish --environments staging --locales en-us -k blt123 # NEW csdx cm:stacks:bulk-assets --operation unpublish --environments staging --locales en-us -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-assets - Added
--operation unpublishflag
# OLD csdx cm:bulk-publish:cross-publish --source-env staging --environments prod --locales en-us -k blt123 --delivery-token blt*** # NEW - Step 1: Add delivery token as alias csdx auth:tokens:add \ -a staging-delivery \ --delivery-token blt*** \ --api-key blt123 \ --environment staging \ --type delivery # NEW - Step 2: Use the alias for cross-publish csdx cm:stacks:bulk-entries \ --operation publish \ --source-env staging \ --source-alias staging-delivery \ --content-types blog article \ --environments prod \ --locales en-us \ -k blt123
What changed:
- Command renamed to
cm:stacks:bulk-entries - Delivery token must be stored as an alias first
- Added
--source-aliasflag (required for cross-publish) --delivery-tokenflag no longer supported inline
# OLD csdx cm:stacks:unpublish --environments staging --locales en-us -k blt123 # NEW - Run two commands: # 1. Unpublish entries csdx cm:stacks:bulk-entries --operation unpublish --content-types blog,article,page --environments staging --locales en-us -k blt123 # 2. Unpublish assets csdx cm:stacks:bulk-assets --operation unpublish --environments staging --locales en-us -k blt123
What changed:
- Split into two explicit commands for better control
- Must specify content types for entries
The following features from v1.x are NOT available in v2.0:
# ❌ NOT AVAILABLE
csdx cm:stacks:publishImpact: You must use explicit commands instead of an interactive selection menu.
Workaround: Use the explicit bulk-entries or bulk-assets commands directly.
# ❌ NOT AVAILABLE
csdx cm:stacks:publish-configure
csdx cm:bulk-publish:configureImpact: No command to generate configuration files interactively.
Workaround: Create config.json files manually (see Config File Support above).
# ❌ NOT AVAILABLE
csdx cm:stacks:publish-clear-logs
csdx cm:bulk-publish:clearImpact: No CLI command to clear log files.
Workaround: Use OS commands:
# Unix/Linux/Mac rm -rf ./bulk-operation/* # Windows del /q bulk-operation\*
# ❌ NOT AVAILABLE
--publish-all-content-typesImpact: If content-types flag isn't provided then it will automatically fetch all content types.
csdx cm:stacks:bulk-entries --operation publish --environments prod --locales en-us -k blt123
# ❌ NOT AVAILABLE --delivery-token blt***
Impact: Cannot pass delivery token directly for cross-publish.
Workaround: Store delivery token as an alias first:
# Step 1: Add delivery token csdx auth:tokens:add -a prod-delivery --delivery-token blt*** --api-key blt123 --environment production --type delivery # Step 2: Use the alias csdx cm:stacks:bulk-entries --operation publish --source-env production --source-alias prod-delivery --environments staging --locales en-us -k blt123
Look at your existing scripts/CI-CD pipelines and identify which old commands you're using.
Example: csdx cm:entries:publish-modified
For cm:entries:publish-modified, the new command is:
csdx cm:stacks:bulk-entries --operation publish --filter modified
If you use cross-publish with delivery tokens, store them as aliases:
# Old way (not supported) csdx cm:bulk-publish:cross-publish --delivery-token blt*** ... # New way - Step 1: Store token csdx auth:tokens:add \ -a staging-delivery \ --delivery-token blt*** \ --api-key blt123 \ --environment staging \ --type delivery # New way - Step 2: Use alias csdx cm:stacks:bulk-entries --operation publish --source-env staging --source-alias staging-delivery ...
Replace the old command with the new one:
# Before csdx cm:entries:publish-modified --content-types blog --source-env staging --environments prod --locales en-us -k $API_KEY # After csdx cm:stacks:bulk-entries --operation publish --filter modified --content-types blog --source-env staging --environments prod --locales en-us -k $API_KEY
Run the command in a test environment first:
# Test with staging environment csdx cm:stacks:bulk-entries --operation publish --filter modified --content-types blog --environments staging --locales en-us -k $API_KEY
Find and replace all instances across your:
- CI/CD pipelines (GitHub Actions, Jenkins, etc.)
- Deployment scripts
- Documentation
- Team runbooks
Old behavior:
csdx cm:entries:publish --content-types blog --environments prod --locales en-us -k blt123
# Command name implies the operationNew behavior:
csdx cm:stacks:bulk-entries --operation publish --content-types blog --environments prod --locales en-us -k blt123
# Must explicitly specify --operation flagOld behavior:
csdx cm:stacks:unpublish --environments staging --locales en-us -k blt123
# Unpublishes both entries and assets in one commandNew behavior:
# Must run two separate commands for full control
csdx cm:stacks:bulk-entries --operation unpublish --content-types blog article --environments staging --locales en-us -k blt123
csdx cm:stacks:bulk-assets --operation unpublish --environments staging --locales en-us -k blt123Benefits:
- Better control over what gets unpublished
- Clearer logging and error handling
- Can unpublish entries and assets independently
Old behavior:
csdx cm:entries:publish --publish-all-content-types --environments prod --locales en-us -k blt123
# Flag to publish all content typesNew behavior:
csdx cm:stacks:bulk-entries --operation publish --environments prod --locales en-us -k blt123
Old behavior:
csdx cm:bulk-publish:cross-publish --delivery-token blt*** --source-env prod --environments staging --locales en-us -k blt123 # Pass delivery token directly
New behavior:
# Step 1: Store delivery token csdx auth:tokens:add -a prod-delivery --delivery-token blt*** --api-key blt123 --environment production --type delivery # Step 2: Use the alias csdx cm:stacks:bulk-entries --operation publish --source-env production --source-alias prod-delivery --content-types blog --environments staging --locales en-us -k blt123
Why?
- More secure (tokens not in command history)
- Tokens can be reused across commands
- Better token management
Old behavior:
# Different commands for different filters
csdx cm:entries:publish-modified ...
csdx cm:entries:publish-only-unpublished ...
csdx cm:entries:publish-non-localized-fields ...New behavior:
# One command with --filter flag
csdx cm:stacks:bulk-entries --operation publish --filter modified ...
csdx cm:stacks:bulk-entries --operation publish --filter unpublished ...
csdx cm:stacks:bulk-entries --operation publish --filter non-localized ...Old behavior:
# Comma-separated values
--environments dev,staging,prod
--locales en-us,es-es,fr-frNew behavior:
# Space-separated values
--environments dev staging prod
--locales en-us es-es fr-frKey Takeaways:
- Two commands replace 15 old commands:
cm:stacks:bulk-entriesandcm:stacks:bulk-assets - Operation flag is required: Always specify
--operation publishor--operation unpublish - Filters replace separate commands: Use
--filterfor modified, unpublished, draft, non-localized - Delivery tokens must be stored as aliases: Use
auth:tokens:addbefore cross-publish - Content types must be explicit: No more
--publish-all-content-types - Config files recommended for complex operations: Use JSON files with
--configflag - New features:
--publish-mode,--revert,--include-variants,--api-version
Migration is straightforward:
- Replace old command names with new ones
- Add
--operationflag - Use
--filterinstead of separate commands - Store delivery tokens as aliases for cross-publish
- Test in lower environments first
Need Help?
- Check official documentation
- Contact Contentstack Support