# oh-my-zsh-ipnav [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Buying me a coffee](https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png)](https://www.buymeacoffee.com/marctysonclebert) # Oh My Zsh ipnav Plugin 🌐 Oh My Zsh plugin for [ip-navigator-cli](https://github.com/clebertmarctyson/ip-navigator-cli) - Provides convenient aliases and completions for IP address operations. ## Prerequisites You must have `ip-navigator-cli` installed: ```bash npm install -g ip-navigator-cli ``` ## Installation ### Oh My Zsh 1. Clone this repository into Oh My Zsh's custom plugins directory: ```bash git clone https://github.com/clebertmarctyson/oh-my-zsh-ipnav \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ipnav ``` 2. Add `ipnav` to your plugins in `~/.zshrc`: ```bash plugins=( # ... other plugins ipnav ) ``` 3. Reload your shell: ```bash source ~/.zshrc ``` ## Available Aliases ### Validation | Alias | Command | Description | | ---------- | ---------------------- | ---------------------- | | `ipv` | `ipnav validate-ip` | Validate IPv4 address | | `ipmask` | `ipnav validate-mask` | Validate subnet mask | | `ipcidr` | `ipnav validate-cidr` | Validate CIDR notation | | `ipvbatch` | `ipnav validate-batch` | Validate multiple IPs | ### Conversion | Alias | Command | Description | | -------- | -------------------- | ------------------------ | | `ipbin` | `ipnav to-binary` | Convert IP to binary | | `ipfbin` | `ipnav from-binary` | Convert binary to IP | | `ipint` | `ipnav to-integer` | Convert IP to integer | | `ipfint` | `ipnav from-integer` | Convert integer to IP | | `ipc2m` | `ipnav cidr-to-mask` | CIDR to subnet mask | | `ipm2c` | `ipnav mask-to-cidr` | Subnet mask to CIDR | | `ipcvt` | `ipnav convert` | Show all representations | ### Subnet Operations | Alias | Command | Description | | ------------ | ------------------------- | --------------------------- | | `ipsinfo` | `ipnav subnet-info` | Get subnet information | | `ipnet` | `ipnav network-address` | Calculate network address | | `ipbcast` | `ipnav broadcast-address` | Calculate broadcast address | | `ipinsubnet` | `ipnav in-subnet` | Check subnet membership | ### IP Operations | Alias | Command | Description | | --------- | ---------------- | -------------------------- | | `ipclass` | `ipnav classify` | Classify as public/private | | `ipnext` | `ipnav next` | Get next IP address | | `ipprev` | `ipnav previous` | Get previous IP address | | `iprange` | `ipnav range` | Generate IP range | | `ipcmp` | `ipnav compare` | Compare two IPs | ## Utility Functions ### `ipcheck ` Quick IP validation with colored output. ```bash ipcheck 192.168.1.1 ``` ### `ipsubnet ` Get complete subnet info using CIDR notation. ```bash ipsubnet 192.168.1.100 24 ``` ### `ipvalidate-file ` Validate all IPs from a file. ```bash ipvalidate-file servers.txt ``` ### `ippublic ` Quick check if IP is public or private. ```bash ippublic 8.8.8.8 ``` ### `ipcount ` Count IPs in a range. ```bash ipcount 192.168.1.1 192.168.1.255 ``` ## Examples ```bash # Quick validation ipv 192.168.1.1 # Convert to binary ipbin 10.0.0.1 # Get subnet info ipsubnet 192.168.1.100 24 # Check if IP is public ippublic 8.8.8.8 # Generate range iprange 192.168.1.1 192.168.1.10 # Validate multiple IPs ipvbatch 192.168.1.1 10.0.0.1 8.8.8.8 ``` ## Autocompletion The plugin includes autocompletion for all `ipnav` commands. Just type `ipnav` and press `Tab`. ## Related Projects - [ip-navigator-cli](https://github.com/clebertmarctyson/ip-navigator-cli) - The CLI tool this plugin enhances - [ip-navigator](https://github.com/clebertmarctyson/ip-navigator) - Core IP address operations library ## Contributing Contributions are welcome! Feel free to: - Report bugs - Suggest new aliases or functions - Submit pull requests ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## Author **Marc Tyson CLEBERT ** - Website: [marctysonclebert.com](https://www.marctysonclebert.com) - GitHub: [@clebertmarctyson](https://github.com/clebertmarctyson) - Twitter/X: [@ClebertTyson](https://x.com/ClebertTyson) - Buy me a coffee: [Support my work](https://www.buymeacoffee.com/marctysonclebert) ## Support If this plugin has been helpful, consider: - ⭐ Starring the repository - ☕ [Buying me a coffee](https://www.buymeacoffee.com/marctysonclebert) --- Made with ❤️ for the Oh My Zsh community