"Compact" a list of IP prefixes (removing duplicates, merging adjacent ranges).
# go install github.com/x-way/ip_compact@latest
# cat iplist.txt
192.168.4.0/24
192.168.5.0/24
2001:db8::123
192.168.6.0/23
192.168.5.5
2001:db8::123/128
# cat iplist.txt | ip_compact
2001:db8::123/128
192.168.4.0/22