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, presentation fields (--custom-header, --custom-sidebar, --custom-summary, --custom-avatar, --custom-mrql-result) and structural fields (--meta-schema, --section-config). 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
--custom-headerstring``Custom header HTML
--custom-sidebarstring``Custom sidebar HTML
--custom-summarystring``Custom summary HTML
--custom-avatarstring``Custom avatar HTML
--meta-schemastring``Meta schema JSON
--section-configstring``JSON controlling which sections are visible on resource detail pages for this category
--custom-mrql-resultstring``Pongo2 template for rendering resources of this category in MRQL results

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 (uint), Name (string), Description (string), CreatedAt, UpdatedAt

Exit Codes

0 on success; 1 on any error

See Also