Skip to content
bunlonghengPublic

About

QR code of your LAN address in the terminal. Scan from your phone to open a local dev server. A tiny Rust CLI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lanqr

A QR code of your LAN address, right in the terminal.

Scan it from your phone to open a local dev server on the same network. No more typing IPs.

License: MIT Rust Release

lanqr QR code

Why

Your dev server runs on localhost, but your phone needs the LAN IP. lanqr finds your LAN address and prints a scannable QR, so you point your camera and go.

Features

  • One command, instant QR in the terminal
  • Auto-detects your LAN IP (std only, no config)
  • Pass a port, a full URL, or any text
  • Single static binary, one dependency
  • Light QR on dark terminals, scans as-is

Install

cargo install --git https://github.com/bunlongheng/lanqr

Or build from source:

git clone https://github.com/bunlongheng/lanqr
cd lanqr && cargo build --release   # binary at ./target/release/lanqr

Usage

lanqr                        # QR of http://<your-lan-ip>
lanqr 3000                   # QR of http://<your-lan-ip>:3000
lanqr https://example.com    # encode any URL or text

Example:

$ lanqr 3000

http://192.168.1.42:3000

█████████████████████████████████
█████████████████████████████████
████ ▄▄▄▄▄ █ ▀ ▀█ ██▄█ ▄▄▄▄▄ ████
████ █   █ █▄ ▀▄▄ ▀▀▀█ █   █ ████
████ █▄▄▄█ █▄ █▄ ▀████ █▄▄▄█ ████
████▄▄▄▄▄▄▄█▄█▄█ ▀ █▄█▄▄▄▄▄▄▄████
████ ██▄  ▄ ▄ ▀▄█▀█ ▀ ██ ▀  ▄████
████▀█ ▄▄▀▄██▄█▄█▄▄ █ ▄▄  ▀▀ ████
████ ▀ █▀█▄▄█▄▄▄▀ ▄▀▄▄▄▀▀██▀▄████
████ ▄██▄▀▄▄██▀█▀▄▀▄ ▄██▀▄ ▄ ████
████▄████▄▄▄ ▀▄ ▄█ ▀ ▄▄▄ █▄ █████
████ ▄▄▄▄▄ █ █ ▀▄ ▄█ █▄█ ▄██ ████
████ █   █ █  █▄ ▀▀▄▄▄  ▄ █  ████
████ █▄▄▄█ ██▀   ██▀█▀▀▀ █   ████
████▄▄▄▄▄▄▄█▄▄▄▄▄▄▄▄▄█▄██▄██▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

How it works

lanqr opens a UDP socket toward a public address so the OS reveals which network interface it would use, then reads that interface's local IP (no packet is sent). It encodes the resulting URL with the qrcode crate and renders it as Unicode half-blocks, inverted so the code stays scannable on a dark terminal.

License

MIT

About

QR code of your LAN address in the terminal. Scan from your phone to open a local dev server. A tiny Rust CLI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages