https://github.com/snehil-shah/serveport-cli
A Simple CLI tool that can spawn quick Servers over various Networks and help you manage Ports, Network Interfaces & their IP-Addresses.
https://github.com/snehil-shah/serveport-cli
cli cobra golang networks ports servers
Last synced: 7 months ago
JSON representation
A Simple CLI tool that can spawn quick Servers over various Networks and help you manage Ports, Network Interfaces & their IP-Addresses.
- Host: GitHub
- URL: https://github.com/snehil-shah/serveport-cli
- Owner: Snehil-Shah
- License: mit
- Created: 2023-12-17T21:33:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T16:51:22.000Z (almost 2 years ago)
- Last Synced: 2025-01-22T01:43:14.065Z (9 months ago)
- Topics: cli, cobra, golang, networks, ports, servers
- Language: Go
- Homepage:
- Size: 19.1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ServePort - CLI
A convenient CLI tool for Spawning Simple File Servers over multiple Networks, and managing Ports, IP-Addresses & Network Interfaces.
Table of Contents
• About The Project
**ServePort** is a simple CLI tool to Control & Manage Servers, Ports & Network Devices.
- Boot up Static Servers over Local, Private & Public Networks allowing you to share your files with ease.
![]()
A Private Server over Home Wifi
- Check Port Availability on different IP-Addresses.
![]()
![]()
- Lists all Network Interfaces on your machine along with their MAC, IPv4 & IPv6 Addresses.
![]()
- Highly configurable commands using Flags & Arguments
- Access Helpful CLI Documentation using `--help` or `-h` on any of the commands.
• Technologies Used
- Go
- Cobra Framework
- Shell
• Usage
Check [Releases](https://github.com/Snehil-Shah/ServePort-CLI/releases) for installation Instructions
The executable has three commands.
You can execute a command in the format:
`ServePort [command] [-flag] [flagValue]`Flags can help you configure the command for specific usage. They are optional & you can just run the command without Flags for default usage.
*`-h`/`--help` Flag can be toggled upon any command or directly on the executable to get meaningful documentation.*
**WARNING**: Make sure you trust the Private or Public network you are serving over.
Strictly avoid Serving over Public Networks like Public Wifi's as you are more vulnerable to Unrestricted Access to your Server-> It's recommended to stick to `Localhost` for most menial tasks!
#### Commands
- `serve`: Starts a quick HTTP Server with configurable Port, Directory & Host Address
*Flags*-
- `-p`/`--port`: Enter Port to start the server on. (defaults to 80) - Integer
- `-d`/`--directory`: Enter Directory to serve. (defaults to current dir) - String
- `-a`/`--address`: Select Server Host.
This is a toggle flag and doesn't need input.
(If flag not present, defaults to Localhost)- `check-port`: Checks availability of a Port on any Host.
*Flags*-
- `-p`/`--port`: Enter Port to check. (defaults to 80) - Integer
- `-a`/`--address`: Select Port Host.
This is a toggle flag and doesn't need input.
(If flag not present, defaults to Localhost)- `list-interfaces`: Lists out all Network interfaces along with their MAC, IPv4 & IPv6 Addresses on your Computer
• Setup Project (For Developers)
-
Pre-requisites:
- [Go](https://go.dev/dl/)
- [Cobra](https://cobra.dev/#install)-
Running the Project:
Just execute the below command to run the CLI app and its commands```shell
go run main.go [command] [flags] [flag-values]
go run main.go check-port -p 8080 #Example
```All commands are implemented inside the ```/cmd``` folder in their own files.
```root.go``` is the base command implementation & ```main.go``` is the entrypoint code to the app.