Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/knbr13/myip
- Owner: knbr13
- Created: 2023-06-16T00:44:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-30T06:20:15.000Z (12 months ago)
- Last Synced: 2024-06-20T20:58:20.027Z (6 months ago)
- Topics: cli, go, ip, tool
- Language: Go
- Homepage:
- Size: 174 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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": ""
}
}```