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). --custom-entity-picker-result sets picker result content, and --custom-entity-picker-result-css sets its companion stylesheet. Selection controls remain host-owned. 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.

Use --custom-entity-picker-result-file and --custom-entity-picker-result-css-file for UTF-8 file input. Each is mutually exclusive with its corresponding inline flag. Use resource-category edit --id to update or clear slots later without changing the carrier's identity.

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-header-cssstring``Global CSS for CustomHeader
--custom-detail-footerstring``Rendered at the bottom of the resource detail page, below every built-in section
--custom-detail-footer-cssstring``Global CSS for CustomDetailFooter
--custom-sidebarstring``Rendered in the resource detail page sidebar
--custom-sidebar-cssstring``Global CSS for CustomSidebar
--custom-summarystring``Rendered on resource cards in list views, below the title
--custom-summary-cssstring``Global CSS for CustomSummary
--custom-avatarstring``Replaces the default avatar on resource cards
--custom-avatar-cssstring``Global CSS for CustomAvatar
--custom-hover-cardstring``Rendered in the hover card for a resource link; falls back to --custom-summary when unset
--custom-hover-card-cssstring``Global CSS for CustomHoverCard
--custom-panel-summarystring``Rendered on resource cards inside another entity's detail page panels instead of --custom-summary; falls back to --custom-summary when unset
--custom-panel-summary-cssstring``Global CSS for CustomPanelSummary
--custom-list-headerstring``Rendered above resource list pages filtered to exactly this resource category, against the resource category itself
--custom-list-header-cssstring``Global CSS for CustomListHeader
--custom-list-footerstring``Rendered below resource list pages filtered to exactly this resource category, against the resource category itself
--custom-list-footer-cssstring``Global CSS for CustomListFooter
--custom-mrql-resultstring``Template for rendering resources of this resource category in MRQL results
--custom-mrql-result-cssstring``Global CSS for CustomMRQLResult
--custom-entity-picker-resultstring``Template for resource content inside an entity picker result
--custom-entity-picker-result-filestring``Read --custom-entity-picker-result from a UTF-8 file (mutually exclusive with the inline flag)
--custom-entity-picker-result-cssstring``Global CSS for CustomEntityPickerResult
--custom-entity-picker-result-css-filestring``Read --custom-entity-picker-result-css from a UTF-8 file (mutually exclusive with the inline flag)
--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-preview-cssstring``Global CSS for CustomPreview
--custom-lightboxstring``Rendered in the lightbox details panel; falls back to --custom-sidebar when unset
--custom-lightbox-cssstring``Global CSS for CustomLightbox
--custom-cellstring``Rendered as one extra cell per row in the resources details table
--custom-cell-cssstring``Global CSS for CustomCell

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/PanelSummary/Cell/ListHeader/ListFooter/MRQLResult/EntityPickerResult/EntityPickerResultCSS/CSS, CreatedAt, UpdatedAt

Exit Codes​

0 on success; 1 on any error

See Also​