A quick and dirty cli for ipnetdb formed from the example code of mmdb 1 and altered to lookup up prefixes or asns.
git submodule init
git submodule update
make
make install
The tool and databases will be installed under ~/.local
Multiple keys can be given on the command line
[bishop@xps13 ipnetdb]$ ipnetdb 1.1.1.1 4.2.2.1 8.8.8.8 | jq -c '[.as, .as_name, .allocation]'
[13335,"CLOUDFLARENET","1.1.1.0/24"]
[3356,"LEVEL3","4.0.0.0/9"]
[15169,"GOOGLE","8.0.0.0/9"]
[bishop@xps13 ipnetdb]$ ./ipnetdb 13335 3356 15169 | jq -c '[.as, .entity]'
[13335,"Cloudflare, Inc."]
[3356,"Level 3 Parent, LLC"]
[15169,"Google LLC"]