Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,45 @@ csdx cm:entries:publish --content-types blog --environments prod --locales en-us
csdx cm:stacks:bulk-entries --operation publish --content-types blog --environments prod --locales en-us -k blt123
```

### 7. 🚀 Launch Plugin Now Opt-In

**What Changed:**
- The `launch` plugin (`@contentstack/cli-launch`) is no longer bundled with the CLI
- All `launch:*` commands now require installing the plugin explicitly before use
- Brings `launch` in line with the opt-in, modular plugin model used elsewhere in 2.x

> ⚠️ **This is a change relative to the 2.x beta — not only relative to 1.x.** `@contentstack/cli-launch` was bundled throughout the 1.x releases **and** the entire 2.x beta period, so `launch:*` worked out of the box for beta users too. Starting with 2.x GA it becomes opt-in, so beta users who rely on `launch:*` are also affected when they upgrade.

**Before (1.x.x and 2.x.x-beta):**
- `launch:*` commands were bundled with the CLI and available by default after installation

**After (2.x.x GA):**
- `launch:*` commands are provided by a separate, opt-in plugin that must be installed explicitly
- Running any `launch:*` command without the plugin installed fails with a `command not found` error where it previously worked out of the box

**Affected commands:** `launch`, `launch:deployments`, `launch:environments`, `launch:functions`, `launch:logs`, `launch:open`, `launch:rollback`

**Installation Methods:**


**Option 1: Using CLI Plugin Manager**
```bash
csdx plugins:install @contentstack/cli-launch
```

**Option 2: Using npm**
```bash
npm install -g @contentstack/cli-launch
```

**Usage:**
After installation, launch commands will be available through the CLI:
```bash
csdx launch --help
```

**Migration Action:** If you use any `launch:*` command, install the `@contentstack/cli-launch` plugin before (or immediately after) upgrading to 2.x GA to avoid `command not found` errors. This applies to 2.x beta users as well, since `launch` was bundled during the beta.

## Troubleshooting

### Common Issues
Expand All @@ -209,6 +248,11 @@ csdx cm:stacks:bulk-entries --operation publish --content-types blog --environme
- The 2.x.x-beta version should be faster due to TypeScript modules
- If you are experiencing issues, switch to console log mode for debugging

**5. `launch:*` command not found:**
- In 2.x GA, `launch` is an opt-in plugin and is no longer bundled (it was bundled in 1.x and during the 2.x beta)
- Install it with `csdx plugins:install @contentstack/cli-launch`, then re-run your `launch:*` command
- Verify it is installed with `csdx plugins`

### Getting Help

**Documentation:**
Expand Down
291 changes: 7 additions & 284 deletions packages/contentstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ USAGE
* [`csdx config:set:rate-limit`](#csdx-configsetrate-limit)
* [`csdx config:set:region [REGION]`](#csdx-configsetregion-region)
* [`csdx help [COMMAND]`](#csdx-help-command)
* [`csdx launch`](#csdx-launch)
* [`csdx launch:deployments`](#csdx-launchdeployments)
* [`csdx launch:environments`](#csdx-launchenvironments)
* [`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)
Expand Down Expand Up @@ -1681,283 +1674,13 @@ DESCRIPTION

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.53/src/commands/help.ts)_

## `csdx launch`

Launch related operations

```
USAGE
$ csdx launch [-d <value>] [-c <value>] [--type GitHub|FileUpload] [--framework Gatsby|NextJs|CRA (Create
React App)|CSR (Client-Side Rendered)|Analog|Angular|Nuxt|Astro|VueJs|Remix|Other] [--org <value>] [-n <value>] [-e
<value>] [--branch <value>] [--build-command <value>] [--out-dir <value>] [--server-command <value>]
[--variable-type Import variables from a stack|Manually add custom variables to the list|Import variables from the
.env.local file|Skip adding environment variables...] [-a <value>] [--env-variables <value>] [--redeploy-latest]
[--redeploy-last-upload] [--response-mode buffered|streaming]

FLAGS
-a, --alias=<value> [optional] Alias (name) for the delivery token.
-c, --config=<value> Path to the local '.cs-launch.json' file
-d, --data-dir=<value> Current working directory
-e, --environment=<value> [optional] Environment name for the Launch project.
-n, --name=<value> [optional] Name of the project.
--branch=<value> [optional] GitHub branch name.
--build-command=<value> [optional] Build Command.
--env-variables=<value> [optional] Provide the environment variables in the key:value format, separated by
comma. For example: APP_ENV:prod, TEST_ENV:testVal.
--framework=<option> [optional] Type of framework. <options: Gatsby|NextJS|Other>
<options: Gatsby|NextJs|CRA (Create React App)|CSR (Client-Side
Rendered)|Analog|Angular|Nuxt|Astro|VueJs|Remix|Other>
--org=<value> [optional] Provide the organization UID to create a new project or deployment.
--out-dir=<value> [optional] Output Directory.
--redeploy-last-upload [optional] Redeploy with last file upload
--redeploy-latest [optional] Redeploy latest commit/code
--response-mode=<option> [optional] Provide mode for response. <options: buffered|streaming
<options: buffered|streaming>
--server-command=<value> [optional] Server Command.
--type=<option> [optional] Type of adapters. <options: GitHub|FileUpload>
<options: GitHub|FileUpload>
--variable-type=<option>... [optional] Provide a variable type (can specify multiple times). <options: Import
variables from a stack|Manually add custom variables to the list|Import variables
from the .env.local file|Skip adding environment variables>
<options: Import variables from a stack|Manually add custom variables to the
list|Import variables from the .env.local file|Skip adding environment variables>

DESCRIPTION
Launch related operations

EXAMPLES
$ csdx launch

$ csdx launch --data-dir <path/of/current/working/dir>

$ csdx launch --config <path/to/launch/config/file>

$ csdx launch --type <options: GitHub|FileUpload>

$ csdx launch --data-dir <path/of/current/working/dir> --type <options: GitHub|FileUpload>

$ csdx launch --data-dir <path/of/current/working/dir> --redeploy-latest

$ csdx launch --data-dir <path/of/current/working/dir> --redeploy-last-upload

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload>

$ csdx launch --environment=<value> --redeploy-latest

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload> --name=<value> --environment=<value> --branch=<value> --build-command=<value> --framework=<option> --org=<value> --out-dir=<value>

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload> --name=<value> --environment=<value> --branch=<value> --build-command=<value> --framework=<option> --org=<value> --out-dir=<value> --server-command=<value>

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload> --name=<value> --environment=<value> --branch=<value> --build-command=<value> --framework=<option> --org=<value> --out-dir=<value> --server-command=<value> --response-mode=streaming

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload> --name=<value> --environment=<value> --branch=<value> --build-command=<value> --framework=<option> --org=<value> --out-dir=<value> --variable-type="Import variables from a stack" --alias=<value>

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload> --name=<value> --environment=<value> --branch=<value> --build-command=<value> --framework=<option> --org=<value> --out-dir=<value> --variable-type="Manually add custom variables to the list" --env-variables="APP_ENV:prod, TEST_ENV:testVal"

$ csdx launch --config <path/to/launch/config/file> --type <options: GitHub|FileUpload> --name=<value> --environment=<value> --branch=<value> --build-command=<value> --framework=<option> --org=<value> --out-dir=<value> --variable-type="Import variables from a stack" --variable-type="Manually add custom variables to the list" --alias=<value>
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/index.ts)_

## `csdx launch:deployments`

Show list of deployments for an environment

```
USAGE
$ csdx launch:deployments [-d <value>] [-c <value>] [--org <value>] [--project <value>] [-e <value>]

FLAGS
-c, --config=<value> Path to the local '.cs-launch.json' file
-d, --data-dir=<value> Current working directory
-e, --environment=<value> Environment name or UID
--org=<value> [Optional] Provide the organization UID
--project=<value> [Optional] Provide the project UID

DESCRIPTION
Show list of deployments for an environment

EXAMPLES
$ csdx launch:deployments

$ csdx launch:deployments -d "current working directory"

$ csdx launch:deployments -c "path to the local config file"

$ csdx launch:deployments -e "environment number or uid" --org=<org UID> --project=<Project UID>
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/deployments.ts)_

## `csdx launch:environments`

Show list of environments for a project

```
USAGE
$ csdx launch:environments [-d <value>] [-c <value>] [--org <value>] [--project <value>]

FLAGS
-c, --config=<value> Path to the local '.cs-launch.json' file
-d, --data-dir=<value> Current working directory
--org=<value> [Optional] Provide the organization UID
--project=<value> [Optional] Provide the project UID

DESCRIPTION
Show list of environments for a project

EXAMPLES
$ csdx launch:environments

$ csdx launch:environments -d "current working directory"

$ csdx launch:environments -c "path to the local config file"

$ csdx launch:environments --org=<org UID> --project=<Project UID>
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/environments.ts)_

## `csdx launch:functions`

Serve cloud functions

```
USAGE
$ csdx launch:functions [-p <value>] [-d <value>]

FLAGS
-d, --data-dir=<value> Current working directory
-p, --port=<value> [default: 3000] Port number

DESCRIPTION
Serve cloud functions

EXAMPLES
$ csdx launch:functions

$ csdx launch:functions --port=port

$ csdx launch:functions --data-dir <path/of/current/working/dir>

$ csdx launch:functions --data-dir <path/of/current/working/dir> -p "port number"
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/functions.ts)_

## `csdx launch:logs`

Show deployment or server logs

```
USAGE
$ csdx launch:logs [-d <value>] [-c <value>] [-e <value>] [--deployment <value>] [--type d|s] [--org <value>]
[--project <value>]

FLAGS
-c, --config=<value> Path to the local '.cs-launch.json' file
-d, --data-dir=<value> Current working directory
-e, --environment=<value> Environment name or UID
--deployment=<value> Deployment number or UID
--org=<value> [Optional] Provide the organization UID
--project=<value> [Optional] Provide the project UID
--type=<option> [default: s] Type of flags to show logs. By default, these are server logs. Options [d -
deployment logs, s - server logs]
<options: d|s>

DESCRIPTION
Show deployment or server logs

EXAMPLES
$ csdx launch:logs

$ csdx launch:logs --data-dir <path/of/current/working/dir>

$ csdx launch:logs --data-dir <path/of/current/working/dir> --type <options: d|s>

$ csdx launch:logs --config <path/to/launch/config/file> --type <options: d|s>

$ csdx launch:logs --deployment=deployment

$ csdx launch:logs --environment=environment

$ csdx launch:logs --environment=environment --deployment=deployment

$ csdx launch:logs --environment=environment --type <options: d|s>

$ csdx launch:logs --environment=environment --data-dir <path/of/current/working/dir> --deployment=deployment

$ csdx launch:logs --environment=environment --config <path/to/launch/config/file> --deployment=deployment
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/logs.ts)_

## `csdx launch:open`

Open a website for an environment

```
USAGE
$ csdx launch:open [-d <value>] [-c <value>] [--org <value>] [--project <value>] [-e <value>]

FLAGS
-c, --config=<value> Path to the local '.cs-launch.json' file
-d, --data-dir=<value> Current working directory
-e, --environment=<value> Environment name or UID
--org=<value> [Optional] Provide the organization UID
--project=<value> [Optional] Provide the project UID

DESCRIPTION
Open a website for an environment

EXAMPLES
$ csdx launch:open

$ csdx launch:open --config <path/to/launch/config/file>

$ csdx launch:open --data-dir <path/of/current/working/dir>

$ csdx launch:open --environment=environment

$ csdx launch:open --environment=environment --config <path/to/launch/config/file>

$ csdx launch:open --environment=environment --data-dir <path/of/current/working/dir>
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/open.ts)_

## `csdx launch:rollback`

Roll back to previous deployment

```
USAGE
$ csdx launch:rollback [-d <value>] [-c <value>] [--org <value>] [--project <value>] [-e <value>] [--deployment
<value>] [--reason <value>]

FLAGS
-c, --config=<value> Path to the local '.cs-launch.json' file
-d, --data-dir=<value> Current working directory
-e, --environment=<value> Environment name or UID
--deployment=<value> [Optional] Deployment UID to roll back to
--org=<value> [Optional] Provide the organization UID
--project=<value> [Optional] Provide the project UID
--reason=<value> [Optional] Reason for the rollback (saved to audit log)

DESCRIPTION
Roll back to previous deployment

EXAMPLES
$ csdx launch:rollback

$ csdx launch:rollback -d "current working directory"

$ csdx launch:rollback -c "path to the local config file"

$ csdx launch:rollback -e "environment number or uid" --deployment=<deployment UID> --org=<org UID> --project=<Project UID> --reason="restoring previous build"
```

_See code: [@contentstack/cli-launch](https://github.com/contentstack/launch-cli/blob/main/packages/contentstack-launch/src/commands/launch/rollback.ts)_
> **Note:** The `launch` commands are provided by the opt-in [`@contentstack/cli-launch`](https://github.com/contentstack/launch-cli) plugin and are **not bundled** with `@contentstack/cli`. Install the plugin before using them:
>
> ```sh-session
> $ csdx plugins:add @contentstack/cli-launch
> ```
>
> For the full list of `launch` commands and their flags, see the [`@contentstack/cli-launch` README](https://github.com/contentstack/launch-cli#readme).

## `csdx login`

Expand Down
8 changes: 2 additions & 6 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@contentstack/cli-cm-seed": "~2.0.0-beta.24",
"@contentstack/cli-command": "~2.0.0-beta.10",
"@contentstack/cli-config": "~2.0.0-beta.14",
"@contentstack/cli-launch": "^1.11.1",
"@contentstack/cli-migration": "~2.0.0-beta.16",
"@contentstack/cli-utilities": "~2.0.0-beta.11",
"@contentstack/cli-variants": "~2.0.0-beta.19",
Expand Down Expand Up @@ -125,9 +124,6 @@
"cm:stacks": {
"description": "Stacks related operations"
},
"launch": {
"description": "Launch related operations"
},
"plugins": {
"description": "List installed plugins"
}
Expand All @@ -150,7 +146,6 @@
"@contentstack/cli-cm-branches",
"@contentstack/cli-audit",
"@contentstack/cli-cm-import-setup",
"@contentstack/cli-launch",
"@contentstack/cli-bulk-operations"
],
"hooks": {
Expand All @@ -161,7 +156,8 @@
],
"init": [
"./lib/hooks/init/context-init",
"./lib/hooks/init/utils-init"
"./lib/hooks/init/utils-init",
"./lib/hooks/init/opt-in-plugin-guide"
]
}
},
Expand Down
Loading
Loading