{"id":15282632,"url":"https://github.com/metacubex/geo","last_synced_at":"2025-04-11T12:13:24.089Z","repository":{"id":181650719,"uuid":"667078290","full_name":"MetaCubeX/geo","owner":"MetaCubeX","description":"🗺An easy way to manage all your Geo resources. Available as both a CLI and a Go library.","archived":false,"fork":false,"pushed_at":"2024-07-18T10:42:21.000Z","size":59,"stargazers_count":134,"open_issues_count":3,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T08:38:19.649Z","etag":null,"topics":["anticensorship","clash","geoip","geosite","routing","sing-box","trojan-go","v2ray","xray"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MetaCubeX.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":"2023-07-16T15:11:33.000Z","updated_at":"2025-03-23T00:09:43.000Z","dependencies_parsed_at":"2023-12-19T07:16:17.718Z","dependency_job_id":"d5f92692-71f0-49e2-b7cf-0859855a0c83","html_url":"https://github.com/MetaCubeX/geo","commit_stats":{"total_commits":20,"total_committers":4,"mean_commits":5.0,"dds":0.5,"last_synced_commit":"4ad33b87c8066c9be92b1f62af7d0e3be2267e9e"},"previous_names":["metacubex/geo"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaCubeX%2Fgeo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaCubeX%2Fgeo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaCubeX%2Fgeo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaCubeX%2Fgeo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MetaCubeX","download_url":"https://codeload.github.com/MetaCubeX/geo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248398812,"owners_count":21097294,"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":["anticensorship","clash","geoip","geosite","routing","sing-box","trojan-go","v2ray","xray"],"created_at":"2024-09-30T14:32:06.135Z","updated_at":"2025-04-11T12:13:24.063Z","avatar_url":"https://github.com/MetaCubeX.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# geo\r\n\r\n🗺An easy way to manage all your Geo resources.\r\n\r\nSupport GeoIP/GeoSite code lookup and converting among all popular GeoIP/GeoSite databases.\r\n\r\n## Install\r\n\r\nRequirements:\r\n\r\n- [Go](https://go.dev) 1.20+\r\n\r\n```shell\r\ngo install -v github.com/metacubex/geo/cmd/geo@master\r\n```\r\n\r\n## Usage\r\n\r\nType `geo help` for more details.\r\n\r\n### Look up codes from existing Geo databases\r\n\r\nThe default directory to find Geo databases is\r\n`~/.geo`. You can specify it through `-D` argument.\r\n\r\n#### IP\r\n\r\n```shell\r\ngeo look 223.5.5.5\r\n```\r\n\r\n```shell\r\ngeo look 2001:250::\r\n```\r\n\r\n#### Site\r\n\r\n```shell\r\ngeo look example.com\r\n```\r\n\r\n```shell\r\ngeo look --no-resolve example.com\r\n```\r\n\r\nSupported databases for `look` command:\r\n\r\n- MaxMind MMDB\r\n- V2Ray dat GeoIP/GeoSite\r\n- sing-geosite\r\n- sing-geoip MMDB\r\n- Meta-geoip MMDB\r\n\r\n### Convert\r\n\r\n#### IP\r\n\r\n```shell\r\ngeo convert ip -i \u003cinput_type\u003e -o \u003coutput_type\u003e -f [output_filename] input_filename\r\n```\r\n\r\n```shell\r\ngeo convert ip -i v2ray -o meta ./geoip.dat\r\n```\r\n\r\nAvailable types:\r\n\r\n- [MaxMind](https://github.com/Dreamacro/maxmind-geoip) (MMDB)\r\n- [V2Ray-geoip](https://github.com/v2fly/geoip) (dat)\r\n- [sing-geoip](https://github.com/SagerNet/sing-geoip) (MMDB)\r\n- [Meta-geoip](https://github.com/MetaCubeX/meta-rules-dat) (MMDB)\r\n\r\nSupported conversion pairs: (Column=From, Row=To)\r\n\r\n|            | MaxMind | V2Ray-geoip | sing-geoip | Meta-geoip |\r\n| ---------- | :-----: | :---------: | :--------: | :--------: |\r\n| MaxMind    |    -    |             |            |            |\r\n| V2Ray      |         |      -      |            |            |\r\n| sing-geoip |   ✅    |     ✅      |     -      |     ✅     |\r\n| Meta-geoip |         |     ✅      |            |     -      |\r\n\r\nConversion to MaxMind is not available for legal reasons.  \r\nConversion to V2Ray is on the TODO list.\r\n\r\n#### Site\r\n\r\n```shell\r\ngeo convert site -i \u003cinput_type\u003e -o \u003coutput_type\u003e -f [output_filename] -c [country code] input_filename\r\n```\r\n\r\n```shell\r\ngeo convert site -i v2ray -o sing ./geosite.dat\r\n```\r\n\r\nOnly v2ray -\u003e sing conversion is supported for GeoSite.\r\n\r\n### Unpack\r\n\r\n#### site\r\n\r\n```shell\r\ngeo unpack site ./geosite.dat -d output -c cn\r\n```\r\n\r\n- -d output dir\r\n- -c code (optional, unpack all geosite if not set)\r\n\r\n## Frequently Asked Questions (FAQ)\r\n\r\n### Why conversion MaxMind/sing-geoip -\u003e Meta-geoip is not available?\r\n\r\nMeta-geoip is designed to support IP with multiple results,\r\nwhich will help users who use GeoIP functionality as IPList or IPSet.\r\n\r\nFor sources such as MaxMind and sing-geoip, which only have a single possible result,\r\naccording to the principle of Occam's razor, there is no need to convert to Meta-geoip database.  \r\nIn the other hand, when there is only a single result,\r\nthe data structure of Meta-geoip and sing-geoip is completely consistent,\r\nand even compatible with the parsing logic.\r\n\r\nClash.Meta supports all of these databases, so everything is well. :-)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetacubex%2Fgeo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetacubex%2Fgeo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetacubex%2Fgeo/lists"}