Skip to content

Commit cbae7a9

Browse files
committed
v4.0.13
1 parent ff99901 commit cbae7a9

5 files changed

Lines changed: 120 additions & 27 deletions

File tree

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "4.0.12"
5+
"version": "4.0.13"
66
}

packages/cli-legacy/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@datocms/cli",
3-
"version": "4.0.12",
3+
"version": "4.0.13",
44
"description": "Legacy scoped alias for the `datocms` package",
55
"author": "Stefano Verna <s.verna@datocms.com>",
66
"bin": {
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@oclif/core": "^4",
27-
"datocms": "^4.0.12"
27+
"datocms": "^4.0.13"
2828
},
2929
"oclif": {
3030
"bin": "datocms",

packages/cli/README.md

Lines changed: 111 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ USAGE
6565
* [`datocms plugins:update`](#datocms-pluginsupdate)
6666
* [`datocms projects:list [QUERY]`](#datocms-projectslist-query)
6767
* [`datocms schema:generate FILENAME`](#datocms-schemagenerate-filename)
68+
* [`datocms schema:inspect [FILTER]`](#datocms-schemainspect-filter)
6869
* [`datocms unlink`](#datocms-unlink)
6970
* [`datocms whoami`](#datocms-whoami)
7071

@@ -161,7 +162,7 @@ EXAMPLES
161162
$ datocms cma:call items list --environment my-environment
162163
```
163164

164-
_See code: [src/commands/cma/call.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/cma/call.ts)_
165+
_See code: [src/commands/cma/call.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/cma/call.ts)_
165166

166167
## `datocms cma:docs [RESOURCE] [ACTION]`
167168

@@ -199,7 +200,7 @@ EXAMPLES
199200
$ datocms cma:docs items create --expand "Example: Basic example"
200201
```
201202

202-
_See code: [src/commands/cma/docs.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/cma/docs.ts)_
203+
_See code: [src/commands/cma/docs.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/cma/docs.ts)_
203204

204205
## `datocms cma:script [FILE]`
205206

@@ -261,6 +262,9 @@ DESCRIPTION
261262
262263
Source validation (both modes):
263264
- Explicit `any` / `unknown` types are rejected. Use specific types.
265+
- Casts to `never` (e.g. `x as never`, `<never>x`) are rejected.
266+
- `@ts-ignore`, `@ts-expect-error`, and `@ts-nocheck` directives are
267+
rejected — fix the underlying type error instead.
264268
- File-mode: script must have a default export; top-level is rejected.
265269
- Stdin-mode: script must be top-level; default export is rejected.
266270
@@ -316,7 +320,7 @@ EXAMPLES
316320
'.[].api_key'
317321
```
318322

319-
_See code: [src/commands/cma/script.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/cma/script.ts)_
323+
_See code: [src/commands/cma/script.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/cma/script.ts)_
320324

321325
## `datocms environments:destroy ENVIRONMENT_ID`
322326

@@ -344,7 +348,7 @@ DESCRIPTION
344348
Destroys a sandbox environment
345349
```
346350

347-
_See code: [src/commands/environments/destroy.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/environments/destroy.ts)_
351+
_See code: [src/commands/environments/destroy.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/environments/destroy.ts)_
348352

349353
## `datocms environments:fork SOURCE_ENVIRONMENT_ID NEW_ENVIRONMENT_ID`
350354

@@ -379,7 +383,7 @@ DESCRIPTION
379383
Creates a new sandbox environment by forking an existing one
380384
```
381385

382-
_See code: [src/commands/environments/fork.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/environments/fork.ts)_
386+
_See code: [src/commands/environments/fork.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/environments/fork.ts)_
383387

384388
## `datocms environments:list`
385389

@@ -404,7 +408,7 @@ DESCRIPTION
404408
Lists primary/sandbox environments of a project
405409
```
406410

407-
_See code: [src/commands/environments/list.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/environments/list.ts)_
411+
_See code: [src/commands/environments/list.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/environments/list.ts)_
408412

409413
## `datocms environments:primary`
410414

@@ -429,7 +433,7 @@ DESCRIPTION
429433
Returns the name the primary environment of a project
430434
```
431435

432-
_See code: [src/commands/environments/primary.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/environments/primary.ts)_
436+
_See code: [src/commands/environments/primary.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/environments/primary.ts)_
433437

434438
## `datocms environments:promote ENVIRONMENT_ID`
435439

@@ -457,7 +461,7 @@ DESCRIPTION
457461
Promotes a sandbox environment to primary
458462
```
459463

460-
_See code: [src/commands/environments/promote.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/environments/promote.ts)_
464+
_See code: [src/commands/environments/promote.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/environments/promote.ts)_
461465

462466
## `datocms environments:rename ENVIRONMENT_ID NEW_ENVIRONMENT_ID`
463467

@@ -486,7 +490,7 @@ DESCRIPTION
486490
Renames an environment
487491
```
488492

489-
_See code: [src/commands/environments/rename.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/environments/rename.ts)_
493+
_See code: [src/commands/environments/rename.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/environments/rename.ts)_
490494

491495
## `datocms help [COMMAND]`
492496

@@ -537,7 +541,7 @@ DESCRIPTION
537541
Link the current directory to a DatoCMS project and configure it
538542
```
539543

540-
_See code: [src/commands/link.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/link.ts)_
544+
_See code: [src/commands/link.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/link.ts)_
541545

542546
## `datocms login`
543547

@@ -557,7 +561,7 @@ EXAMPLES
557561
$ datocms login
558562
```
559563

560-
_See code: [src/commands/login.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/login.ts)_
564+
_See code: [src/commands/login.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/login.ts)_
561565

562566
## `datocms logout`
563567

@@ -577,7 +581,7 @@ EXAMPLES
577581
$ datocms logout
578582
```
579583

580-
_See code: [src/commands/logout.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/logout.ts)_
584+
_See code: [src/commands/logout.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/logout.ts)_
581585

582586
## `datocms maintenance:off`
583587

@@ -602,7 +606,7 @@ DESCRIPTION
602606
Take a project out of maintenance mode
603607
```
604608

605-
_See code: [src/commands/maintenance/off.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/maintenance/off.ts)_
609+
_See code: [src/commands/maintenance/off.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/maintenance/off.ts)_
606610

607611
## `datocms maintenance:on`
608612

@@ -630,7 +634,7 @@ DESCRIPTION
630634
Put a project in maintenance mode
631635
```
632636

633-
_See code: [src/commands/maintenance/on.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/maintenance/on.ts)_
637+
_See code: [src/commands/maintenance/on.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/maintenance/on.ts)_
634638

635639
## `datocms migrations:new NAME`
636640

@@ -680,7 +684,7 @@ DESCRIPTION
680684
Create a new migration script
681685
```
682686

683-
_See code: [src/commands/migrations/new.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/migrations/new.ts)_
687+
_See code: [src/commands/migrations/new.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/migrations/new.ts)_
684688

685689
## `datocms migrations:run`
686690

@@ -723,7 +727,7 @@ DESCRIPTION
723727
Run migration scripts that have not run yet
724728
```
725729

726-
_See code: [src/commands/migrations/run.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/migrations/run.ts)_
730+
_See code: [src/commands/migrations/run.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/migrations/run.ts)_
727731

728732
## `datocms plugins`
729733

@@ -810,7 +814,7 @@ DESCRIPTION
810814
Lists official DatoCMS CLI plugins
811815
```
812816

813-
_See code: [src/commands/plugins/available.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/plugins/available.ts)_
817+
_See code: [src/commands/plugins/available.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/plugins/available.ts)_
814818

815819
## `datocms plugins:inspect PLUGIN...`
816820

@@ -1064,7 +1068,7 @@ EXAMPLES
10641068
$ datocms projects:list --json
10651069
```
10661070

1067-
_See code: [src/commands/projects/list.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/projects/list.ts)_
1071+
_See code: [src/commands/projects/list.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/projects/list.ts)_
10681072

10691073
## `datocms schema:generate FILENAME`
10701074

@@ -1096,7 +1100,93 @@ DESCRIPTION
10961100
Generate TypeScript definitions for the schema
10971101
```
10981102

1099-
_See code: [src/commands/schema/generate.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/schema/generate.ts)_
1103+
_See code: [src/commands/schema/generate.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/schema/generate.ts)_
1104+
1105+
## `datocms schema:inspect [FILTER]`
1106+
1107+
Inspect DatoCMS models and modular blocks — emits JSON with models, fields, fieldsets, nested blocks, and relationships.
1108+
1109+
```
1110+
USAGE
1111+
$ datocms schema:inspect [FILTER] [--json] [--config-file <value>] [--profile <value>] [--api-token <value>]
1112+
[--log-level NONE|BASIC|BODY|BODY_AND_HEADERS] [--log-mode stdout|file|directory] [-e <value>] [--type
1113+
all|models_only|blocks_only] [--fields-details basic|complete] [--include-validators] [--include-appearance]
1114+
[--include-default-values] [--include-fieldsets] [--include-nested-blocks] [--include-referenced-models]
1115+
[--include-embedding-models]
1116+
1117+
ARGUMENTS
1118+
[FILTER] Filter by API key, ID, or display name. Falls back to fuzzy search if no exact match is found. If omitted,
1119+
all models/blocks are returned.
1120+
1121+
FLAGS
1122+
-e, --environment=<value> Environment to inspect
1123+
--fields-details=<option> [default: basic] Level of detail returned for each field. `basic` drops validators,
1124+
appearance, and default values; `complete` includes everything (very verbose). For
1125+
selective inclusion use the `--include-*` flags instead.
1126+
<options: basic|complete>
1127+
--include-appearance Include field appearance configuration
1128+
--include-default-values Include field default values
1129+
--include-embedding-models For blocks only: include every model that embeds the selected blocks (direct or
1130+
transitive)
1131+
--include-fieldsets Include UI fieldset organization
1132+
--include-nested-blocks Recursively include every block nested in the selected item types
1133+
--include-referenced-models Include models referenced by link, links, or structured_text fields
1134+
--include-validators Include field validators
1135+
--type=<option> [default: all] Restrict to models, blocks, or both
1136+
<options: all|models_only|blocks_only>
1137+
1138+
GLOBAL FLAGS
1139+
--api-token=<value> Specify a custom API key to access a DatoCMS project
1140+
--config-file=<value> [default: ./datocms.config.json, env: DATOCMS_CONFIG_FILE] Specify a custom config file path
1141+
--json Format output as json.
1142+
--log-level=<option> Level of logging for performed API calls
1143+
<options: NONE|BASIC|BODY|BODY_AND_HEADERS>
1144+
--log-mode=<option> Where logged output should be written to
1145+
<options: stdout|file|directory>
1146+
--profile=<value> [env: DATOCMS_PROFILE] Use settings of profile in datocms.config.js
1147+
1148+
DESCRIPTION
1149+
Inspect DatoCMS models and modular blocks — emits JSON with models, fields, fieldsets, nested blocks, and
1150+
relationships.
1151+
1152+
Without arguments, lists every model and block in the project. Pass a
1153+
filter to narrow down by API key (e.g. "blog_post"), ID, or display
1154+
name; if no exact match is found a fuzzy search is used.
1155+
1156+
By default, fields are returned without validators, appearance, or
1157+
default values. Use `--include-validators`, `--include-appearance`,
1158+
`--include-default-values`, or `--fields-details=complete` to opt in.
1159+
1160+
Output is TOON on stdout (compact, agent-friendly). Pass `--json` for
1161+
JSON output that composes with `| jq` and similar.
1162+
1163+
EXAMPLES
1164+
List every model and block in the project
1165+
1166+
$ datocms schema:inspect
1167+
1168+
Inspect a single model by API key
1169+
1170+
$ datocms schema:inspect blog_post
1171+
1172+
Only modular blocks, with fieldsets
1173+
1174+
$ datocms schema:inspect --type=blocks_only --include-fieldsets
1175+
1176+
Include validators and appearance for the given model
1177+
1178+
$ datocms schema:inspect blog_post --include-validators --include-appearance
1179+
1180+
Full detail (verbose), piped through jq
1181+
1182+
$ datocms schema:inspect blog_post --fields-details=complete --json | jq '.[].fields[].api_key'
1183+
1184+
Inspect a block plus every model that embeds it (directly or indirectly)
1185+
1186+
$ datocms schema:inspect my_block --type=blocks_only --include-embedding-models
1187+
```
1188+
1189+
_See code: [src/commands/schema/inspect.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/schema/inspect.ts)_
11001190

11011191
## `datocms unlink`
11021192

@@ -1117,7 +1207,7 @@ DESCRIPTION
11171207
Unlink the current directory from a DatoCMS project
11181208
```
11191209

1120-
_See code: [src/commands/unlink.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/unlink.ts)_
1210+
_See code: [src/commands/unlink.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/unlink.ts)_
11211211

11221212
## `datocms whoami`
11231213

@@ -1137,5 +1227,5 @@ EXAMPLES
11371227
$ datocms whoami
11381228
```
11391229

1140-
_See code: [src/commands/whoami.ts](https://github.com/datocms/cli/blob/v4.0.12/packages/cli/src/commands/whoami.ts)_
1230+
_See code: [src/commands/whoami.ts](https://github.com/datocms/cli/blob/v4.0.13/packages/cli/src/commands/whoami.ts)_
11411231
<!-- commandsstop -->

packages/cli/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "datocms",
3-
"version": "4.0.12",
3+
"version": "4.0.13",
44
"description": "CLI to interact with DatoCMS APIs",
55
"author": "Stefano Verna <s.verna@datocms.com>",
66
"bin": {
@@ -87,7 +87,10 @@
8787
"node": ">=18.0.0"
8888
},
8989
"bugs": "https://github.com/datocms/cli/issues",
90-
"keywords": ["datocms", "cli"],
90+
"keywords": [
91+
"datocms",
92+
"cli"
93+
],
9194
"types": "lib/index.d.ts",
9295
"gitHead": "09f72bd8742b2933271407559d9fbcc235662876",
9396
"devDependencies": {

0 commit comments

Comments
 (0)