IP address aggregation and expansion
Find a file
2026-04-21 09:41:18 +02:00
.claude chore: move CLAUDE.md into .claude/ and keep it tracked 2026-04-21 09:41:18 +02:00
internal/cmd cleanup: remove obvious comments, stale attribution, and unused parameter 2026-04-08 13:38:21 +02:00
.gitignore chore: move CLAUDE.md into .claude/ and keep it tracked 2026-04-21 09:41:18 +02:00
CREDITS credits: add Claude (Anthropic) as co-developer 2026-04-08 13:56:35 +02:00
go.mod new: use cobra 2026-03-26 16:59:57 +01:00
go.sum new: use cobra 2026-03-26 16:59:57 +01:00
main.go doc: tidy 2026-04-01 15:58:42 +02:00
README.md docs: add README with overview, install, and command examples 2026-04-21 09:38:54 +02:00

ipa

A small CLI tool for IP address set operations: expand CIDRs, aggregate lists into minimal CIDR blocks, add/merge sets, subtract sets, and visualize bit-level differences between addresses.

Works with both IPv4 and IPv6 (kept strictly separated in output).

Install

go install go.schlittermann.de/heiko/ipa@latest

Or build from source:

git clone https://git.schlittermann.de/heiko/ipa
cd ipa
go build -o ipa .

Commands

Command Purpose
expand Expand CIDR ranges into individual IP addresses
aggregate Merge IPs/CIDRs into the smallest equivalent set of prefixes
add Combine multiple IP lists and aggregate the union
remove Subtract IPs/CIDRs of later files from the first file
diff Visualize bit-level differences between two IPs/CIDRs

Each command reads from STDIN or from files, writes results to STDOUT, and tolerates trailing comments on input lines (only the first whitespace-delimited field is used).

Examples

echo 192.0.2.0/30 | ipa expand
# 192.0.2.0
# 192.0.2.1
# 192.0.2.2
# 192.0.2.3

printf '10.0.0.0/25\n10.0.0.128/25\n' | ipa aggregate
# 10.0.0.0/24

ipa add listA.txt listB.txt
ipa remove all.txt blocked.txt
ipa diff 2001:db8::1 2001:db8::ff

License

Apache-2.0