FatRat

Terminal Interface

fatrat-tui: the queues on the left, the transfers of the selected queue on the right, and the keys along the bottom

fatrat-tui is a full-screen terminal client for FatRat. It manages transfers and queues, and shows transfer details, the RSS feeds and rules, the log, the settings and the extensions. It works over SSH, and it can run at the same time as the desktop app and the web interface, against the same FatRat.

fatrat-tui talks to FatRat through its REST API, either on a unix socket or through the web interface. To set up FatRat on a server, see Running on a Server.

Starting it and connecting

Run it without options:

fatrat-tui

By default (--mode auto) it tries these, in this order:

  1. A FatRat server that is already running on the unix socket $XDG_RUNTIME_DIR/fatrat/rest.sock. A unix socket needs no password.
  2. A FatRat running on this computer whose settings turn on the web interface. fatrat-tui reads the port, HTTPS and the password from FatRat's settings file, and connects to 127.0.0.1.
  3. Otherwise, it starts a private FatRat server of its own (fatrat-nogui, or fatrat) on the unix socket. This server uses your normal FatRat settings and transfers.

If you run the desktop app, turn on its web interface, so that fatrat-tui connects to it instead of starting a server of its own.

Other modes skip some of these steps:

--mode local
Only the running FatRat found through its settings (step 2).
--mode socket
Only the unix socket, starting a server there if needed (steps 1 and 3).
--no-start
In auto mode, never start a server: fail if nothing is running.

What it would do: --which

--which prints how fatrat-tui would connect, and why, and then exits. It doesn't start or change anything. For example:

$ fatrat-tui --which
Unix socket /run/user/1000/fatrat/rest.sock: nothing is listening
Settings /home/you/.config/Dolezel/fatrat.conf: the web interface is turned off
Starting a FatRat server of our own on the unix socket /run/user/1000/fatrat/rest.sock (it uses your normal FatRat settings and transfers)

Connecting to another computer

Give the address of FatRat's web interface with --url, or in the FATRAT_URL environment variable:

fatrat-tui --url https://server.example.com:2233

--url takes http://host:port, https://host:port or unix:/path/to.sock. It can't be combined with any --mode other than url.

Over HTTP or HTTPS, fatrat-tui needs the web interface password. It takes the first of these:

  1. --password-file file: the first line of the file. The file must exist, be readable by you, and not be readable or writable by the group or by others. Otherwise fatrat-tui prints Cannot use the password file and an explanation, and exits without connecting.
  2. The FATRAT_PASSWORD environment variable.
  3. The settings of a FatRat running on this computer (step 2 of auto mode).
  4. Otherwise, it asks for the password in a dialog.

--password-prompt always asks, even when one of the others has a password. A user name and password written into the URL are ignored. FatRat's web interface accepts any user name, so fatrat-tui never asks for one.

Over plain http:// to another computer, fatrat-tui warns that the password travels unencrypted. Use https:// if the server offers it.

When the server's certificate isn't trusted (for example, a self-signed one), fatrat-tui shows its SHA-256 fingerprint and lets you choose Trust for this session, Remember this fingerprint or Quit. Remembered fingerprints are stored in ~/.config/fatrat/tui.conf. --insecure turns off the certificate check.

The unix socket

--socket path uses a different unix socket than $XDG_RUNTIME_DIR/fatrat/rest.sock, for both finding a running server and starting one. For example, for the system service described in Running on a Server:

sudo -u fatrat fatrat-tui --socket /run/fatrat/rest.sock

These options affect a server that fatrat-tui starts:

--server-bin path
The FatRat program to start. By default it is fatrat-nogui or fatrat, next to fatrat-tui or in PATH.
--config file
A FatRat settings file. fatrat-tui reads it to find a running FatRat, and a server it starts uses it.
--stop
Stop a server that fatrat-tui started earlier, and exit.

While the server starts, fatrat-tui shows the path of its log, ~/.local/state/fatrat/tui-server.log.

Quitting

Press Q (or Ctrl-C) to quit. If fatrat-tui started the server itself, quitting stops it too. If transfers are active, it asks first: Keep it running (downloads continue), Stop the server and quit or Cancel. A server that you keep running is found on the unix socket the next time you start fatrat-tui. A server that was already running when you started fatrat-tui is never stopped.

If fatrat-tui ends in another way, because the terminal closes or it gets SIGTERM or SIGHUP, it does not ask. It stops a server it started only when nothing is active, and otherwise leaves it running.

The screen

The terminal must be at least 60 columns by 16 lines.

Transfers tab

The Queues pane on the left lists the queues with the number of transfers in each. Below the list it shows the current queue's default directory (Dir), the directory finished transfers are moved to (Move), the watch folder (Watch) and the speed limits (Lim). A queue whose watch folder has a problem gets a ! before its name, and the Watch line names the problem.

The Transfers pane on the right lists the transfers of the current queue with their name, state, progress, size, download speed and time left. When the terminal is at least 22 lines high (23 when it is narrower than 100 columns), a Details strip at its bottom shows the selected transfer's name, path, class (the engine), speed, limits, message and comment.

In a terminal narrower than 100 columns, the Queues pane is replaced by a Queue line above the transfers; ← and → switch to the previous and next queue.

Enter opens the details view of the selected transfer. It has the tabs Info, Files (for torrents only) and Log, and replaces the transfer list until you press Esc.

RSS tab

The Feeds pane on the left and the Download rules pane on the right. See RSS for what feeds and rules do. A new rule starts with Include repacks and Exclude manual ticked, and Include trailers unticked.

Log tab

FatRat's global log. By default it follows the end of the log. Press T to see the log of the transfer selected on the Transfers tab instead, and T again to go back.

Settings and extensions

O or F2 opens the settings that the connected FatRat offers, such as RSS, Scheduler, BitTorrent and Web Interface. Pages it can't show say so. X or F4 opens the Python extensions. Its sections are Installed, Available and Repositories; Tab switches between them.

Keys

Letter keys work in either case. Press ? or F1 for the list of keys inside fatrat-tui.

Everywhere

KeyAction
1, 2, 3Transfers, RSS and Log tab
F2 or OSettings
F4 or XExtensions
Tab, Shift-TabNext and previous pane
↑ or K, ↓ or JUp and down in a list
←, →Queues pane, Transfers pane (in a narrow terminal: previous and next queue)
PgUp, PgDn, Home, EndPage up, page down, first, last
/Filter the transfers by name
EscBack; on the Transfers tab, clear the filter, then the marks
F1 or ?Help
Q, Ctrl-CQuit
Ctrl-LRedraw the screen

Transfers pane

Most keys act on the marked transfers, or on the selected one when none is marked.

KeyAction
RResume: queues paused and failed transfers, and turns a forced transfer into a normal one
FForce resume
PPause
NNew transfer
DDelete: asks whether to keep the files or delete them too
EEdit the transfer's properties
MMove, then T to the top, U up, D down or B to the bottom
[, ]Move up, move down
SSend to another queue
LSpeed limit
SpaceMark or unmark
AMark all or none
EnterOpen the details view

Queues pane

KeyAction
NNew queue
EEdit the queue
DDelete the queue
[, ]Move the queue up, down
LQueue speed limits (opens the queue editor)
EnterOpen the queue (focus its transfers)

Details view

KeyAction
Tab, Shift-TabNext and previous tab
Esc or BBack to the list

On the Files tab of a torrent, priority changes take effect only when you apply them:

KeyAction
+ or =Raise the file's priority
-Lower the file's priority
SSkip the file, or stop skipping it
ADownload all files (stop skipping)
EnterApply the changes

RSS tab

KeyAction
N, E, DNew, edit, delete a feed or a rule
RRefresh the feeds now
TRules: test a regular expression
WRules: the downloaded episodes
TabSwitch between feeds and rules

Log tab

KeyAction
FFollow the end of the log, on or off
/Search
NNext match
G, EndTop, bottom
TLog of the selected transfer, or back to the global log

Mouse

In a terminal that supports the xterm mouse protocol, you can use the mouse:

--no-mouse turns mouse support off, so that the terminal's own mouse handling, such as selecting text, works as usual.

Editing transfers and queues

N and E open forms. See Transfers and Queues for what the fields mean.

Speed limits are in KB/s; 0 means no limit.

Keys in forms

KeyAction
Tab, Shift-Tab, ↑, ↓Next and previous field
←, → or SpaceChange a choice (shown as ◂ … ▸)
SpaceTick or untick a check box
Ctrl-A, Ctrl-EStart, end of the text
Ctrl-UClear the field
Ctrl-KDelete to the end
Ctrl-WDelete the word before the cursor
Ctrl-BBrowse for a directory
EnterSave (or Add, Create)
EscCancel

Ctrl-B browses the directories on the computer where FatRat runs. In the New transfer form it fills Save to; in the queue form it fills the directory field you are in (Default directory, Move finished to or Watch folder). In the directory browser, Enter opens a directory, Backspace goes up, C chooses the current directory, H shows or hides hidden directories, and Esc cancels.

Plain ASCII

fatrat-tui draws boxes, arrows and progress bars with Unicode characters. It switches to plain ASCII characters when you give --ascii, or when the locale's character set isn't UTF-8 (when the locale set by LC_ALL, LC_CTYPE or LANG doesn't name UTF-8, or isn't installed). It uses colours when the terminal supports them.

More

The full reference is man fatrat-tui.