Skip to main content

mr relation-types list

List RelationTypes, optionally filtered. --name and --description do substring matches on those fields. Pagination via the global --page flag (default page size 50). Use the JSON output to feed scripted workflows: look up a type ID by name and pass it to mr relation create --relation-type-id <id>.

Usage

mr relation-types list

Examples

List all relation types (paged)

mr relation-types list

Filter by name substring

mr relation-types list --name references

JSON output + jq to extract the ID for a known name

mr relation-types list --name "depends-on" --json | jq -r '.[0].ID'

Flags

FlagTypeDefaultDescription
--namestring``Filter by name
--descriptionstring``Filter by description

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

Array of relation types with ID, Name, Description, FromCategoryId, ToCategoryId, CreatedAt

Exit Codes

0 on success; 1 on any error

See Also