Skip to main content

mr resource-category create

Create a new resource category. --name is required; all other flags are optional, including a plain --description, a --custom-* flag for every template slot, and structural fields (--meta-schema, --section-config). Resource categories carry three slots the other carriers do not: --custom-preview (above the built-in preview image), --custom-lightbox (the lightbox details panel), and --custom-cell (an extra column in the resources details table). Run mr resource-category create --help for the full list with a one-line description of where each renders. --custom-css is injected as a <style> block on detail and list pages. On success prints a confirmation line with the new ID; pass the global --json flag to emit the full record for scripting.

Usage

mr resource-category create

Examples

Create a resource category with just a name

mr resource-category create --name "Photos"

Create with a description and capture the ID via jq

ID=$(mr resource-category create --name "Scans" --description "scanned documents" --json | jq -r .ID)

Flags

FlagTypeDefaultDescription
--namestring``Resource category name (required) (required)
--descriptionstring``Resource category description
--meta-schemastring``Meta schema JSON
--section-configstring``JSON controlling which sections are visible on resource detail pages for this category
--custom-headerstring``Rendered at the top of the resource detail page
--custom-detail-footerstring``Rendered at the bottom of the resource detail page, below every built-in section
--custom-sidebarstring``Rendered in the resource detail page sidebar
--custom-summarystring``Rendered on resource cards in list views, below the title
--custom-avatarstring``Replaces the default avatar on resource cards
--custom-hover-cardstring``Rendered in the hover card for a resource link; falls back to --custom-summary when unset
--custom-list-headerstring``Rendered above resource list pages filtered to exactly this resource category, against the resource category itself
--custom-list-footerstring``Rendered below resource list pages filtered to exactly this resource category, against the resource category itself
--custom-mrql-resultstring``Template for rendering resources of this resource category in MRQL results
--custom-cssstring``CSS injected as a <style> block on the resource detail page and its list pages
--custom-previewstring``Rendered above the built-in preview image, for file types it cannot show
--custom-lightboxstring``Rendered in the lightbox details panel; falls back to --custom-sidebar when unset
--custom-cellstring``Rendered as one extra cell per row in the resources details table

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

Created ResourceCategory object with ID, Name, Description, MetaSchema, AutoDetectRules, sectionConfig, CustomHeader/DetailFooter/Sidebar/Preview/Lightbox/Summary/Avatar/HoverCard/Cell/ListHeader/ListFooter/MRQLResult/CSS, CreatedAt, UpdatedAt

Exit Codes

0 on success; 1 on any error

See Also