https://github.com/pomponchik/searchpi
A dumb command-line tool for searching your Raspberry Pi in a local network
https://github.com/pomponchik/searchpi
local-network nmap nmap-wrapper raspberry-pi
Last synced: 4 months ago
JSON representation
A dumb command-line tool for searching your Raspberry Pi in a local network
- Host: GitHub
- URL: https://github.com/pomponchik/searchpi
- Owner: pomponchik
- License: mit
- Created: 2024-01-14T20:06:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-17T16:41:43.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T00:35:39.350Z (8 months ago)
- Topics: local-network, nmap, nmap-wrapper, raspberry-pi
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# searchpi
[](https://pepy.tech/project/searchpi)
[](https://pepy.tech/project/searchpi)
[](https://hitsofcode.com/github/pomponchik/searchpi/view?branch=main)
[](https://pypi.python.org/pypi/searchpi)
[](https://badge.fury.io/py/searchpi)
[](https://github.com/astral-sh/ruff)
This is a very stupid CLI tool that is designed to search for SSH-ready devices on your local network, starting with those with the most senior local IP addresses.
Before using this tool, install [`nmap`](https://nmap.org/) on your computer. Then install the tool by [`pip`](https://pip.pypa.io/en/stable/installation/):
```bash
pip install searchpi
```
And use:
```bash
searchpi 192.168.1.0/24 pomponchik ~/.ssh/id_rsa.pub --one
```
Here `192.168.1.0/24` means the range of addresses we are looking at, `pomponchik` is the username and `~/.ssh/id_rsa.pub` is the name of the SSH key file. The `--one` option means that only the first address will be outputed to a console.
The command will print to the standard output the command that you will need to execute to connect to the remote machine via SSH:
```bash
>>> searchpi 192.168.1.0/24 pomponchik ~/.ssh/id_rsa.pub
ssh pomponchik@192.168.1.16
```
You can save your energy if you try to call the received command in the same line of code:
```bash
eval "$(searchpi 192.168.1.0/24 pomponchik ~/.ssh/id_rsa.pub --one)"
```