martindstone / pagerduty-cli

A command line interface for PagerDuty
MIT License
91 stars 13 forks source link

Add/Remove Tags from a Resource #27

Open n8price opened 2 years ago

n8price commented 2 years ago

It would be great to have the ability to remove a tag from all connected entities or add a tag to an entity. Ideally I would love to be able to pipe a list of team resource ids to set or remove a tag.

martindstone commented 2 years ago

Hi @n8price it makes sense. I have added some tag commands to v0.1.3 that I would like you to check out. If you have a self-updatable installation of pd, you can do pd update rc to get it; if you installed using npm, something like npm i -g pagerduty-cli@0.1.3 should do the trick. The commands are tag:list, tag:assign and tag:listobjects. Tag:assign can add/remove multiple tags from multiple entities of multiple types in one go. It's not yet amenable to pipes but what I will do if this functionality seems complete enough is add some shim commands to user, ep, team, like user:tag:add etc. that will take pipes and call tag:assign with proper argument lists. Let me know what you think... Thanks!

n8price commented 2 years ago

Hey this is wonderful! Thanks so much. I'll check it out. Sorry for the delay in reply.

n8price commented 1 year ago

This works great! Would love the shim command like team:tag:add or team:tag:remove 🥇