Skip to main content

Mastodon terminal user interface

Project description

tooi

Horn logo

tooi is a text-based user interface for Mastodon, Pleroma and friends. The name is a portmantou of toot and TUI.

It uses the Textual framework.

* Could not get tooi as Python project name, if someone knows python people ask them kindly to approve this request.

Project status

This project is in its early days and things will change without notice.

While we aim to keep the project usable at all times, expect that things may break before we hit version 1.0.

Installation

Currently tooi requires toot for logging into instances.

The recommended method of installation is using pipx which installs python projects into their own virtual environments.

  1. Follow the pipx installation guide to set it up.

  2. Install toot and tooi by running:

    pipx install toot
    pipx install toot-tooi
    

Alternatively, if you know what you're doing, install both projects from pypi using your favourite method.

Usage

Before first use, run toot login to log into your mastodon instance.

Tooi will authenticate as the currently active toot user. You can check who you're logged in as by running toot whoami, and switch accounts using toot activate.

Launch the program by running tooi.

Run tooi --help to see the available commandline options.

Key bindings

Generic bindings:

  • Arrow keys or h/j/k/l - move up/down/left/right
  • Tab and Shift+Tab - move between focusable components
  • Space or Enter - activate buttons and menu items

Managing tabs:

  • . - refresh timeline
  • / - open search tab
  • 1 - 9 - switch between open tabs
  • Ctrl+d - close current tab
  • g - open new tab ("goto")

Status bindings:

  • a - show account
  • b - boost status
  • d - delete status
  • e - edit status
  • f - favourite status
  • m - show media
  • r - reply to status
  • s - reveal sensitive
  • t - show thread
  • u - show toot source

Setting up a dev environment

Check out tooi and install in a virtual environment:

git clone https://codeberg.org/ihabunek/tooi.git
cd tooi
python3 -m venv _env
source _env/bin/activate
pip install --editable ".[dev]"

Run the app by invoking tooi.

To use the Textual console, run it in a separate terminal window:

textual console

Then run tooi like this:

textual run --dev tooi.cli:main

Code style and linting

Rule of thumb: look at existing code, try to keep it similar in style.

Please run make lint to check formatting before sending a patch. This runs flake8 which checks for some basic code style rules. It shouldn't be too aggressive, and if you're bothered by a rule, let me know.

Lines can be upto 100 characters wide, wrap them if they go over that.

Wrapping style

Wrapping style is not enforced by the linter, but this is the preferred style most of the time:

# NO: Do not wrap after opening paren

very_long_package_name.even_longer_long_function_call(first_argument,
                                                      second_argument,
                                                      third_argument)

# YES: Align arguments on next tab

very_long_package_name.even_longer_long_function_call(
    first_argument,
    second_argument,
    third_argument
)

Type checking

You're encouraged to specify types in your code. While they can be a bit of a pain in Python, I have found them to be useful in locating errors and eliminating potential bugs.

This project is configured to use pyright for type checking, and I recommend that you install the pyright language server if it's available for your editor. Currently it returns errors in some places, some of which are caused by the way textual is implemented. So it's not required to have zero errors before submitting patches, but it will indicate problems in new code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toot_tooi-0.13.0.tar.gz (95.1 kB view details)

Uploaded Source

Built Distribution

toot_tooi-0.13.0-py3-none-any.whl (78.7 kB view details)

Uploaded Python 3

File details

Details for the file toot_tooi-0.13.0.tar.gz.

File metadata

  • Download URL: toot_tooi-0.13.0.tar.gz
  • Upload date:
  • Size: 95.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for toot_tooi-0.13.0.tar.gz
Algorithm Hash digest
SHA256 26a69eabf4c27147d135bfc9fdb20e2c30331cdadb5f9850f2b9ceae6d1c40d5
MD5 e8af8f9d1cd1e4d61567690196c1b77b
BLAKE2b-256 4347a27f571459983f042c85e6d1dd571d855b8b444a86d62614ebfa09c86811

See more details on using hashes here.

File details

Details for the file toot_tooi-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: toot_tooi-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 78.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for toot_tooi-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c86e929eea62125894d84a8f8be4759d8b960522e863a819cc54571046fbab35
MD5 293e43a29841bf16cb62770cce41b01e
BLAKE2b-256 5007162193a4bb1a448ea5d3d944e9bb393a85c3da7df64f8d50198136557837

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page