Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
172ab6a
Merge pull request #193 from contentstack/development
harshitha-cstk Jun 1, 2026
2123937
Update release-production-plugins.yml
harshitha-cstk Jun 1, 2026
903418f
Merge pull request #203 from contentstack/fix/release-workflow
harshitha-cstk Jun 1, 2026
205b344
Merge pull request #205 from contentstack/main
harshitha-cstk Jun 1, 2026
6744e15
Fixed issue for import skipping webhooks more than 5
netrajpatel Jun 9, 2026
baaca81
Merge branch 'development' into fix/dx-8777
netrajpatel Jun 10, 2026
96ac7b6
Update README.md
dhaval-jain-cstk Jun 10, 2026
6fec30c
Merge pull request #216 from contentstack/fix/dx-8777
netrajpatel Jun 10, 2026
7d020d2
Introduced a new plugin - contentstack/cli-external-migrate
netrajpatel Jun 10, 2026
c97dbe3
Add publishing step for external-migrate plugin in production workflow
Jun 10, 2026
ff72d50
updated lockfile
netrajpatel Jun 10, 2026
6f5e671
updated command name
netrajpatel Jun 10, 2026
c1d23df
Updated command
netrajpatel Jun 10, 2026
47d8e8e
Reverted command name from external:migrate to migrate
netrajpatel Jun 10, 2026
8cc80f6
Merge pull request #219 from contentstack/feat/externl-migrate-plugin
netrajpatel Jun 10, 2026
2ca8ba7
Update release tag from latest to alpha for contentstack-external-mig…
Jun 10, 2026
5ca9118
Merge pull request #221 from contentstack/fix/update-release-tag
naman-contentstack Jun 10, 2026
6ebf520
Merge pull request #220 from contentstack/development
netrajpatel Jun 10, 2026
6a9f78f
Add public access to alpha release tag for contentstack-external-migr…
Jun 10, 2026
a805d11
Merge branch 'main' into fix/update-release-tag
netrajpatel Jun 10, 2026
a1c9ef7
Merge pull request #222 from contentstack/fix/update-release-tag
netrajpatel Jun 10, 2026
790187b
Updated management token to source token
netrajpatel Jun 10, 2026
965dbb9
Merge pull request #224 from contentstack/chore/flag-name-change
naman-contentstack Jun 10, 2026
a911574
Updated readme
netrajpatel Jun 10, 2026
d7ecad1
Merge branch 'main' into chore/flag-name-change
naman-contentstack Jun 10, 2026
65ab218
Update README.md
Aravind-Kumar-cstk Jun 10, 2026
b9ea6b5
Merge pull request #228 from contentstack/chore/flag-name-change
Aravind-Kumar-cstk Jun 10, 2026
0bf09fb
Merge pull request #229 from contentstack/main
naman-contentstack Jun 11, 2026
e4b512f
Merge branch 'development' into fix/back-merge-dev
Jun 11, 2026
9475887
chore: update lockfile
Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release-v2-beta-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ jobs:
package: ./packages/contentstack-branches/package.json
tag: beta

# Apps CLI
- name: Publishing apps-cli (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-apps-cli/package.json
tag: latest

# Query Export
- name: Publishing query-export (Beta)
uses: JS-DevTools/npm-publish@v3
Expand Down Expand Up @@ -183,6 +191,22 @@ jobs:
package: ./packages/contentstack-migrate-rte/package.json
access: public
tag: beta
# External Migrate
- name: Publishing external-migrate (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-external-migrate/package.json
tag: latest

- name: Create Production Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.PKG_TOKEN }}
VERSION: ${{ steps.publish-plugins.outputs.version }}
run: |
# Get the previous production release for comparison
PREVIOUS_PROD=$(gh release list --limit 10 | grep -v 'prerelease' | head -1 | cut -f1)

# Bulk Operations
- name: Publishing bulk-operations (Beta)
Expand Down
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fileignoreconfig:
- filename: pnpm-lock.yaml
checksum: cdead0797199d22bbc55b9e5b6b86983f28eb760fabe5e1f2d5139c4456a9131
checksum: 7ec6345eb15ed0be001753ee49733421a8a07096dc8a18465cdad1b82562fed8
version: '1.0'
4 changes: 2 additions & 2 deletions packages/contentstack-apps-cli/src/util/common-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function fetchAppInstallations(
flags: FlagInput,
orgUid: string,
options: MarketPlaceOptions
) {
): Promise<any> {
const { marketplaceSdk } = options;
const app: any = flags["app-uid"];
return marketplaceSdk
Expand Down Expand Up @@ -218,7 +218,7 @@ function uninstallApp(
orgUid: string,
options: MarketPlaceOptions,
installationUid: string
) {
): Promise<any> {
const { marketplaceSdk } = options;
// const app: any = flags["app-uid"];
return marketplaceSdk
Expand Down
176 changes: 176 additions & 0 deletions packages/contentstack-content-type/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,181 @@ $ csdx content-type:details -a "management token" -c "content type" --no-path
<!-- usagestop -->
# Commands
<!-- commands -->
* [`csdx content-type:audit`](#csdx-content-typeaudit)
* [`csdx content-type:compare`](#csdx-content-typecompare)
* [`csdx content-type:compare-remote`](#csdx-content-typecompare-remote)
* [`csdx content-type:details`](#csdx-content-typedetails)
* [`csdx content-type:diagram`](#csdx-content-typediagram)
* [`csdx content-type:list`](#csdx-content-typelist)

## `csdx content-type:audit`

Display recent changes to a Content Type

```
USAGE
$ csdx content-type:audit -c <value> [-s <value> | -a <value> | -a <value>] [-k <value> | | ]

FLAGS
-a, --alias=<value> Alias of the management token
-a, --token-alias=<value> Management token alias
-c, --content-type=<value> (required) Content Type UID
-k, --stack-api-key=<value> Stack API Key
-s, --stack=<value> Stack UID

DESCRIPTION
Display recent changes to a Content Type

EXAMPLES
$ csdx content-type:audit --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"

$ csdx content-type:audit --alias "management token" --content-type "home_page"
```

_See code: [src/commands/content-type/audit.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-content-type/src/commands/content-type/audit.ts)_

## `csdx content-type:compare`

Compare two Content Type versions

```
USAGE
$ csdx content-type:compare -c <value> [-s <value> | -a <value>] [-k <value> | ] [-a <value>] [-l <value> -r <value>]

FLAGS
-a, --alias=<value> Alias of the management token
-a, --token-alias=<value> Management token alias
-c, --content-type=<value> (required) Content Type UID
-k, --stack-api-key=<value> Stack API Key
-l, --left=<value> Content Type version, i.e. prev version
-r, --right=<value> Content Type version, i.e. later version
-s, --stack=<value> Stack UID

DESCRIPTION
Compare two Content Type versions

EXAMPLES
$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"

$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page" --left # --right #

$ csdx content-type:compare --alias "management token" --content-type "home_page" --left # --right #
```

_See code: [src/commands/content-type/compare.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-content-type/src/commands/content-type/compare.ts)_

## `csdx content-type:compare-remote`

compare two Content Types on different Stacks

```
USAGE
$ csdx content-type:compare-remote (-o <value> -r <value>) -c <value>

FLAGS
-c, --content-type=<value> (required) Content Type UID
-o, --origin-stack=<value> (required) Origin Stack API Key
-r, --remote-stack=<value> (required) Remote Stack API Key

DESCRIPTION
compare two Content Types on different Stacks

EXAMPLES
$ csdx content-type:compare-remote --origin-stack "xxxxxxxxxxxxxxxxxxx" --remote-stack "xxxxxxxxxxxxxxxxxxx" -content-type "home_page"
```

_See code: [src/commands/content-type/compare-remote.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-content-type/src/commands/content-type/compare-remote.ts)_

## `csdx content-type:details`

Display Content Type details

```
USAGE
$ csdx content-type:details -c <value> [-s <value> | -a <value>] [-k <value> | ] [-a <value>] [-p]

FLAGS
-a, --alias=<value> Alias of the management token
-a, --token-alias=<value> Management token alias
-c, --content-type=<value> (required) Content Type UID
-k, --stack-api-key=<value> Stack API Key
-p, --[no-]path show path column
-s, --stack=<value> Stack UID

DESCRIPTION
Display Content Type details

EXAMPLES
$ csdx content-type:details --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"

$ csdx content-type:details --alias "management token" --content-type "home_page"

$ csdx content-type:details --alias "management token" --content-type "home_page" --no-path
```

_See code: [src/commands/content-type/details.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-content-type/src/commands/content-type/details.ts)_

## `csdx content-type:diagram`

Create a visual diagram of a Stack's Content Types

```
USAGE
$ csdx content-type:diagram -o <value> -d portrait|landscape -t svg|dot [-s <value> | -a <value> | -a <value>] [-k
<value> | | ]

FLAGS
-a, --alias=<value> Alias of the management token
-a, --token-alias=<value> Management token alias
-d, --direction=<option> (required) [default: portrait] graph orientation
<options: portrait|landscape>
-k, --stack-api-key=<value> Stack API Key
-o, --output=<value> (required) full path to output
-s, --stack=<value> Stack UID
-t, --type=<option> (required) [default: svg] graph output file type
<options: svg|dot>

DESCRIPTION
Create a visual diagram of a Stack's Content Types

EXAMPLES
$ csdx content-type:diagram --stack-api-key "xxxxxxxxxxxxxxxxxxx" --output "content-model.svg"

$ csdx content-type:diagram --alias "management token" --output "content-model.svg"

$ csdx content-type:diagram --alias "management token" --output "content-model.svg" --direction "landscape"

$ csdx content-type:diagram --alias "management token" --output "content-model.dot" --type "dot"
```

_See code: [src/commands/content-type/diagram.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-content-type/src/commands/content-type/diagram.ts)_

## `csdx content-type:list`

List all Content Types in a Stack

```
USAGE
$ csdx content-type:list [-s <value> | -a <value> | -a <value>] [-k <value> | | ] [-o title|modified]

FLAGS
-a, --alias=<value> Alias of the management token
-a, --token-alias=<value> Management token alias
-k, --stack-api-key=<value> Stack API Key
-o, --order=<option> [default: title] order by column
<options: title|modified>
-s, --stack=<value> Stack UID

DESCRIPTION
List all Content Types in a Stack

EXAMPLES
$ csdx content-type:list --stack-api-key "xxxxxxxxxxxxxxxxxxx"

$ csdx content-type:list --alias "management token"

$ csdx content-type:list --alias "management token" --order modified
```

_See code: [src/commands/content-type/list.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-content-type/src/commands/content-type/list.ts)_
<!-- commandsstop -->
18 changes: 18 additions & 0 deletions packages/contentstack-external-migrate/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'unicorn/prefer-module': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'node/no-missing-import': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'no-useless-escape': 'off',
},
};
27 changes: 27 additions & 0 deletions packages/contentstack-external-migrate/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
node_modules/
/lib/
oclif.manifest.json
*.log
.DS_Store
coverage/

# Local migration outputs (may contain customer content)
migration-workspace/
contentstack-import/
audit-reports/
audit-fix/
audit-verify/
export.json
contentfulMigrationData/
_backup_*/
migration-manifest.json

# Import/audit session logs (local artifacts, may contain customer content)
logs/
session.json

# Internal scratch docs — never commit (PR drafts / status notes)
pr.md
achieve.md
out/
.vscode/
43 changes: 43 additions & 0 deletions packages/contentstack-external-migrate/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Agent guide — Contentstack Migrate plugin

Use this file when automating work in `cli-plugin-migrate/`.

## What this repo is

- **Package:** `@contentstack/cli-plugin-migrate`
- **Commands:** `csdx migrate:export|convert|audit|import|status`
- **Scope:** Contentful → Contentstack migration (expert CLI, no bundled AI)

## User-facing docs (read first)

| Doc | Use when |
|-----|----------|
| [README.md](./README.md) | Install, commands, troubleshooting |
| [docs/getting-started.md](./docs/getting-started.md) | Onboarding colleagues |
| [docs/expert-workflow.md](./docs/expert-workflow.md) | End-to-end pipeline |
| [docs/limitations-and-scope.md](./docs/limitations-and-scope.md) | What is / isn't supported |

## Maintainer docs

| Doc | Use when |
|-----|----------|
| [docs/architecture.md](./docs/architecture.md) | Package layout, adapters |
| [docs/implementation-principles.md](./docs/implementation-principles.md) | Port vs PRD flags, spawn rules |
| [docs/phases/](./docs/phases/) | Per-command implementation specs |

## Rules for changes

1. **Do not** add `--stack` to `migrate:convert` — import stays on `migrate:import`.
2. **Audit/import** → shell out via `src/lib/csdx-spawn.ts`, do not reimplement CMA.
3. **Export** → `src/lib/contentful-cli-spawn.ts` (global `contentful` or `npx -y contentful-cli`).
4. **Never log** management tokens or full stack API keys.
5. **Manifest** updates on successful command completion — see `src/lib/manifest.ts`.
6. Match flag names in [README.md](./README.md) and phase docs, not the old reference Commander CLI.

## Verify

```bash
npm run build && npm test
```

Reference port source (optional, parent monorepo): `../references/import-contentful-cli-main/`.
21 changes: 21 additions & 0 deletions packages/contentstack-external-migrate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to `@contentstack/cli-plugin-migrate` are documented here.

## [0.1.0] — 2026-06-03

### Added

- `csdx migrate:export` — Contentful space export via Contentful CLI
- `csdx migrate:convert` — Contentful export → Contentstack import bundle
- `csdx migrate:audit` — wrapper for `csdx cm:stacks:audit`
- `csdx migrate:import` — wrapper for `csdx cm:stacks:import`
- `csdx migrate:status` — migration workspace manifest and next-step hints
- `migration-manifest.json` tracking (no secrets)
- Documentation set under `docs/` and root `README.md`

### Notes

- Contentful-only (`--legacy contentful`)
- Install via `csdx plugins:link .` after `npm run build`
- Import requires an empty destination stack and `csdx auth:login`
Loading
Loading