Skip to main content

TUIL

A terminal interface (TUI) for browsing and interacting with Lemmy.

TUIL is based on tuir, the terminal client for Reddit. The layout, key bindings and configuration format are intentionally kept close to tuir. The Reddit/PRAW backend has been replaced with a native Lemmy API client.

Status

TUIL is in early development and supports:

  • Anonymous browsing of communities, posts, comments and users
  • Logging in with a username and password
  • Voting, saving, posting, replying, editing and deleting
  • Joining and leaving communities
  • Community search and user profiles
  • Inbox, private messages and unread counts
  • Status bar themes, custom key bindings and mailcap media handling

Most functionality works with Lemmy 0.19.x and Lemmy 1.0. The client uses the older v3 API on 0.19 instances and switches to v4 for community, post and user listings, the inbox, mentions, private messages, read state, and saved, liked and hidden content on 1.0.

Multireddits, domain listings and Reddit gold are not part of Lemmy. Post hiding is available on Lemmy 1.0; on 0.19 the key binding shows an error. User-page sorting is unavailable on Lemmy 1.0 because the v4 API returns a fixed order.

Installation

From PyPI

Install the tuir-lemmy distribution with uv. The installed command is still tuil.

$ uv tool install tuir-lemmy
$ tuil

The same distribution can be installed with pip or pipx:

$ pip install tuir-lemmy
$ pipx install tuir-lemmy

From source

Python 3.10 or newer is required.

$ git clone https://github.com/faethon/tuil.git
$ cd tuil
$ python3 -m venv .venv
$ . .venv/bin/activate
$ pip install -e .

Run it with:

$ tuil

or directly from the source tree:

$ python3 -m tuil

Usage

Connect to any Lemmy instance with --instance and optionally open a community or listing on startup:

$ tuil --instance lemmy.ml
$ tuil --instance lemmy.world --community linux
$ tuil --instance lemmy.ml --community all
$ tuil https://lemmy.ml/post/12345

The default instance is lemmy.ml. Community and listing pages use Lemmy's paths: /c/linux for a community, /c/all for the local instance's federated timeline, and /c/front for the front page. The / prompt also accepts bare community names such as /linux, post URLs, and user pages.

Logging in

Press u to log in. TUIL asks for your Lemmy username and password and stores only the returned session token, in $XDG_DATA_HOME/tuil/token. The token is bound to the instance that issued it; switching instances will not reuse a token from another instance. Credentials are not stored.

Useful options:

  • --non-persistent forget the session token when the program exits
  • --no-autologin do not restore a saved session on startup
  • --clear-auth delete the saved token on startup
  • --user NAME keep a separate token and history file per account

Controls

Move the cursor with the arrow keys or Vim-style movement. Press ? for the in-app help, or see CONTROLS.md for the full key map.

  • j/k - move the cursor
  • l/h - open an item or return to the previous page
  • 1-5 - change the post/comment sort order
  • l in a community - open the selected post and its comments
  • / - open the navigation prompt
  • a/z - upvote/downvote
  • c - create a post or reply
  • w - save/unsave
  • s - view subscribed communities
  • i - view the inbox
  • u - log in or out
  • ? - open help
  • q - quit

Settings

Configuration is stored in $XDG_CONFIG_HOME/tuil/tuil.cfg (normally ~/.config/tuil/tuil.cfg). Run tuil --copy-config to create a default file. The full list of options, including custom post formats and key bindings, is documented in tuil.cfg.

The main startup settings are:

[tuil]
instance = lemmy.ml
community = front
persistent = True
autologin = True

Older tuir config files are accepted as a fallback when no tuil config exists. The [tuir] section, the subreddit and subreddit_format options, and the old ~/.config/tuir/tuir.cfg path keep working. The new names are [tuil], community and post_format.

TUIL can use mailcap to open images and videos in external programs. Copy the example file with:

$ tuil --copy-mailcap

Then enable the feature with --enable-media or by setting enable_media = True in tuil.cfg.

An existing ~/.config/tuir/mailcap or ~/.mailcap is also read, so a tuir mailcap can be reused without copying it. To point to a file elsewhere, set the MAILCAPS environment variable to its path.

Environment variables

  • TUIL_EDITOR - editor used for posts, comments and messages
  • TUIL_BROWSER - browser used to open links
  • TUIL_URLVIEWER - urlview/urlscan-compatible link extractor

If unset, TUIL falls back to VISUAL/EDITOR, BROWSER, and the system default programs. The clipboard command is configured with clipboard_cmd in tuil.cfg.

Themes

List the installed themes with tuil --list-themes, select one with tuil --theme NAME, or cycle through them in the app with F2 and F3. Themes in ~/.config/tuil/themes and the old ~/.config/tuir/themes are both loaded. Theme files use the same attribute names as tuir; see THEMES.md.

Development

$ .venv/bin/python -m pytest -q

The Lemmy API client lives in tuil/api. Verified response shapes and known endpoint differences are documented in docs/lemmy-api-notes.md.

Optional read-only checks against a live instance:

$ .venv/bin/python scripts/live_check.py --instance lemmy.ml

See docs/live-testing.md for authenticated and manual write checks.

License

TUIL is distributed under the GNU General Public License, version 3 only. It is derived from tuir and retains the upstream copyright notices and attribution. See COPYING and AUTHORS.rst.

Metadata

Release files for tuir-lemmy 0.1.1

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

Source distribution (sdist)

Source distribution for tuir-lemmy 0.1.1
File Size Uploaded Provenance
tuir_lemmy-0.1.1.tar.gz 215.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tuir-lemmy 0.1.1
File Interpreter ABI Platform
tuir_lemmy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 353.1 kB

Release files / tuir_lemmy-0.1.1.tar.gz

Download URL tuir_lemmy-0.1.1.tar.gz
Size 215.1 kB
Tags Source
SHA-256 checksum
How to use checksums
04edb42ec1692a3ebd054b8ba2abae1e170202655f9c9410ba120fee580ee34c
BLAKE2b-256 checksum
How to use checksums
85902057f0f46f0dbb660d0c7257a2a664454ff64ae761558903035044026b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / tuir_lemmy-0.1.1-py3-none-any.whl

Download URL tuir_lemmy-0.1.1-py3-none-any.whl
Size 137.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8859b678cc18e67c626f5fcabe76d57cb92ca9de04bc7f076ad0c586fc16093
BLAKE2b-256 checksum
How to use checksums
530f48a3d0f92f4081e6d25c02b273218084bf7d3cf35c2a8d67fa1c13520173
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for tuir-lemmy 0.1.1

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.

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