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
| Flag | Type | Default | Description |
|---|---|---|---|
--name | string | `` | Resource category name (required) (required) |
--description | string | `` | Resource category description |
--meta-schema | string | `` | Meta schema JSON |
--section-config | string | `` | JSON controlling which sections are visible on resource detail pages for this category |
--custom-header | string | `` | Rendered at the top of the resource detail page |
--custom-header-css | string | `` | Global CSS for CustomHeader |
--custom-detail-footer | string | `` | Rendered at the bottom of the resource detail page, below every built-in section |
--custom-detail-footer-css | string | `` | Global CSS for CustomDetailFooter |
--custom-sidebar | string | `` | Rendered in the resource detail page sidebar |
--custom-sidebar-css | string | `` | Global CSS for CustomSidebar |
--custom-summary | string | `` | Rendered on resource cards in list views, below the title |
--custom-summary-css | string | `` | Global CSS for CustomSummary |
--custom-avatar | string | `` | Replaces the default avatar on resource cards |
--custom-avatar-css | string | `` | Global CSS for CustomAvatar |
--custom-hover-card | string | `` | Rendered in the hover card for a resource link; falls back to --custom-summary when unset |
--custom-hover-card-css | string | `` | Global CSS for CustomHoverCard |
--custom-panel-summary | string | `` | 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-css | string | `` | Global CSS for CustomPanelSummary |
--custom-list-header | string | `` | Rendered above resource list pages filtered to exactly this resource category, against the resource category itself |
--custom-list-header-css | string | `` | Global CSS for CustomListHeader |
--custom-list-footer | string | `` | Rendered below resource list pages filtered to exactly this resource category, against the resource category itself |
--custom-list-footer-css | string | `` | Global CSS for CustomListFooter |
--custom-mrql-result | string | `` | Template for rendering resources of this resource category in MRQL results |
--custom-mrql-result-css | string | `` | Global CSS for CustomMRQLResult |
--custom-entity-picker-result | string | `` | Template for resource content inside an entity picker result |
--custom-entity-picker-result-file | string | `` | Read --custom-entity-picker-result from a UTF-8 file (mutually exclusive with the inline flag) |
--custom-entity-picker-result-css | string | `` | Global CSS for CustomEntityPickerResult |
--custom-entity-picker-result-css-file | string | `` | Read --custom-entity-picker-result-css from a UTF-8 file (mutually exclusive with the inline flag) |
--custom-css | string | `` | CSS injected as a <style> block on the resource detail page and its list pages |
--custom-preview | string | `` | Rendered above the built-in preview image, for file types it cannot show |
--custom-preview-css | string | `` | Global CSS for CustomPreview |
--custom-lightbox | string | `` | Rendered in the lightbox details panel; falls back to --custom-sidebar when unset |
--custom-lightbox-css | string | `` | Global CSS for CustomLightbox |
--custom-cell | string | `` | Rendered as one extra cell per row in the resources details table |
--custom-cell-css | string | `` | Global CSS for CustomCell |
Inherited global flags
| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Output raw JSON |
--no-header | bool | false | Omit table headers |
--page | int | 1 | Page number for list commands (default page size: 50) |
--quiet | bool | false | Only output IDs |
--server | string | http://localhost:8181 | mahresources 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