FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix/upgrade cli dependencies by harshitha-cstk · Pull Request #145 · contentstack/contentstack-cli-content-type · GitHub

This repository was archived by the owner on Aug 21, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .json  (2) .md  (8) .ts  (24) All 4 file types selected
Only manifest files
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions .cursor/rules/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Cursor (optional)

**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.

This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
51 changes: 51 additions & 0 deletions AGENTS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# contentstack-cli-content-type – Agent guide

**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.

## What this repo is

| Field | Detail |
|-------|--------|
| **Name:** | [contentstack/contentstack-cli-content-type](https://github.com/contentstack/contentstack-cli-content-type) (`contentstack-cli-content-type` on npm) |
| **Purpose:** | Contentstack CLI (`csdx`) plugin that reads Content Type metadata from a stack: list, details, audit logs, same-stack or cross-stack JSON compare (HTML diff), and stack content-model diagrams. |
| **Out of scope (if any):** | Bulk entry/asset mutations, Delivery API consumption, and unrelated HTTP clients—this package focuses on content-type introspection via the Management API patterns documented in the plugin skill. |

## Tech stack (at a glance)

| Area | Details |
|------|---------|
| Language | TypeScript, **`strict`** ([tsconfig.json](tsconfig.json)), target ES2017, CommonJS |
| Build | `tsc -b`; output **`lib/`**; **`npm run prepack`** runs compile + `oclif manifest` + `oclif readme` |
| Tests | Jest + ts-jest; tests under **`tests/`** ([jest.config.js](jest.config.js)) |
| Lint / coverage | ESLint via **`npm run posttest`** ([.eslintrc](.eslintrc)); Jest coverage **`npm run test:coverage`**, global thresholds in [jest.config.js](jest.config.js) |
| CLI / runtime | oclif; Node engines per [package.json](package.json); `bin` is `csdx` when installed as a CLI plugin |

## Commands (quick reference)

| Command type | Command |
|--------------|---------|
| Build (publishable) | `npm run prepack` |
| Test | `npm test` |
| Test + coverage | `npm run test:coverage` |
| Lint | `npm run posttest` (or `eslint . --ext .ts --config .eslintrc`) |

CI: [.github/workflows](.github/workflows) includes policy/SCA/release/issue automation—there is no single `ci.yml` that only runs `npm test`; follow team merge requirements.

## Where the documentation lives: skills

| Skill | Path | What it covers |
|-------|------|----------------|
| Dev workflow | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | Scripts, `tsconfig`, ESLint, Jest/coverage, oclif README/manifest, PR checks |
| Content Type plugin | [skills/contentstack-cli-content-type/SKILL.md](skills/contentstack-cli-content-type/SKILL.md) | `ContentTypeCommand`, CMA vs SDK, auth, commands, compare/diagram |
| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Jest layout, mocks, conventions, coverage |
| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR checklist, security and dependency review |

An index with “when to use” hints is in [skills/README.md](skills/README.md).

## Security

See [SECURITY.md](SECURITY.md) for reporting issues.

## Using Cursor (optional)

If you use **Cursor**, [.cursor/rules/README.md](.cursor/rules/README.md) only points to **[AGENTS.md](AGENTS.md)**—same docs as everyone else.
65 changes: 27 additions & 38 deletions README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ Display recent changes to a Content Type

```
USAGE
$ csdx content-type:audit -c <value> [-s <value> | -a <value> | -a <value>] [-k <value> | | ]
$ csdx content-type:audit --content-type <value> [-k <value> | -a <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
--content-type=<value> (required) Content Type UID

DESCRIPTION
Display recent changes to a Content Type
Expand All @@ -85,24 +83,22 @@ EXAMPLES
$ csdx content-type:audit --alias "management token" --content-type "home_page"
```

_See code: [src/commands/content-type/audit.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.3.0/src/commands/content-type/audit.ts)_
_See code: [src/commands/content-type/audit.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.5.0-beta.0/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>]
$ csdx content-type:compare --content-type <value> [-k <value> | -a <value>] [--left <value> --right <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
--content-type=<value> (required) Content Type UID
--left=<value> Content Type version, i.e. prev version
--right=<value> Content Type version, i.e. later version

DESCRIPTION
Compare two Content Type versions
Expand All @@ -115,45 +111,43 @@ EXAMPLES
$ 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/contentstack-cli-content-type/blob/v1.3.0/src/commands/content-type/compare.ts)_
_See code: [src/commands/content-type/compare.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.5.0-beta.0/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>
$ csdx content-type:compare-remote (--origin-stack <value> --remote-stack <value>) --content-type <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
--content-type=<value> (required) Content Type UID
--origin-stack=<value> (required) Origin Stack API Key
--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"
$ 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/contentstack-cli-content-type/blob/v1.3.0/src/commands/content-type/compare-remote.ts)_
_See code: [src/commands/content-type/compare-remote.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.5.0-beta.0/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]
$ csdx content-type:details --content-type <value> [-k <value> | -a <value>] [--path]

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
--content-type=<value> (required) Content Type UID
--[no-]path show path column

DESCRIPTION
Display Content Type details
Expand All @@ -166,26 +160,23 @@ EXAMPLES
$ 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/contentstack-cli-content-type/blob/v1.3.0/src/commands/content-type/details.ts)_
_See code: [src/commands/content-type/details.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.5.0-beta.0/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> | | ]
$ csdx content-type:diagram --output <value> --direction portrait|landscape --type svg|dot [-k <value> | -a <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
--direction=<option> (required) [default: portrait] graph orientation
<options: portrait|landscape>
--output=<value> (required) full path to output
--type=<option> (required) [default: svg] graph output file type
<options: svg|dot>

DESCRIPTION
Expand All @@ -201,23 +192,21 @@ EXAMPLES
$ 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/contentstack-cli-content-type/blob/v1.3.0/src/commands/content-type/diagram.ts)_
_See code: [src/commands/content-type/diagram.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.5.0-beta.0/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]
$ csdx content-type:list [-k <value> | -a <value>] [--order 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
--order=<option> [default: title] order by column
<options: title|modified>
-s, --stack=<value> Stack UID

DESCRIPTION
List all Content Types in a Stack
Expand All @@ -230,5 +219,5 @@ EXAMPLES
$ csdx content-type:list --alias "management token" --order modified
```

_See code: [src/commands/content-type/list.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.3.0/src/commands/content-type/list.ts)_
_See code: [src/commands/content-type/list.ts](https://github.com/contentstack/contentstack-cli-content-type/blob/v1.5.0-beta.0/src/commands/content-type/list.ts)_
<!-- commandsstop -->
30 changes: 22 additions & 8 deletions jest.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
module.exports = {
"roots": [
"<rootDir>"
roots: [
'<rootDir>',
],
"testMatch": [
"**/tests/**/*.+(ts|tsx)",
"**/?(*.)+(spec|test).+(ts|tsx)"
testMatch: [
'**/tests/**/*.+(ts|tsx)',
'**/?(*.)+(spec|test).+(ts|tsx)',
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
}
// Coverage: raise thresholds toward ~80% lines/branches/functions as the suite grows (see AGENTS.md).
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
],
coverageReporters: ['text', 'text-summary', 'lcov', 'html'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
}
Loading

Back | FazBrowse Home | New Git URL