From 6b01505e3d0998628417a99c6faacbe0a6054340 Mon Sep 17 00:00:00 2001 From: harshitha-cstk Date: Tue, 19 May 2026 16:00:38 +0530 Subject: [PATCH 1/4] feat: migrate Apps CLI plugin to cli-plugins monorepo and add related documentation - Moved the `@contentstack/apps-cli` plugin from the external plugin to the `cli-plugins` monorepo. - Updated `AGENTS.md` to include Developer Hub apps in the purpose and added new sections for the Apps CLI plugin. - Created `APPS-CLI-MIGRATION.md` to document the migration process and repository changes. - Added new commands and configuration files for the Apps CLI plugin. - Updated CI workflows to include testing and publishing for the Apps CLI plugin. --- .cursor/rules/apps-cli.mdc | 34 ++ .github/config/release.json | 3 +- .github/workflows/release-v2-beta-plugins.yml | 8 + .github/workflows/unit-test.yml | 4 + AGENTS.md | 12 +- APPS-CLI-MIGRATION.md | 51 ++ MIGRATION.md | 8 + README.md | 1 + packages/contentstack-apps-cli/.eslintignore | 1 + packages/contentstack-apps-cli/.eslintrc | 42 ++ packages/contentstack-apps-cli/.gitignore | 21 + packages/contentstack-apps-cli/.mocharc.json | 12 + packages/contentstack-apps-cli/LICENSE | 21 + packages/contentstack-apps-cli/README.md | 313 ++++++++++++ packages/contentstack-apps-cli/bin/dev | 17 + packages/contentstack-apps-cli/bin/dev.cmd | 3 + packages/contentstack-apps-cli/bin/run | 5 + packages/contentstack-apps-cli/bin/run.cmd | 3 + .../DEPLOY_COMMAND_FLOW_AND_TEST_ISSUES.md | 200 ++++++++ .../examples/create-launch-project.json | 14 + packages/contentstack-apps-cli/package.json | 114 +++++ .../src/app-cli-base-command.ts | 33 ++ .../contentstack-apps-cli/src/base-command.ts | 199 ++++++++ .../src/commands/app/create.ts | 463 +++++++++++++++++ .../src/commands/app/delete.ts | 86 ++++ .../src/commands/app/deploy.ts | 306 +++++++++++ .../src/commands/app/get.ts | 68 +++ .../src/commands/app/index.ts | 39 ++ .../src/commands/app/install.ts | 155 ++++++ .../src/commands/app/reinstall.ts | 137 +++++ .../src/commands/app/uninstall.ts | 82 +++ .../src/commands/app/update.ts | 219 ++++++++ .../contentstack-apps-cli/src/config/index.ts | 13 + .../src/config/manifest.json | 105 ++++ .../src/factories/uninstall-app-factory.ts | 15 + .../src/graphql/queries.ts | 29 ++ .../src/hooks/init/load-chalk.ts | 9 + packages/contentstack-apps-cli/src/index.ts | 1 + .../src/interfaces/uninstall-app.ts | 18 + .../src/messages/index.ts | 173 +++++++ .../src/strategies/uninstall-all.ts | 61 +++ .../src/strategies/uninstall-selected.ts | 63 +++ .../contentstack-apps-cli/src/types/app.ts | 151 ++++++ .../contentstack-apps-cli/src/types/index.ts | 2 + .../contentstack-apps-cli/src/types/utils.ts | 29 ++ .../src/util/api-request-handler.ts | 61 +++ .../src/util/common-utils.ts | 430 ++++++++++++++++ .../src/util/error-helper.ts | 7 + packages/contentstack-apps-cli/src/util/fs.ts | 34 ++ .../contentstack-apps-cli/src/util/index.ts | 4 + .../src/util/inquirer.ts | 471 +++++++++++++++++ .../contentstack-apps-cli/src/util/log.ts | 188 +++++++ .../test/helpers/init.js | 7 + .../contentstack-apps-cli/test/tsconfig.json | 10 + .../test/unit/commands/app/create.test.ts | 473 ++++++++++++++++++ .../test/unit/commands/app/delete.test.ts | 114 +++++ .../test/unit/commands/app/deploy.test.ts | 405 +++++++++++++++ .../test/unit/commands/app/get.test.ts | 206 ++++++++ .../test/unit/commands/app/install.test.ts | 166 ++++++ .../test/unit/commands/app/reinstall.test.ts | 225 +++++++++ .../test/unit/commands/app/uninstall.test.ts | 353 +++++++++++++ .../test/unit/commands/app/update.test.ts | 290 +++++++++++ .../test/unit/config/manifest.json | 28 ++ .../test/unit/config/org_manifest.json | 29 ++ .../test/unit/helpers/auth-stub-helper.ts | 36 ++ .../test/unit/mock/boilerplate.zip | Bin 0 -> 328 bytes .../test/unit/mock/common.mock.json | 154 ++++++ .../test/unit/mock/config.json | 3 + .../test/unit/util/common-utils.test.ts | 144 ++++++ .../test/unit/util/inquirer.test.ts | 177 +++++++ packages/contentstack-apps-cli/tsconfig.json | 24 + skills/apps-cli-framework/SKILL.md | 45 ++ skills/apps-cli-typescript/SKILL.md | 37 ++ skills/contentstack-apps/SKILL.md | 48 ++ skills/dev-workflow/SKILL.md | 15 +- 75 files changed, 7524 insertions(+), 3 deletions(-) create mode 100644 .cursor/rules/apps-cli.mdc create mode 100644 APPS-CLI-MIGRATION.md create mode 100644 packages/contentstack-apps-cli/.eslintignore create mode 100644 packages/contentstack-apps-cli/.eslintrc create mode 100644 packages/contentstack-apps-cli/.gitignore create mode 100644 packages/contentstack-apps-cli/.mocharc.json create mode 100644 packages/contentstack-apps-cli/LICENSE create mode 100644 packages/contentstack-apps-cli/README.md create mode 100755 packages/contentstack-apps-cli/bin/dev create mode 100644 packages/contentstack-apps-cli/bin/dev.cmd create mode 100755 packages/contentstack-apps-cli/bin/run create mode 100644 packages/contentstack-apps-cli/bin/run.cmd create mode 100644 packages/contentstack-apps-cli/docs/DEPLOY_COMMAND_FLOW_AND_TEST_ISSUES.md create mode 100644 packages/contentstack-apps-cli/examples/create-launch-project.json create mode 100644 packages/contentstack-apps-cli/package.json create mode 100644 packages/contentstack-apps-cli/src/app-cli-base-command.ts create mode 100644 packages/contentstack-apps-cli/src/base-command.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/create.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/delete.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/deploy.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/get.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/index.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/install.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/reinstall.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/uninstall.ts create mode 100644 packages/contentstack-apps-cli/src/commands/app/update.ts create mode 100644 packages/contentstack-apps-cli/src/config/index.ts create mode 100644 packages/contentstack-apps-cli/src/config/manifest.json create mode 100644 packages/contentstack-apps-cli/src/factories/uninstall-app-factory.ts create mode 100644 packages/contentstack-apps-cli/src/graphql/queries.ts create mode 100644 packages/contentstack-apps-cli/src/hooks/init/load-chalk.ts create mode 100644 packages/contentstack-apps-cli/src/index.ts create mode 100644 packages/contentstack-apps-cli/src/interfaces/uninstall-app.ts create mode 100644 packages/contentstack-apps-cli/src/messages/index.ts create mode 100644 packages/contentstack-apps-cli/src/strategies/uninstall-all.ts create mode 100644 packages/contentstack-apps-cli/src/strategies/uninstall-selected.ts create mode 100644 packages/contentstack-apps-cli/src/types/app.ts create mode 100644 packages/contentstack-apps-cli/src/types/index.ts create mode 100644 packages/contentstack-apps-cli/src/types/utils.ts create mode 100644 packages/contentstack-apps-cli/src/util/api-request-handler.ts create mode 100644 packages/contentstack-apps-cli/src/util/common-utils.ts create mode 100644 packages/contentstack-apps-cli/src/util/error-helper.ts create mode 100644 packages/contentstack-apps-cli/src/util/fs.ts create mode 100644 packages/contentstack-apps-cli/src/util/index.ts create mode 100644 packages/contentstack-apps-cli/src/util/inquirer.ts create mode 100755 packages/contentstack-apps-cli/src/util/log.ts create mode 100755 packages/contentstack-apps-cli/test/helpers/init.js create mode 100755 packages/contentstack-apps-cli/test/tsconfig.json create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/create.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/delete.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/deploy.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/get.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/install.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/reinstall.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/uninstall.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/commands/app/update.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/config/manifest.json create mode 100644 packages/contentstack-apps-cli/test/unit/config/org_manifest.json create mode 100644 packages/contentstack-apps-cli/test/unit/helpers/auth-stub-helper.ts create mode 100644 packages/contentstack-apps-cli/test/unit/mock/boilerplate.zip create mode 100644 packages/contentstack-apps-cli/test/unit/mock/common.mock.json create mode 100644 packages/contentstack-apps-cli/test/unit/mock/config.json create mode 100644 packages/contentstack-apps-cli/test/unit/util/common-utils.test.ts create mode 100644 packages/contentstack-apps-cli/test/unit/util/inquirer.test.ts create mode 100644 packages/contentstack-apps-cli/tsconfig.json create mode 100644 skills/apps-cli-framework/SKILL.md create mode 100644 skills/apps-cli-typescript/SKILL.md create mode 100644 skills/contentstack-apps/SKILL.md diff --git a/.cursor/rules/apps-cli.mdc b/.cursor/rules/apps-cli.mdc new file mode 100644 index 000000000..56c6920d8 --- /dev/null +++ b/.cursor/rules/apps-cli.mdc @@ -0,0 +1,34 @@ +--- +description: 'Contentstack Apps CLI plugin (Developer Hub app lifecycle)' +globs: + [ + 'packages/contentstack-apps-cli/**/*.ts', + 'packages/contentstack-apps-cli/test/**/*.ts', + ] +alwaysApply: false +--- + +# Apps CLI plugin standards + +Canonical docs: [AGENTS.md](../../AGENTS.md) and skills: + +- [skills/contentstack-apps/SKILL.md](../../skills/contentstack-apps/SKILL.md) — manifests, GraphQL, HTTP +- [skills/apps-cli-framework/SKILL.md](../../skills/apps-cli-framework/SKILL.md) — `BaseCommand`, `AppCLIBaseCommand`, flags +- [skills/apps-cli-typescript/SKILL.md](../../skills/apps-cli-typescript/SKILL.md) — TS/ESLint + +## Command layout + +- Commands live under `packages/contentstack-apps-cli/src/commands/app/` +- Topic: `app` (e.g. `csdx app:create`, `csdx app:deploy`) +- Extend `AppCLIBaseCommand` for manifest workflows; otherwise `BaseCommand` + +## Testing + +- Mocha + Chai + sinon + nock; `@oclif/test` for command runs +- Use `stubAuthentication` from `test/unit/helpers/auth-stub-helper.ts` +- No real API credentials; `--forbid-only` in CI + +## Dependencies + +- `@contentstack/cli-command`, `@contentstack/cli-utilities` — version must match the cli-plugins branch (v1 vs v2 beta) +- Chalk v5: loaded via init hook `src/hooks/init/load-chalk.ts` diff --git a/.github/config/release.json b/.github/config/release.json index d3bff31b6..f43492a73 100755 --- a/.github/config/release.json +++ b/.github/config/release.json @@ -9,6 +9,7 @@ "migration": false, "seed": false, "bootstrap": false, - "branches": false + "branches": false, + "apps-cli": false } } diff --git a/.github/workflows/release-v2-beta-plugins.yml b/.github/workflows/release-v2-beta-plugins.yml index 482b0a9bc..fa5a42c6e 100644 --- a/.github/workflows/release-v2-beta-plugins.yml +++ b/.github/workflows/release-v2-beta-plugins.yml @@ -142,3 +142,11 @@ jobs: token: ${{ secrets.NPM_TOKEN }} package: ./packages/contentstack-query-export/package.json tag: beta + + # Apps CLI + - name: Publishing apps-cli (Beta) + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} + package: ./packages/contentstack-apps-cli/package.json + tag: beta diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 62c048f9b..853bb54e9 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -66,3 +66,7 @@ jobs: - name: Run tests for Contentstack Query Export working-directory: ./packages/contentstack-query-export run: npm run test:unit + + - name: Run tests for Contentstack Apps CLI + working-directory: ./packages/contentstack-apps-cli + run: npm run test:unit:report:json diff --git a/AGENTS.md b/AGENTS.md index c1c1995d0..931eee772 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ | Field | Detail | | --- | --- | | **Name:** | Contentstack CLI plugins (pnpm monorepo; root package name `csdx`) | -| **Purpose:** | OCLIF plugins that extend the Contentstack CLI (import/export, clone, migration, seed, audit, variants, etc.). | +| **Purpose:** | OCLIF plugins that extend the Contentstack CLI (import/export, clone, migration, seed, audit, variants, Developer Hub apps, etc.). | | **Out of scope (if any):** | The **core** CLI aggregation lives in the separate `cli` monorepo; this repo ships plugin packages only. | ## Tech stack (at a glance) @@ -39,6 +39,16 @@ CI: [.github/workflows/unit-test.yml](.github/workflows/unit-test.yml) and other | Framework | [skills/framework/SKILL.md](skills/framework/SKILL.md) | Utilities, config, logging, errors | | Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Mocha/Chai, coverage, mocks | | Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR review for this monorepo | +| Contentstack Apps (Developer Hub) | [skills/contentstack-apps/SKILL.md](skills/contentstack-apps/SKILL.md) | Manifests, GraphQL, HTTP for `packages/contentstack-apps-cli` | +| Apps CLI framework | [skills/apps-cli-framework/SKILL.md](skills/apps-cli-framework/SKILL.md) | `BaseCommand`, `AppCLIBaseCommand`, oclif flags for apps plugin | +| Apps CLI TypeScript | [skills/apps-cli-typescript/SKILL.md](skills/apps-cli-typescript/SKILL.md) | TS/ESLint conventions for apps plugin | + +## Apps CLI plugin (`@contentstack/apps-cli`) + +- **Package path:** [packages/contentstack-apps-cli](packages/contentstack-apps-cli) +- **npm name:** `@contentstack/apps-cli` (unchanged for consumers) +- **Migrated from:** [contentstack/contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) — see [APPS-CLI-MIGRATION.md](APPS-CLI-MIGRATION.md) +- **v1 / v2:** Maintain on `v1-dev` (1.x CLI deps) and `v2-dev` / `v2-beta` (2.x beta deps) branches; align `@contentstack/cli-command` and `@contentstack/cli-utilities` versions with the target CLI line. ## Using Cursor (optional) diff --git a/APPS-CLI-MIGRATION.md b/APPS-CLI-MIGRATION.md new file mode 100644 index 000000000..e71cc74dd --- /dev/null +++ b/APPS-CLI-MIGRATION.md @@ -0,0 +1,51 @@ +# Apps CLI migration: standalone repo → cli-plugins monorepo + +## Summary + +The **@contentstack/apps-cli** plugin (`contentstack-apps-cli`) has moved from the standalone repository [contentstack/contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) into the [contentstack/cli-plugins](https://github.com/contentstack/cli-plugins) monorepo at **`packages/contentstack-apps-cli`**. + +The **npm package name is unchanged**: `@contentstack/apps-cli`. Install and command usage stay the same. + +## Repository and issue tracking + +| Before | After | +| --- | --- | +| Source: `github.com/contentstack/contentstack-apps-cli` | Source: `github.com/contentstack/cli-plugins` → `packages/contentstack-apps-cli` | +| Issues: contentstack-apps-cli repo | Issues: [cli-plugins issues](https://github.com/contentstack/cli-plugins/issues) (label or mention `apps-cli` / `@contentstack/apps-cli`) | + +The standalone **contentstack-apps-cli** repository is **archived** after the first release from cli-plugins. Open PRs and bugs should be recreated or linked in cli-plugins. + +## Version lines (1.x vs 2.x) + +| CLI line | cli-plugins branch | Apps plugin notes | +| --- | --- | --- | +| **1.x** | `v1-dev` / `v1-beta` | `@contentstack/cli-command` and `@contentstack/cli-utilities` on 1.x-compatible ranges | +| **2.x beta** | `v2-dev` / `v2-beta` | Align with 2.x beta core packages (same pattern as export, import, bootstrap) | + +Develop and release each line on its branch; do not mix 1.x and 2.x dependency pins in the same branch. + +## Install (unchanged) + +```bash +csdx plugins:install @contentstack/apps-cli +# or +npm install -g @contentstack/apps-cli +``` + +## Local development + +Clone [cli-dev-workspace](https://github.com/contentstack/cli-dev-workspace) (or cli-plugins only), then: + +```bash +cd cli-plugins +pnpm install +pnpm --filter @contentstack/apps-cli run build +pnpm --filter @contentstack/apps-cli test +``` + +See [AGENTS.md](./AGENTS.md) and [skills/contentstack-apps/SKILL.md](./skills/contentstack-apps/SKILL.md) for contributor docs. + +## Related migrations + +- Core CLI: [cli](https://github.com/contentstack/cli) monorepo +- Other external plugins (bulk operations, migrate-rte): same cli-plugins consolidation effort diff --git a/MIGRATION.md b/MIGRATION.md index 7853bc0d8..d9fe2acfe 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -180,6 +180,14 @@ csdx cm:migrate-rte --help **Migration Action:** Refer to the detailed [Bulk Operations Migration Guide](./BULK-OPERATIONS-MIGRATION.md) for complete command mappings and examples. +### 7. 📱 Apps CLI plugin repository move + +**What Changed:** +- The Apps CLI plugin (`@contentstack/apps-cli`) source moved from the standalone [contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) repository into this **cli-plugins** monorepo at `packages/contentstack-apps-cli` +- The npm package name and `csdx app:*` commands are unchanged + +**Migration Action:** For repository location, branching (1.x vs 2.x), and issue tracking, see the [Apps CLI Migration Guide](./APPS-CLI-MIGRATION.md). + **Quick Example:** ```bash # Before (1.x.x) diff --git a/README.md b/README.md index 6b922e41e..ef8ea5843 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ CLI supports content management scripts through which you can perform the follow - Migrate HTML RTE to JSON RTE content - Change Master Locale - Use Bootstrap plugin +- Manage Developer Hub apps (`app:*` via `@contentstack/apps-cli`) - Use Tsgen plugin diff --git a/packages/contentstack-apps-cli/.eslintignore b/packages/contentstack-apps-cli/.eslintignore new file mode 100644 index 000000000..9b1c8b133 --- /dev/null +++ b/packages/contentstack-apps-cli/.eslintignore @@ -0,0 +1 @@ +/dist diff --git a/packages/contentstack-apps-cli/.eslintrc b/packages/contentstack-apps-cli/.eslintrc new file mode 100644 index 000000000..aa58bce72 --- /dev/null +++ b/packages/contentstack-apps-cli/.eslintrc @@ -0,0 +1,42 @@ +{ + "env": { + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "plugin:@typescript-eslint/recommended" + ], + "ignorePatterns": [ + "lib/**/*", + "test/**/*" + ], + "rules": { + "@typescript-eslint/no-unused-vars": [ + "error", + { + "args": "none" + } + ], + "@typescript-eslint/prefer-namespace-keyword": "error", + "quotes": "off", + "semi": "off", + "@typescript-eslint/no-redeclare": "off", + "eqeqeq": [ + "error", + "smart" + ], + "id-match": "error", + "no-eval": "error", + "no-var": "error", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-require-imports": "off", + "prefer-const": "error" + } +} \ No newline at end of file diff --git a/packages/contentstack-apps-cli/.gitignore b/packages/contentstack-apps-cli/.gitignore new file mode 100644 index 000000000..976172982 --- /dev/null +++ b/packages/contentstack-apps-cli/.gitignore @@ -0,0 +1,21 @@ +*-debug.log +*-error.log +/.nyc_output +/dist +/lib +/package-lock.json +/tmp +/yarn.lock +node_modules +oclif.manifest.json +.env +*.log +tsconfig.tsbuildinfo +dependabot.yml +.vscode +*.todo +/bkp +.editorconfig +oclif.manifest.json +*.env +.vscode/ diff --git a/packages/contentstack-apps-cli/.mocharc.json b/packages/contentstack-apps-cli/.mocharc.json new file mode 100644 index 000000000..4a09d1446 --- /dev/null +++ b/packages/contentstack-apps-cli/.mocharc.json @@ -0,0 +1,12 @@ +{ + "require": [ + "test/helpers/init.js", + "ts-node/register" + ], + "watch-extensions": [ + "ts" + ], + "recursive": true, + "reporter": "spec", + "timeout": 60000 +} diff --git a/packages/contentstack-apps-cli/LICENSE b/packages/contentstack-apps-cli/LICENSE new file mode 100644 index 000000000..c409861bc --- /dev/null +++ b/packages/contentstack-apps-cli/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Contentstack + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/contentstack-apps-cli/README.md b/packages/contentstack-apps-cli/README.md new file mode 100644 index 000000000..2a21c7384 --- /dev/null +++ b/packages/contentstack-apps-cli/README.md @@ -0,0 +1,313 @@ +> **Source of truth:** [cli-plugins monorepo](https://github.com/contentstack/cli-plugins) — `packages/contentstack-apps-cli` +> Migrated from [contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli). See [APPS-CLI-MIGRATION.md](../../APPS-CLI-MIGRATION.md). + + + + +# @contentstack/apps-cli + +Contentstack lets you develop apps in your organization using the Developer Hub portal. With the Apps CLI plugin, Contentstack CLI allows you to perform the CRUD operations on your app in Developer Hub and then use the app in your organization or stack by installing or uninstalling your app as required. + +## How to install this plugin + +```shell +$ csdx plugins:install @contentstack/apps-cli +``` + +## How to use this plugin + +This plugin requires you to be authenticated using [csdx auth:login](https://www.contentstack.com/docs/developers/cli/authenticate-with-the-cli/). + + +```sh-session +$ npm install -g @contentstack/apps-cli +$ csdx COMMAND +running command... +$ csdx (--version|-v) +@contentstack/apps-cli/1.6.1 darwin-arm64 node-v18.20.2 +$ csdx --help [COMMAND] +USAGE + $ csdx COMMAND +... +``` + + +# Commands + + +* [`csdx app`](#csdx-app) +* [`csdx app:create`](#csdx-appcreate) +* [`csdx app:delete`](#csdx-appdelete) +* [`csdx app:deploy`](#csdx-appdeploy) +* [`csdx app:get`](#csdx-appget) +* [`csdx app:install`](#csdx-appinstall) +* [`csdx app:reinstall`](#csdx-appreinstall) +* [`csdx app:uninstall`](#csdx-appuninstall) +* [`csdx app:update`](#csdx-appupdate) + +## `csdx app` + +Apps CLI plugin + +``` +USAGE + $ csdx app + +DESCRIPTION + Apps CLI plugin + +EXAMPLES + $ csdx app:create + + $ csdx app:delete + + $ csdx app:deploy + + $ csdx app:get + + $ csdx app:install + + $ csdx app:reinstall + + $ csdx app:uninstall + + $ csdx app:update +``` + +_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/index.ts)_ + +## `csdx app:create` + +Create a new app in Developer Hub and optionally clone a boilerplate locally. + +``` +USAGE + $ csdx app:create [--org ] [-n ] [--app-type stack|organization] [-c ] [-d ] + [--boilerplate ] + +FLAGS + -c, --config= Path of the external config + -d, --data-dir= Current working directory. + -n, --name= Name of the app to be created + --app-type=