Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/knbr13/myip

a small tool to get your public and some useful info in a single command
https://github.com/knbr13/myip

cli go ip tool

Last synced: 11 days ago
JSON representation

a small tool to get your public and some useful info in a single command

Awesome Lists containing this project

README

        

## MyIP

MyIP is a small Go application that retrieves information about your public and private IP addresses. It provides the data in either plain text or JSON format.

![MyIP](./myip.gif)

### Usage

#### Flags

- `-json`: Display results in JSON format.
- `-rich`: Display results in rich JSON format with additional information.

### Running the Tool

1. Clone the repository.
2. Navigate to the tool's directory.
3. Build the tool:
```
go build myip
```
4. Run the tool:
```
./myip
```

### Example Usage

1. Display public and private IP addresses in plain text:
```
./myip
```
2. Display results in JSON format:
```
./myip -json
```
3. Display rich JSON format with additional information:
```
./myip -json -rich
```

### Output Formats

#### Plain Text

Public IP :
Private IP :
(Additional information for rich format:
Country :
City :
Region :
Location :
HostName :
Organization :
)

#### JSON Format

- Plain JSON:

```
{ "publicIP": "", "privateIP": "" }
```

- Rich JSON:

```
{
"public IP": "",
"private IP": "",
"info": {
"ip": "",
"country": "",
"city": "",
"region": "",
"loc": "",
"org": "",
"hostname": ""
}
}

```