{"id":13561274,"url":"https://github.com/ipinfo/cli","last_synced_at":"2025-05-15T07:04:36.491Z","repository":{"id":41264151,"uuid":"306538237","full_name":"ipinfo/cli","owner":"ipinfo","description":"Official Command Line Interface for the IPinfo API (IP geolocation and other types of IP data)","archived":false,"fork":false,"pushed_at":"2024-08-14T00:40:19.000Z","size":19761,"stargazers_count":1851,"open_issues_count":11,"forks_count":160,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-08T00:14:14.560Z","etag":null,"topics":["cli","golang","ip-address","ip-data","ip-geolocation","ip-lookup","ipinfo"],"latest_commit_sha":null,"homepage":"https://ipinfo.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipinfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-23T05:31:55.000Z","updated_at":"2025-05-07T14:47:02.000Z","dependencies_parsed_at":"2023-10-10T14:09:57.611Z","dependency_job_id":"e6475f80-d57e-4050-b771-f90f281cdafb","html_url":"https://github.com/ipinfo/cli","commit_stats":{"total_commits":693,"total_committers":30,"mean_commits":23.1,"dds":0.7402597402597403,"last_synced_commit":"8ef8941648d75980bcbf9e05db978173aa94dd9e"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipinfo","download_url":"https://codeload.github.com/ipinfo/cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292039,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","golang","ip-address","ip-data","ip-geolocation","ip-lookup","ipinfo"],"created_at":"2024-08-01T13:00:54.394Z","updated_at":"2025-05-15T07:04:31.468Z","avatar_url":"https://github.com/ipinfo.png","language":"Go","readme":"# [\u003cimg src=\"https://ipinfo.io/static/ipinfo-small.svg\" alt=\"IPinfo\" width=\"24\"/\u003e](https://ipinfo.io/) IPinfo CLI\n\nThis is the official CLI for the [IPinfo.io](https://ipinfo.io) IP address API,\nallowing you to:\n\n- Look up IP details in bulk or one-by-one.\n- Look up ASN details.\n- Summarize the details of up to 1000 IPs at a time.\n- Open a map of IP locations for any set of IPs.\n- Filter IPv4 \u0026 IPv6 addresses from any input.\n- Print out IP lists for any CIDR or IP range.\n- And more!\n\n## Installation\n\nThe `ipinfo` CLI is available for download via multiple mechanisms.\n\n### macOS\n\n```bash\nbrew install ipinfo-cli\n```\n\nOR to install the latest `amd64` version without automatic updates:\n\n```bash\ncurl -Ls https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.1/macos.sh | sh\n```\n\n### Ubuntu PPA\n\n_Note_: this installs our full suite of binaries and keeps them up-to-date.\n\n```bash\necho \"deb [trusted=yes] https://ppa.ipinfo.net/ /\" | sudo tee  \"/etc/apt/sources.list.d/ipinfo.ppa.list\"\nsudo apt update\nsudo apt install ipinfo\n```\n\n### Debian / Ubuntu\n\n_Note_: this is a one-time installation; updates are not automatic. Use the PPA\nfor automatic updates.\n\n```bash\ncurl -Ls https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.1/deb.sh | sh\n```\n\nOR\n\n```bash\ncurl -LO https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.1/ipinfo_3.3.1_linux_{arch}.deb\nsudo dpkg -i ipinfo_3.3.1_linux_{arch}.deb\n```\n\nwhere `{arch}` can be 386, amd64, arm, or arm64.\n\n### FreeBSD\n\n```bash\ncd /usr/ports/net/ipinfo-cli \u0026\u0026 make install clean\n```\n\n### Arch linux\n\n```bash\ngit clone https://aur.archlinux.org/ipinfo-cli.git\nmakepkg -si\n```\n\n### Windows Powershell\n\n_Note_: run powershell as administrator before executing this command.\n\n```bash\niwr -useb https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.1/windows.ps1 | iex\n```\n\n### Scoop\n\n```bash\nscoop install ipinfo-cli\n```\n\n### Docker\n\n```bash\ndocker run --rm -it ipinfo/ipinfo:3.3.1\n```\n\nTo save the CLI's config, add `-v \"/path_to_config:/root/.config/ipinfo\"`. For\nexample, the following command saves the config to the `ipinfo` directory in\nthe current working directory.\n\n```bash\ndocker run --rm -it -v \"$PWD/ipinfo:/root/.config/ipinfo\" ipinfo/ipinfo:3.3.1\n```\n\n### Using `go install`\n\nMake sure that `$GOPATH/bin` is in your `$PATH`, because that's where this gets\ninstalled:\n\n```bash\ngo install github.com/ipinfo/cli/ipinfo@latest\n```\n\n### Using `curl`/`wget`\n\nThe pre-built binaries for all platforms are available on GitHub via artifacts\nin releases. You need to simply download, unpack and move them to your shell's\nbinary search path.\n\nThe following OS \u0026 arch combinations are supported (if you use one not listed\non here, please open an issue):\n\n```\ndarwin_amd64\ndarwin_arm64\ndragonfly_amd64\nfreebsd_386\nfreebsd_amd64\nfreebsd_arm\nfreebsd_arm64\nlinux_386\nlinux_amd64\nlinux_arm\nlinux_arm64\nnetbsd_386\nnetbsd_amd64\nnetbsd_arm\nnetbsd_arm64\nopenbsd_386\nopenbsd_amd64\nopenbsd_arm\nopenbsd_arm64\nsolaris_amd64\nwindows_386\nwindows_amd64\nwindows_arm\nwindows_arm64\n```\n\nAfter choosing a platform `PLAT` from above, run:\n\n```bash\n# for Windows, use \".zip\" instead of \".tar.gz\"\ncurl -LO https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.1/ipinfo_3.3.1_${PLAT}.tar.gz\n# OR\nwget https://github.com/ipinfo/cli/releases/download/ipinfo-3.3.1/ipinfo_3.3.1_${PLAT}.tar.gz\n\ntar -xvf ipinfo_3.3.1_${PLAT}.tar.gz\nsudo mv ipinfo_3.3.1_${PLAT} /usr/local/bin/ipinfo\n```\n\n### Using `git`\n\nInstalling from source requires at least the Golang version specified in\n`go.mod`. You can install the Golang toolchain from\n[the official site](https://golang.org/doc/install).\n\nOnce the correct Golang version is installed, simply clone the repository and\ninstall the binary:\n\n```bash\ngit clone https://github.com/ipinfo/cli ipinfo-cli\ncd ipinfo-cli\ngo install ./ipinfo/\n$GOPATH/bin/ipinfo\n```\n\nYou can add `$GOPATH/bin` to your `$PATH` to access `ipinfo` directly from\nanywhere.\n\nAlternatively, you can do the following to output the binary somewhere\nspecific:\n\n```bash\ngit clone https://github.com/ipinfo/cli ipinfo-cli\ncd ipinfo-cli\ngo build -o \u003cpath\u003e ./ipinfo/\n```\n\nReplace `\u003cpath\u003e` with the required location.\n\n## Additional CLIs\n\nThe `ipinfo` CLI has some subcommands like `grepip`, `grepdomain`, `matchip`,\n`prips`, `cidr2range`, `cidr2ip`, `range2cidr`, `range2ip`, `splitcidr`,\n`randip` and `mmdb` which are also shipped as standalone binaries.\n\nThese binaries are available via all the **same installation methods** as\nmentioned above for `ipinfo`, except you must change only the name to the name\nof the subcommand, and choose the appropriate version.\n\nCurrently these subcommands are separately shipped:\n\n| CLI        | Version                                                               |\n| ---------- | --------------------------------------------------------------------- |\n| grepip     | [1.2.3](https://github.com/ipinfo/cli/releases/tag/grepip-1.2.3)      |\n| grepdomain | [1.0.0](https://github.com/ipinfo/cli/releases/tag/grepdomain-1.0.0)  |\n| matchip    | [1.0.0](https://github.com/ipinfo/cli/releases/tag/matchip-1.0.0)     |\n| prips      | [1.0.0](https://github.com/ipinfo/cli/releases/tag/prips-1.0.0)       |\n| cidr2range | [1.2.0](https://github.com/ipinfo/cli/releases/tag/cidr2range-1.2.0)  |\n| cidr2ip    | [1.0.0](https://github.com/ipinfo/cli/releases/tag/cidr2ip-1.0.0)     |\n| range2cidr | [1.3.0](https://github.com/ipinfo/cli/releases/tag/range2cidr-1.3.0)  |\n| range2ip   | [1.0.0](https://github.com/ipinfo/cli/releases/tag/range2ip-1.0.0)    |\n| randip     | [1.1.0](https://github.com/ipinfo/cli/releases/tag/randip-1.1.0)      |\n| splitcidr  | [1.0.0](https://github.com/ipinfo/cli/releases/tag/splitcidr-1.0.0)   |\n| mmdb       | [1.4.2](https://github.com/ipinfo/mmdbctl/releases/tag/mmdbctl-1.4.2) |\n\n## Quick Start\n\nThis will help you quickly get started with the `ipinfo` CLI.\n\n### Default Help Message\n\nBy default, invoking the CLI shows a help message:\n\n```bash\nipinfo\n```\n\n![ipinfo](gif/default.gif)\n\n### Login\n\nIf you have a token, log in with it first. You can continue without a token,\nbut there will be limited data output and some features (like bulk lookups)\nwill not be available. Get your token for free at\n[https://ipinfo.io/signup](https://ipinfo.io/signup?ref=cli).\n\n```bash\nipinfo init\n```\n\n### My IP\n\nYou can quickly look up details of your own IP with `myip`:\n\n```bash\nipinfo myip\n```\n\n![ipinfo myip](gif/myip.gif)\n\n### Any IP\n\nYou can see the details of any IP by specifying it:\n\n```bash\nipinfo 8.8.8.8\n```\n\n![ipinfo myip](gif/ip8.8.8.8.gif)\n\n### Piping\n\nYou can pipe IPs in and get their results in bulk (this requires a token):\n\n```bash\ncat ips.txt | ipinfo | less\n```\n\n![cat ips.txt | ipinfo](gif/cat.gif)\n\nHere's the CSV version of that:\n\n```bash\ncat ips.txt | ipinfo -c | less\n```\n\n![cat ips.txt | ipinfo -c](gif/cat-csv.gif)\n\n### Field Filter\n\nIn case you only needed a single field from a bunch of IPs:\n\n```bash\ncat ips.txt | ipinfo -f hostname\n```\n\n![cat ips.txt | ipinfo](gif/hostname.gif)\n\n### Bulk\n\nThe above commands implicitly run the `bulk` subcommand on the input. You can\nmanually specify bulk and input IPs on the command line:\n\n```bash\nipinfo bulk 1.1.1.0/30 8.8.8.0/30 9.9.9.0/30 | less\n```\n\n![ipinfo bulk](gif/bulk.gif)\n\n### Summarize\n\nIP details can be summarized similar to what's provided by\nhttps://ipinfo.io/tools/summarize-ips:\n\n```bash\ncat lk-ips.txt | ipinfo summarize\n```\n\n![ipinfo summarize](gif/summarize.gif)\n\nThere are many more features available, so for full details, consult the `-h`\nor `--help` message for each command. For example:\n\n```bash\nipinfo 8.8.8.8 --help\n```\n\n## Auto-Completion\n\nAuto-completion is supported for at least the following shells:\n\n```\nbash\nzsh\nfish\n```\n\nNOTE: it may work for other shells as well because the implementation is in\nGolang and is not necessarily shell-specific.\n\n### Installation\n\nInstalling auto-completions is as simple as running one command (works for\n`bash`, `zsh` and `fish` shells):\n\n```bash\nipinfo completion install\n```\n\nIf you want to customize the installation process (e.g. in case the\nauto-installation doesn't work as expected), you can request the actual\ncompletion script for each shell:\n\n```bash\n# get bash completion script\nipinfo completion bash\n\n# get zsh completion script\nipinfo completion zsh\n\n# get fish completion script\nipinfo completion fish\n```\n\n### Shell not listed?\n\nIf your shell is not listed here, you can open an issue.\n\nNote that as long as the `COMP_LINE` environment variable is provided to the\nbinary itself, it will output completion results. So if your shell provides a\nway to pass `COMP_LINE` on auto-completion attempts to a binary, then have your\nshell do that with the `ipinfo` binary itself (or any of our binaries).\n\n## Data\n\nThe amount of data you get back per lookup depends upon how much data you have\nenabled on your token via the https://ipinfo.io site.\n\nIf you have an account, see our\n[plans](https://ipinfo.io/account/billing/upgrade) and\n[addons](https://ipinfo.io/account/addons).\n\nAll examples in this document use a token with all data enabled.\n\n## Color Output\n\n### Disabling Color Output\n\nAll our CLIs respect either the `--nocolor` flag or the\n[`NO_COLOR`](https://no-color.org/) environment variable to disable color\noutput.\n\n### Color on Windows\n\nTo enable color support for the Windows command prompt, run the following to\nenable [`Console Virtual Terminal Sequences`](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences).\n\n```cmd\nREG ADD HKCU\\CONSOLE /f /v VirtualTerminalLevel /t REG_DWORD /d 1\n```\n\nYou can disable this by running the following:\n\n```cmd\nREG DELETE HKCU\\CONSOLE /f /v VirtualTerminalLevel\n```\n\n## Other IPinfo Tools\n\nThere are official IPinfo client libraries available for many languages including PHP, Python, Go, Java, Ruby, and many popular frameworks such as Django, Rails and Laravel. There are also many third party libraries and integrations available for our API.\n\nSee [https://ipinfo.io/developers/libraries](https://ipinfo.io/developers/libraries) for more details.\n\n## About IPinfo\n\nFounded in 2013, IPinfo prides itself on being the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier, VPN detection, hosted domains, and IP type data sets. Our API handles over 40 billion requests a month for 100,000 businesses and developers.\n\n[![image](https://avatars3.githubusercontent.com/u/15721521?s=128\u0026u=7bb7dde5c4991335fb234e68a30971944abc6bf3\u0026v=4)](https://ipinfo.io/)\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipinfo%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipinfo%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipinfo%2Fcli/lists"}