Skip to main content

Lantern

A terminal chat application — server and client in one package.

PyPI - Downloads

Lantern screenshot

Note: Lantern runs over plain TCP with no transport encryption. Don't use it for anything sensitive. It's built for fun, local networks, or VPS setups where you control the environment.


Quick Start (local testing)

pip install lantern-chat

Terminal 1 — start the server:

lantern-server

Terminal 2 — start the client:

lantern

When prompted for a server address, enter localhost (or press Enter). Register an account and you're in. To connect from another machine, use the server's IP address instead of localhost.


Compatibility

  • Linux (fully supported and tested)
  • macOS (supported, not tested as extensively)
  • Windows (known to work but not tested)

If you would like to test this on Windows I would really appreciate it, create an issue and I'll do my best to work on compatibility.


Installation

pip install lantern-chat

Requires Python 3.8+. Dependencies: rich, Pillow, opencv-python.

If you get an error about venv creation, install with pipx instead, available on most package managers as python-pipx.

Or alternatively, build from source:

git clone https://github.com/benjibrown/lantern.git 
cd lantern 
pip install .

Running

Start the server:

lantern-server
lantern-server -p 12345      # custom port (default: 6000)

Start the client:

lantern # pulls server ip, port and username from config file
lantern -s 1.2.3.4 -p 12345  # specify server address and port
lantern -u benji              # override saved username

On first run, the client will ask for a server address and save it. After logging in, your session is saved so you don't need to re-enter credentials. Reminder that there must be a server running at the server address specified either in the config file or via command line args for the client to connect successfully. See the Hosting section below for details on ways to do this.


Config files / Storage

Path Purpose
~/.config/lantern/config.json Client: server address, port, username, DND
~/.config/lantern/session Client: saved session (username + hashed pass)
~/.config/lantern/state.json Client: last view, last DM partner
~/.config/lantern/server.json Server: port, rate limits, admins
~/.local/share/lantern/users.json Server: user accounts
~/.local/share/lantern/messages.json Server: channel + DM history

Commands

All commands are detailed on the help menu which can be accessed via /help. All keybinds are detailed on the keybind menu which can be accessed via ctrl+k or /keybinds.

There are a few commands which are worth explaining:

  • /disp <time in secs> [msg] - send a disappearing message (redacts after the supplied time)
  • /snap - send a snap (takes a picture from your webcam and sends to main chat) - bit of a joke command but its pretty fun to use
  • /reload (admin) - reloads server config, meaning you dont have to restart the server after editing the server config file.

Server configuration

Server config lives at ~/.config/lantern/server.json. Create it or edit it to configure:

{
  "admins": ["benji"],

  "port": 6000,
  "fetch_cooldown": 30,
  "msg_rate_limit": 1.0,

  "max_msg_len": 400,
  "max_channel_messages": 2000,
  "max_dm_messages": 5000,

  "login_rate_limit_attempts": 5,
  "login_rate_limit_window": 300,
  "login_rate_limit_lockout": 900
}

Admins are matched by username. Admin commands are authenticated automatically using a per-session token issued by the server — no extra setup needed beyond adding the username to the admins list.


Hosting

Lantern needs a server accessible to all clients. Options:

  • LAN only — run lantern-server on one machine, clients connect by LAN IP
  • VPS — run the server on a public VPS, clients connect by public IP
  • Tunnel — use something like ngrok or cloudflared to expose a local port

There is no built-in TLS. If you care about traffic privacy, put it behind a TLS-terminating reverse proxy (e.g. nginx with stream module, or stunnel).

Or even code in encryption and make a PR :)


Contributing

PRs welcome. If something's broken, open an issue or fix it and send a PR. I really appreciate any feedback or PRs so please don't hesitate to do so.

Metadata

Release files for lantern-chat 1.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lantern-chat 1.5.4
File Size Uploaded Provenance
lantern_chat-1.5.4.tar.gz 49.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lantern-chat 1.5.4
File Interpreter ABI Platform
lantern_chat-1.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 106.0 kB

Release files / lantern_chat-1.5.4.tar.gz

Download URL lantern_chat-1.5.4.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8e9874226521f050efe278395f9f49764d12ba2f2b1f4c3a20881e8eafe13f64
BLAKE2b-256 checksum
How to use checksums
3f58076b13155a0ba9d0160b547052bf157415b58e5cd493e5e64c2b3e300f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / lantern_chat-1.5.4-py3-none-any.whl

Download URL lantern_chat-1.5.4-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5aa7d3de5ebc1e38650bb8a4b792432dadcd726fbf9280d1d531100e0a1ba04a
BLAKE2b-256 checksum
How to use checksums
99d1b2c9c8cd38fdbde4124d7d7398efee9c6ef0c165be5f2bcd7945e7cbaff4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for lantern-chat 1.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page