-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontent-type-plugin.mdc
More file actions
22 lines (19 loc) · 1.48 KB
/
content-type-plugin.mdc
File metadata and controls
22 lines (19 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
description: OCLIF content-type plugin — commands, core, utils, types, config (ContentTypeCommand, SDK, CMA client)
globs:
- src/commands/**/*.ts
- src/core/**/*.ts
- src/utils/**/*.ts
- src/types/**/*.ts
- src/config/**/*.ts
alwaysApply: false
---
# content-type plugin
- Commands live under `src/commands/content-type/` and extend **`ContentTypeCommand`** from `src/core/command.ts`. Parse flags, call **`setup(flags)`** (await where the command awaits it), then delegate to **`src/core/content-type/`** and **`src/utils/index.ts`**.
- **utils**: Management SDK helpers (`getStack`, `getContentTypes`, pagination via `src/config/index.ts`); keep **`handleErrorMsg`** / `process.exit` patterns consistent with existing code.
- **types / config**: Shared types and query limits affect commands and core—align changes with consumers under `src/core` and `src/commands`.
- Build **`managementSDKClient`** when using stack/content-type fetches; use **`ContentstackClient`** from `src/core/contentstack/client.ts` for audit logs and references REST paths.
- **Never log** tokens, `authtoken`, `authorization` headers, or raw management credentials.
- User-facing errors for REST failures should follow **`ContentstackError`** / `buildError` patterns in `client.ts`.
- After changing command IDs, flags, or descriptions, regenerate docs with **`oclif readme`** (see `package.json` `prepack` / `version`).
Full detail: `.cursor/skills/contentstack-cli-content-type/SKILL.md` and `references/` there.