Skip to main content

mr category create

Create a new Category. --name is required; --description is optional free-form text. The optional --custom-header, --custom-sidebar, --custom-summary, --custom-avatar, and --custom-mrql-result flags accept template or HTML strings applied to Groups assigned to this category. --meta-schema and --section-config take JSON strings controlling structured metadata and which sections render on group detail 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 category create

Examples

Create a category with just a name

mr category create --name "Project"

Create with a description and capture the ID via jq

ID=$(mr category create --name "Location" --description "Places you know about" --json | jq -r .ID)

Flags

FlagTypeDefaultDescription
--namestring``Category name (required) (required)
--descriptionstring``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 group detail pages for this category
--custom-mrql-resultstring``Pongo2 template for rendering groups 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 Category object with ID (uint), Name (string), Description (string), CreatedAt, UpdatedAt

Exit Codes

0 on success; 1 on any error

See Also