diff --git a/src/commands/field-add-content-relationship.ts b/src/commands/field-add-content-relationship.ts index 25d4aab..4a33e70 100644 --- a/src/commands/field-add-content-relationship.ts +++ b/src/commands/field-add-content-relationship.ts @@ -33,6 +33,16 @@ const config = { supported for fields inside groups (e.g. --field authors.name). `, + EXAMPLES: ` + Allow any document: + prismic field add content-relationship author --to-type blog_post + + Restrict to a specific type: + prismic field add content-relationship category --to-type blog_post --custom-type blog_category + + Fetch fields from the related document: + prismic field add content-relationship author --to-type blog_post --custom-type author --field name --field bio + `, }, positionals: { id: { description: "Field ID", required: true }, diff --git a/src/commands/field-add-link.ts b/src/commands/field-add-link.ts index b28bb26..3a8a1ad 100644 --- a/src/commands/field-add-link.ts +++ b/src/commands/field-add-link.ts @@ -11,6 +11,18 @@ const config = { name: "prismic field add link", description: "Add a link field to a slice or custom type. Use for navigational links to URLs, documents, or media. For data-level relations between documents, use content-relationship instead.", + sections: { + EXAMPLES: ` + Add a link that opens in a new tab: + prismic field add link cta --to-type landing_page --allow-target-blank + + Restrict to media links only: + prismic field add link download --to-type blog_post --allow media + + Add a repeatable link with custom text: + prismic field add link nav_item --to-type navigation --repeatable --allow-text + `, + }, positionals: { id: { description: "Field ID", required: true }, }, diff --git a/src/commands/field-add-rich-text.ts b/src/commands/field-add-rich-text.ts index 61d4a65..181207a 100644 --- a/src/commands/field-add-rich-text.ts +++ b/src/commands/field-add-rich-text.ts @@ -19,6 +19,13 @@ const config = { paragraph, strong, em, preformatted, hyperlink, image, embed, list-item, o-list-item, rtl `, + EXAMPLES: ` + Add a title field (single heading): + prismic field add rich-text title --to-type blog_post --allow heading1 --single + + Add a body field with only headings and paragraphs: + prismic field add rich-text body --to-type blog_post --allow heading1,heading2,paragraph,strong,em,hyperlink + `, }, positionals: { id: { description: "Field ID", required: true }, diff --git a/src/commands/field-add-select.ts b/src/commands/field-add-select.ts index 949d946..9e2faa4 100644 --- a/src/commands/field-add-select.ts +++ b/src/commands/field-add-select.ts @@ -10,6 +10,15 @@ import { getRepositoryName } from "../project"; const config = { name: "prismic field add select", description: "Add a select field to a slice or custom type.", + sections: { + EXAMPLES: ` + Add a select with options: + prismic field add select theme --to-type landing_page --option light --option dark --option brand + + With a default value: + prismic field add select layout --to-type landing_page --option full --option centered --option sidebar --default-value full + `, + }, positionals: { id: { description: "Field ID", required: true }, }, diff --git a/src/commands/field-edit.ts b/src/commands/field-edit.ts index 648f081..96450d3 100644 --- a/src/commands/field-edit.ts +++ b/src/commands/field-edit.ts @@ -18,6 +18,16 @@ const config = { type will be applied. See \`prismic field add --help\` for type-specific option details. `, + EXAMPLES: ` + Rename a field's label: + prismic field edit title --from-type blog_post --label "Page Title" + + Change a select field's options: + prismic field edit theme --from-type landing_page --option light --option dark + + Restrict a rich text field to a single block: + prismic field edit subtitle --from-type blog_post --single + `, }, positionals: { id: { description: "Field ID", required: true }, diff --git a/src/commands/slice-connect.ts b/src/commands/slice-connect.ts index 1d8b40e..8553493 100644 --- a/src/commands/slice-connect.ts +++ b/src/commands/slice-connect.ts @@ -10,6 +10,15 @@ import { getRepositoryName } from "../project"; const config = { name: "prismic slice connect", description: "Connect a slice to a type's slice zone.", + sections: { + EXAMPLES: ` + Connect a slice to a type's default slice zone: + prismic slice connect hero --to blog_post + + Connect to a named slice zone: + prismic slice connect hero --to blog_post --slice-zone page_slices + `, + }, positionals: { id: { description: "ID of the slice", required: true }, }, diff --git a/src/commands/type-create.ts b/src/commands/type-create.ts index db6f364..830c84d 100644 --- a/src/commands/type-create.ts +++ b/src/commands/type-create.ts @@ -33,6 +33,16 @@ const config = { page). Includes a slice zone and SEO & Metadata tab by default, and configures a route in prismic.config.json. `, + EXAMPLES: ` + Create a page type: + prismic type create "Blog Post" --format page + + Create a singleton custom type: + prismic type create Settings --single + + Create with a custom ID: + prismic type create "Landing Page" --format page --id landing + `, }, } satisfies CommandConfig; diff --git a/src/commands/webhook-create.ts b/src/commands/webhook-create.ts index 19c15f8..6db83ac 100644 --- a/src/commands/webhook-create.ts +++ b/src/commands/webhook-create.ts @@ -37,6 +37,16 @@ const config = { If no triggers specified, all are enabled. `, + EXAMPLES: ` + Create a webhook for all events: + prismic webhook create https://example.com/webhook + + Create a webhook for specific events: + prismic webhook create https://example.com/webhook -t documentsPublished -t documentsUnpublished + + Create a named webhook with a secret: + prismic webhook create https://example.com/webhook --name "Deploy" --secret my-secret + `, }, } satisfies CommandConfig;