PHPackages                             larryli/ipv4-console - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. larryli/ipv4-console

ActiveLibrary[CLI &amp; Console](/categories/cli)

larryli/ipv4-console
====================

IP v4 中国城市地址库控制台命令

1.1.0(9y ago)129MITPHPPHP &gt;=5.4

Since Sep 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/larryli/ipv4-console)[ Packagist](https://packagist.org/packages/larryli/ipv4-console)[ Docs](https://github.com/larryli/ipv4-console)[ RSS](/packages/larryli-ipv4-console/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (7)Used By (0)

IPv4 控制台命令
==========

[](#ipv4-控制台命令)

通过 composer 安装
--------------

[](#通过-composer-安装)

```
composer global require "larryli/ipv4-console=~1.0"
```

然后将 `$HOME/.composer/vendor/bin` 加入 `$PATH` 环境变量

初始化
---

[](#初始化)

```
ipv4 init
```

可以使用 `--force` 更新覆盖现有数据。

查询
--

[](#查询)

```
ipv4 query 127.0.0.1
```

配置
--

[](#配置)

```
ipv4 edit
```

请参阅 [Config 配置文档说明](config.md)

导出
--

[](#导出)

```
ipv4 export --type qqwry monipdb 17monipdb.qqwry.dat

```

格式为：`--type` 导出文件类型，然后是要导出的查询库和保存的文件。

目前支持 `monipdb` 和 `qqwry` 两种导出类型。

另外，可以使用 `--encoding` 指定导出文件的编码。

其中，`monipdb` 默认编码是 `utf-8`；`qqwry` 默认编码是 `gbk`。

对于，`monipdb` 可选项有 `--ecdz=1` 设置导出的地址字符串中没有制表符分隔。

对于，`qqwry` 可选项有 `--remove-ip-in-recode=1` 去掉冗余的记录区 IP 数据（对文件兼容性有影响，但可以大幅减少文件大小）。

杂项
--

[](#杂项)

```
ipv4 benchmark        # 性能测试
ipv4 clean            # 清除全部数据
ipv4 clean file       # 清除下载的文件数据
ipv4 clean database   # 清除生成的数据库数据
ipv4 dump             # 导出原始数据
ipv4 dump division    # 导出排序好的全部地址列表
ipv4 dump division_id # 导出排序好的全部地址和猜测行政区域代码列表
ipv4 dump count       # 导出记录统计数据
```

注意：`dump` 命令会耗费大量内存，请配置 PHP `memory_limit` 至少为 `128M` 或更多。

相关包
---

[](#相关包)

- 核心 [larryli/ipv4](https://github.com/larryli/ipv4)
- Medoo 数据库支持 [larryli/ipv4-medoo](https://github.com/larryli/ipv4-medoo)
- Yii2 组件 [larryli/ipv4-yii2](https://github.com/larryli/ipv4-yii2)
- Yii2 示例 [larryli/ipv4-yii2-sample](https://github.com/larryli/ipv4-yii2-sample)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~64 days

Total

6

Last Release

3640d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96ad7a2df570547276deb3f07f6e604f897c3dcbe495d55c811b9ae7e3b484ae?d=identicon)[larryli](/maintainers/larryli)

---

Top Contributors

[![larryli](https://avatars.githubusercontent.com/u/10723?v=4)](https://github.com/larryli "larryli (13 commits)")[![li-dian-dian](https://avatars.githubusercontent.com/u/205688472?v=4)](https://github.com/li-dian-dian "li-dian-dian (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/larryli-ipv4-console/health.svg)

```
[![Health](https://phpackages.com/badges/larryli-ipv4-console/health.svg)](https://phpackages.com/packages/larryli-ipv4-console)
```

###  Alternatives

[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
