Skip to content

Commit ed4d190

Browse files
author
zu1k
committed
docs: Readme zh-CN first
Signed-off-by: zu1k <[email protected]>
1 parent 568c576 commit ed4d190

File tree

2 files changed

+150
-144
lines changed

2 files changed

+150
-144
lines changed

README.md

Lines changed: 76 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<br>Nali<br>
33
</h1>
44

5-
<h4 align="center">An offline tool for querying IP geographic information and CDN provider.</h4>
5+
<h4 align="center">一个查询IP地理信息和CDN提供商的离线终端工具.</h4>
66

77
<p align="center">
88
<a href="https://github.com/zu1k/nali/actions">
@@ -16,66 +16,67 @@
1616
</a>
1717
</p>
1818

19-
#### [中文文档](https://github.com/zu1k/nali/blob/master/README_zh-CN.md)
19+
#### [English](https://github.com/zu1k/nali/blob/master/README_en.md)
2020

21-
## Origin
21+
## 来源
2222

23-
Inspired by Nali C version and nali-cli js version.
23+
该工具受 Nali C版本 和 nali-cli js版本的启发.
2424

25-
I want to query the IP geographic information and CDN service provider on the terminal, then found the Nali tool. Nali mean 'where' in Chinese, good name for this kind of tools.
25+
我想要在终端对IP地理信息和CDN服务提供商进行查询,发现了Nali这个工具,Nali与哪里谐音,非常适合这类工具
2626

27-
However the C version has too few functions, and the js version is too big and the supported platforms are not complete, so I rewrite it in golang, add IPv6 support and Geoip2 database.
27+
经过简单的使用,我发现最初的C语言版本功能缺失,而js版本包实在大的恐怖、而支持的平台非常有限,所以我用golang重写了这个工具,在原有功能的基础上增加了对IPv6的支持,并且增加了Geoip2数据库
2828

29-
## Feature
3029

31-
- Multi database support
32-
- Chunzhen qqip database
33-
- ZX ipv6 database
34-
- Geoip2 city database
35-
- IPIP free database
36-
- ip2region database
37-
- Pipeline support
38-
- Interactive query
39-
- Offline query
40-
- Both ipv4 and ipv6 supported
41-
- Multilingual support
42-
- CDN provider query
43-
- Full platform support
44-
- Color print
30+
## 功能
4531

46-
## Install
32+
- 支持多种数据库
33+
- 纯真 IPv4 离线数据库
34+
- ZX IPv6 离线数据库
35+
- Geoip2 城市数据库 (可选)
36+
- IPIP 数据库 (可选)
37+
- ip2region 数据库 (可选)
38+
- CDN 服务提供商查询
39+
- 支持管道处理
40+
- 支持交互式查询
41+
- 同时支持IPv4和IPv6
42+
- 支持多语言
43+
- 查询完全离线
44+
- 全平台支持
45+
- 支持彩色输出
4746

48-
### Install from source
47+
## 安装
4948

50-
Nali Requires Go >= 1.18. You can build it from source:
49+
### 从源码安装
50+
51+
Nali 需要预先安装 Go >= 1.18. 安装后可以从源码安装软件:
5152

5253
```sh
5354
$ go install github.com/zu1k/nali
5455
```
5556

56-
### Install pre-build binariy
57+
### 下载预编译的可执行程序
5758

58-
Pre-built binaries are available here: [release](https://github.com/zu1k/nali/releases)
59+
可以从Release页面下载预编译好的可执行程序: [Release](https://github.com/zu1k/nali/releases)
5960

60-
Download the binary compatible with your platform, unpack and copy to the directory in path
61+
你需要选择适合你系统和硬件架构的版本下载,解压后可直接运行
6162

62-
## Usage
63+
## 使用说明
6364

64-
### Query a simple IP address
65+
### 查询一个IP的地理信息
6566

6667
```
6768
$ nali 1.2.3.4
6869
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
6970
```
7071

71-
#### or use `pipe`
72+
#### 或者 使用 `管道`
7273

7374
```
7475
$ echo IP 6.6.6.6 | nali
7576
IP 6.6.6.6 [美国 亚利桑那州华楚卡堡市美国国防部网络中心]
7677
```
7778

78-
### Query multiple IP addresses
79+
### 同时查询多个IP的地理信息
7980

8081
```
8182
$ nali 1.2.3.4 4.3.2.1 123.23.3.0
@@ -84,9 +85,9 @@ $ nali 1.2.3.4 4.3.2.1 123.23.3.0
8485
123.23.3.0 [越南 越南邮电集团公司]
8586
```
8687

87-
### Interactive query
88+
### 交互式查询
8889

89-
use `exit` or `quit` to quit
90+
使用 `exit` `quit` 退出查询
9091

9192
```
9293
$ nali
@@ -99,7 +100,9 @@ $ nali
99100
quit
100101
```
101102

102-
### Use with dig
103+
### `dig` 命令配合使用
104+
105+
需要你系统中已经安装好 dig 程序
103106

104107
```
105108
$ dig nali.lgf.im +short | nali
@@ -108,7 +111,9 @@ $ dig nali.lgf.im +short | nali
108111
172.67.135.48 [美国 CloudFlare节点]
109112
```
110113

111-
### Use with nslookup
114+
### `nslookup` 命令配合使用
115+
116+
需要你系统中已经安装好 nslookup 程序
112117

113118
```
114119
$ nslookup nali.lgf.im 8.8.8.8 | nali
@@ -124,19 +129,19 @@ Name: nali.lgf.im
124129
Address: 172.67.135.48 [美国 CloudFlare节点]
125130
```
126131

127-
### Use with any other program
132+
### 与任意程序配合使用
128133

129-
Because nali can read the contents of the `stdin` pipeline, it can be used with any program
134+
因为 nali 支持管道处理,所以可以和任意程序配合使用
130135

131136
```
132137
bash abc.sh | nali
133138
```
134139

135-
Nali will insert ip information after ip
140+
Nali 将在 IP后面插入IP地理信息,CDN域名后面插入CDN服务提供商信息
136141

137-
### IPV6 support
142+
### 支持IPv6
138143

139-
Use like ipv4
144+
和 IPv4 用法完全相同
140145

141146
```
142147
$ nslookup google.com | nali
@@ -150,7 +155,9 @@ Name: google.com
150155
Address: 2a00:1450:400e:809::200e [荷兰Amsterdam Google Inc. 服务器网段]
151156
```
152157

153-
### Query CDN provider
158+
### 查询 CDN 服务提供商
159+
160+
因为 CDN 服务通常使用 CNAME 的域名解析方式,所以推荐与 `nslookup` 或者 `dig` 配合使用,在已经知道 CNAME 后可单独使用
154161

155162
```
156163
$ nslookup www.gov.cn | nali
@@ -168,9 +175,9 @@ Name: zgovweb.v.bsgslb.cn [白山云 CDN]
168175
Address: 2001:428:6402:21b::6 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
169176
```
170177

171-
## Interface
178+
## 用户交互
172179

173-
### Help
180+
### 查看帮助
174181

175182
```
176183
$ nali --help
@@ -179,88 +186,87 @@ Usage:
179186
nali [command]
180187
181188
Available Commands:
182-
completion generate the autocompletion script for the specified shell
183189
help Help about any command
184190
update update chunzhen ip database
185191
186192
Flags:
187-
--gbk Use GBK decoder
188-
-h, --help help for nali
193+
-h, --help help for nali
194+
-t, --toggle Help message for toggle
189195
190196
Use "nali [command] --help" for more information about a command.
191197
```
192198

193-
### Update database
199+
### 更新数据库
194200

195201
```
196202
$ nali update
197203
2020/07/17 12:53:46 正在下载最新纯真 IP 库...
198204
2020/07/17 12:54:05 已将最新的纯真 IP 库保存到本地 /root/.nali/qqwry.dat
199205
```
200206

201-
### Select database
207+
### 自选数据库
202208

203-
Users can specify which database to use, set environment variables `NALI_DB_IP4`, `NALI_DB_IP6` or both.
209+
用户可以指定使用哪个数据库,需要设置环境变量: `NALI_DB_IP4``NALI_DB_IP6` 或者两个同时设置
204210

205-
supported database:
211+
支持的变量内容:
206212

207213
- Geoip2 `['geoip', 'geoip2', 'geo']`
208214
- Chunzhen `['chunzhen', 'qqip', 'qqwry']`
209215
- IPIP `['ipip', 'ipipfree', 'ipip.net']`
210216
- Ip2Resion `['ip2region', 'region', 'i2r']`
211217

212-
#### Windows
218+
#### Windows平台
213219

214-
##### Use geoip db
220+
##### 使用geoip数据库
215221

216222
```
217223
set NALI_DB_IP4=geoip
218224
219-
or use powershell
225+
或者使用 powershell
220226
221227
$env:NALI_DB_IP4="geoip"
222228
```
223229

224-
##### Use ipip db
230+
##### 使用ipip数据库
225231

226232
```
227233
set NALI_DB_IP6=ipip
228234
229-
or use powershell
235+
或者使用 powershell
230236
231237
$env:NALI_DB_IP6="ipip"
232238
```
233239

234-
#### Linux
240+
#### Linux平台
235241

236-
##### Use geoip db
242+
##### 使用geoip数据库
237243

238244
```
239245
export NALI_DB_IP4=geoip
240246
```
241247

242-
##### Use ipip db
248+
##### 使用ipip数据库
243249

244250
```
245-
export NALI_DB_IP6=ipip
251+
export NALI_DB_IP4=ipip
246252
```
247253

248-
### Multilingual support
254+
### 多语言支持
249255

250-
Specify the language to be used by modifying the environment variable `NALI_LANG`, when using a non-Chinese language only the GeoIP2 database is supported
256+
通过修改环境变量 `NALI_LANG` 来指定使用的语言,当使用非中文语言时仅支持GeoIP2这个数据库
251257

252-
The values that can be set for this parameter can be found in the list of supported databases for GeoIP2
258+
该参数可设置的值见 GeoIP2 这个数据库的支持列表
253259

254260
```
255261
# NALI_LANG=en nali 1.1.1.1
256262
1.1.1.1 [Australia]
257263
```
258264

259-
### Change database directory
265+
### 更换数据库目录
260266

261-
If the database directory is not specified, the database will be placed in `~/.nali`
267+
如果未指定数据库存放目录,数据库默认将存放在 `~/.nali`
262268

263-
Set environment variables `NALI_DB_HOME` to specify the database directory
269+
设置环境变量 `NALI_DB_HOME` 来指定数据库目录
264270

265271
```
266272
set NALI_DB_HOME=D:\nalidb
@@ -270,7 +276,7 @@ or
270276
export NALI_DB_HOME=/home/nali
271277
```
272278

273-
## Thanks
279+
## 感谢列表
274280

275281
- [纯真QQIP离线数据库](http://www.cz88.net/fox/ipdat.shtml)
276282
- [qqwry mirror](https://qqwry.mirror.noc.one/)
@@ -285,19 +291,18 @@ export NALI_DB_HOME=/home/nali
285291
- [Cobra CLI库](https://github.com/spf13/cobra)
286292
- [Nali-cli](https://github.com/SukkaW/nali-cli)
287293

288-
Thanks to JetBrains for the Open Source License
294+
感谢 JetBrains 提供开源项目免费License
289295

290296
<a href="https://www.jetbrains.com/?from=nali">
291297
<img src="assets/GoLand.svg">
292298
</a>
293299

294-
## Author
300+
## 作者
295301

296-
**Nali** © [zu1k](https://github.com/zu1k), Released under the [MIT](./LICENSE) License.<br>
302+
**Nali** © [zu1k](https://github.com/zu1k), 遵循 [MIT](./LICENSE) 证书.<br>
297303

298304
> Blog [@zu1k](https://lgf.im) · GitHub [@zu1k](https://github.com/zu1k) · Twitter [@zu1k_lv](https://twitter.com/zu1k_lv) · Telegram Channel [@peekfun](https://t.me/peekfun)
299305
300-
301-
## Stargazers over time
306+
## Star统计
302307

303308
[![Stargazers over time](https://starchart.cc/zu1k/nali.svg)](https://starchart.cc/zu1k/nali)

0 commit comments

Comments
 (0)