Skip to content

Commit 5b8a5e5

Browse files
authored
Improve strapi-generate docs further (#2595)
Expands upon PR #2593
1 parent 5178d0b commit 5b8a5e5

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docusaurus/docs/cms/cli.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ Generated files include commented examples. Singular and plural names must be di
357357

358358
### API generator
359359

360-
Creates an API with controller and service files.
360+
Creates an API with [controller](/cms/backend-customization/controllers) and [service](/cms/backend-customization/services) files.
361361

362362
**Generated file:** `controllers/[name].js|ts`, `services/[name].js|ts`, and `routes/[name].js|ts` (standard APIs only)
363363

@@ -396,55 +396,59 @@ Creates a content type schema with optional API files.
396396

397397
### Controller generator
398398

399-
Creates a controller file with basic action structure.
399+
Creates a [controller](/cms/backend-customization/controllers) file with basic action structure.
400400

401401
**Generated file:** `controllers/[name].js|ts`
402402

403403
### Service generator
404404

405-
Creates a service file with basic structure.
405+
Creates a [service](/cms/backend-customization/services) file with basic structure.
406406

407407
**Generated file:** `services/[name].js|ts`
408408

409409
### Policy generator
410410

411-
Creates a policy file for access control.
411+
Creates a [policy](/cms/backend-customization/policies) file for access control.
412412

413413
**Generated file:** `policies/[name].js|ts`
414414

415415
### Middleware generator
416416

417-
Creates a middleware file for request processing.
417+
Creates a [middleware](/cms/backend-customization/middlewares) file for request processing.
418418

419419
**Generated file:** `middlewares/[name].js|ts`
420420

421421
### Migration generator
422422

423-
Creates a timestamped migration file.
423+
Creates a timestamped [migration](/cms/database-migrations) file.
424424

425425
**Generated file:** `database/migrations/[timestamp].[name].js|ts`
426426

427427
### Configuration options
428428

429-
<br/>
429+
The `strapi generate` interactive CLI may offer various configuration options depending on the chosen Strapi element to generate:
430430

431431
#### Destination choices
432432

433+
When creating a content-type, controller, policy, middleware, or service, you can choose its destination:
434+
433435
| Option | Description |
434436
|--------|-------------|
435437
| **New API** | Creates a new API folder |
436438
| **Existing API** | Adds to existing API folder |
437439
| **Existing plugin** | Adds to existing plugin folder |
438440
| **Root** | Adds to project root (policies and middlewares only) |
439441

440-
#### Content type options
442+
#### Content-type specific options
443+
444+
When creating a content-type, you can choose to create a collection type or a single type (see [Content-Type Builder](/cms/features/content-type-builder) documentation for differences):
441445

442446
| Type | Description | Example |
443447
|------|-------------|---------|
444448
| **Collection Type** | Multiple entries | Articles, users |
445449
| **Single Type** | Single entry | Homepage, settings |
446450

447-
#### Content type naming
451+
You will also have to define various types of names. The following table explains their differences. Only the display name needs to be manually defined, and you can press Enter to accept the default suggested name for the singular and plural names. Singular and plural names matter for API endpoints (see [REST API](/cms/api/rest#endpoints) documentation for details):
448452

449453
| Field | Format | Description | Example |
450454
|-------|--------|-------------|---------|

0 commit comments

Comments
 (0)