Skip to main content

mr tags merge

Merge one or more "loser" tags into a single "winner". The winner's ID and name are preserved; Resources, Notes, and Groups previously tagged with any loser are re-tagged with the winner; the loser tag rows are then deleted. Each loser's Meta is folded into the winner's, with the winner's own keys winning on conflict, and a JSON backup of every loser is stored under backups in the winner's Meta. Use to consolidate duplicate or redundant tags (e.g., photo and photos) without losing associations.

Usage

mr tags merge

Examples

Merge tags 2 and 3 into winner 1

mr tags merge --winner 1 --losers 2,3

Merge the result of a filter

mr tags merge --winner 1 --losers $(mr tags list --name "dup-" --json | jq -r 'map(.ID) | join(",")')

Flags

FlagTypeDefaultDescription
--winneruint0Winning tag ID (required) (required)
--losersstring``Comma-separated loser tag IDs (required) (required)

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)

Exit Codes

0 on success; 1 on any error

See Also