.\" Generated by scdoc 1.11.3
.\" Complete documentation for this program is not available as a GNU info page
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.nh
.ad l
.\" Begin generated content:
.TH "NEWSRAFT" "1" "2025-10-04"
.PP
.SH NAME
.PP
newsraft - feed reader for terminal
.PP
.SH SYNOPSIS
.PP
\fBnewsraft\fR [\fB-f\fR \fIFILE1\fR] [\fB-c\fR \fIFILE2\fR] [\fB-d\fR \fIFILE3\fR] [\fB-l\fR \fIFILE4\fR] [\fB-e\fR \fIACTION\fR] [\fB-v\fR] [\fB-h\fR]
.PP
.SH DESCRIPTION
.PP
Newsraft is a small text based program for reading syndication feeds.\& It obtains
content from a given set of sources and lets you browse it all via one
streamlined user interface.\&
.PP
.SH OPTIONS
.PP
\fB-f\fR \fIFILE\fR
.RS 4
Force \fBfeeds\fR file to \fIFILE\fR.\&
.PP
.RE
\fB-c\fR \fIFILE\fR
.RS 4
Force \fBconfig\fR file to \fIFILE\fR.\&
.PP
.RE
\fB-d\fR \fIFILE\fR
.RS 4
Force \fBdatabase\fR file to \fIFILE\fR.\&
.PP
.RE
\fB-l\fR \fIFILE\fR
.RS 4
Write logs to \fIFILE\fR.\&
.PP
.RE
\fB-e\fR \fIACTION\fR
.RS 4
Execute one-time \fIACTION\fR from the following list:
.RS 4
\fBconvert-opml-to-feeds\fR (takes OPML from standard input)
.br
\fBconvert-feeds-to-opml\fR (takes feeds from \fBfeeds\fR file)
.br
\fBreload-all\fR
.br
\fBprint-unread-items-count\fR
.br
\fBpurge-abandoned\fR
.PP
.RE
.RE
\fB-v\fR
.RS 4
Print version information.\&
.PP
.RE
\fB-h\fR
.RS 4
Print usage information.\&
.PP
.RE
.SH STARTER GUIDE
.PP
To start using Newsraft you have to create a \fBfeeds\fR file with the list of links
to feeds you want to receive news from.\& Check out \fBFEEDS FILE\fR section for file
syntax and valid paths.\&
.PP
When \fBfeeds\fR file is ready, you can launch Newsraft.\& There are only 4 menus you
will have to deal with: \fIsections\fR, \fIfeeds\fR, \fIitems\fR and \fIpager\fR.\& Default binds
are listed in \fBACTIONS\fR section.\&
.PP
\fISections\fR menu consists of section entries which are needed to organize feeds
in groups to be able to process them in bulk.\& They are kind of directories for
feeds.\& If you didn'\&t specify any section declarations in your \fBfeeds\fR file then
you will get to the \fIfeeds\fR menu straightaway.\&
.PP
\fIFeeds\fR menu consists of feed entries.\& Every feed entry contains news downloaded
from one specific source which you have set in \fBfeeds\fR file.\& To update a single
feed you have to select it and press \fBr\fR or \fBR\fR if you want to update all feeds.\&
From \fIfeeds\fR menu you can get to the \fIitems\fR menu by entering some feed.\&
.PP
\fIItems\fR menu consists of feed item entries (i.\& e.\& single pieces of news) which
you get when you update feeds in the previous menu.\& Every feed item entry has
two switchable properties - read state and importance state.\& Keys to change read
state: \fBd\fR to mark read, \fBD\fR to mark unread, \fB^D\fR to mark everything read.\& Keys
to change importance state: \fBf\fR to flag important, \fBF\fR to flag unimportant.\& To
view item'\&s content you have to go to \fIpager\fR menu by entering selected item.\&
.PP
\fIPager\fR menu will display some details about selected item and render its
content if it was provided by feed.\& Usually feed item entries have a links
section with one link pointing to a related web page and several links that were
mentioned in the item'\&s content.\& You can copy these links into your clipboard
with \fBy\fR key and open them in your web browser with \fBo\fR key.\& To target a key
action to link with a specific index you have to prefix your key with this
index.\& For example, \fB5y\fR will copy fifth link and \fB17o\fR will open seventeenth
link in the web browser.\& You can also setup custom command bindings to execute
any commands with these links.\& Consider this \fBconfig\fR file:
.PP
.RS 4
\fIbind m exec mpv "%l"\fR
.br
\fIbind f exec feh "%l"\fR
.PP
.RE
With this you will be able to open any link in \fBmpv\fR(1) and \fBfeh\fR(1) directly
from your terminal!\& Isn'\&t it awesome?\& It is freaking amazing!\&
.PP
For both \fIsections\fR menu and \fIfeeds\fR menu there is a special explore mode.\& You
can toggle it by pressing the \fBtab\fR key.\& It'\&s truly miraculous: it reveals all
the news in the current context (combines news from all feeds of the current
menu into one list).\& This mode may come in handy when you want to quickly scroll
through all the news without switching between sections and feeds back and forth.\&
.PP
And for a dessert, I'\&ll tell you about the search functionality.\& You can type
\fB/\fR to begin search input - enter the desired query here and press \fBEnter\fR.\& This
will open up an \fIitems\fR menu with all the items matching your query in the
current context.\&
.PP
.SH CONFIGURATION
.PP
.SS FEEDS FILE
.PP
This file contains feed entries that Newsraft will display and process.\& There
are 4 types of lines in \fBfeeds\fR file.\&
.PP
Comment lines start with \fI#\fR character.\& These lines are completely ignored.\& For
example:
.PP
.RS 4
\fI# Look closely.\& The beautiful may be small.\&\fR
.PP
.RE
Feed lines start with a URL.\& After at least one whitespace character, the name
of the feed may be specified - it must be enclosed in double quotes.\& For
example:
.PP
.RS 4
\fIhttps://example.\&org/feed.\&xml "Lorem Ipsum Blog"\fR
.PP
.RE
Generator lines start with a command enclosed in \fB$()\fR.\& These act just like feed
lines but instead of fetching resources from a remote server they use the output
of the specified command to obtain the content.\&
.PP
.RS 4
\fI$(cat ~/local-feed.\&xml) "Lorem Ipsum Blog"\fR
.PP
.RE
Section lines start with \fB@\fR character.\& After any number of whitespace characters,
the name of the section must be specified.\& For example:
.PP
.RS 4
\fI@ Software Releases\fR
.PP
.RE
Both feed and section lines allow you to set individual settings and binds for
them.\& The syntax is as follows:
.PP
.RS 4
\fI@ Lorem Ipsum < reload-period 1440\fR
.br
\fIhttp://example.\&org/feed1.\&xml "Dolor Sit" < reload-period 60; item-limit 500\fR
.br
\fIhttp://example.\&org/feed2.\&xml "Id Est" < bind b mark-read; exec book.\&sh "%l"\fR
.PP
.RE
Settings set for feeds take precedence over the settings specified for sections.\&
Not every setting supports individual assignment - only settings with asterisk
\fB(*)\fR on them do (see \fBSETTINGS\fR section).\&
.PP
Search precedence:
.PD 0
.IP 1. 4
\fI$XDG_CONFIG_HOME\fR/newsraft/feeds
.IP 2. 4
\fI$HOME\fR/.\&config/newsraft/feeds
.IP 3. 4
\fI$HOME\fR/.\&newsraft/feeds
.PD
.PP
.SS CONFIG FILE
.PP
This file is used to override default settings and bindings of Newsraft.\&
Presence of \fBconfig\fR file is totally optional and Newsraft will work without it
just fine.\& There are 3 types of lines in \fBconfig\fR file.\&
.PP
Comment lines start with \fI#\fR character.\& These lines are completely ignored.\& For
example:
.PP
.RS 4
\fI# Good design is as little design as possible.\&\fR
.PP
.RE
Setting lines start with a setting name and end with a setting value.\& Available
settings are listed in the \fBSETTINGS\fR and \fBCOLOR SETTINGS\fR sections.\& Here are a
couple of examples:
.PP
.RS 4
\fBscrolloff\fR \fI5000\fR
.br
\fBlist-entry-date-format\fR \fI"%D"\fR
.br
\fBfeeds-menu-paramount-explore\fR \fItrue\fR
.PP
.RE
Binding lines start with the \fBbind\fR word.\& They define actions that are performed
when certain keys are pressed.\& Complete list of available actions can be found
in the \fBACTIONS\fR section.\& Here'\&s an example:
.PP
.RS 4
\fBbind\fR r \fIreload-all\fR
.PP
.RE
The special \fIexec\fR action makes it possible to run shell commands when the bound
key is pressed.\& Specifiers within the command are replaced with values
corresponding to the currently selected entry as per \fBmenu-item-entry-format\fR:
.PP
.RS 4
\fBbind\fR m \fIexec\fR setsid mpv --terminal=no "%l" &
.PP
.RE
The \fIedit\fR action runs a specified SQL query on the \fBdatabase\fR, so please be
careful!\& \fI@selected\fR specifier is replaced with a condition which identifies the
currently selected entry - make sure to include it if you want to target
individual item/feed rather than the whole database:
.PP
.RS 4
\fBbind\fR w \fIedit\fR UPDATE items SET user_data = json_set(IFNULL(user_data, '\&{}'\&), '\&$.\&toWatch'\&, 1) WHERE \fI@selected\fR
.br
\fBbind\fR W \fIedit\fR UPDATE items SET user_data = json_set(IFNULL(user_data, '\&{}'\&), '\&$.\&toWatch'\&, 0) WHERE \fI@selected\fR
.PP
.RE
Use the \fIfind\fR action to retrieve items based on a specified SQL condition in
the current context.\& For instance, to search for items marked as toWatch (as
shown in the previous example), one can use the bindings like the following:
.PP
.RS 4
\fBbind\fR f \fIfind\fR user_data LIKE '\&%"toWatch":1%'\&
.br
\fBbind\fR f \fIfind\fR json_extract(user_data, '\&$.\&toWatch'\&) = 1
.PP
.RE
Binding lines can fit multiple actions in a single key.\& These actions will be
executed in the order in which they are specified.\& Assigned actions
must be separated with semicolon (;) characters, for example:
.PP
.RS 4
\fBbind\fR key \fIaction\fR; \fIexec\fR command; \fIaction\fR; \fIedit\fR query; \fIaction\fR
.PP
.RE
In case you want to disable some binding which was set in Newsraft by default,
you can use a line according to this format:
.PP
.RS 4
\fBunbind\fR key
.PP
.RE
Search precedence:
.PD 0
.IP 1. 4
\fI$XDG_CONFIG_HOME\fR/newsraft/config
.IP 2. 4
\fI$HOME\fR/.\&config/newsraft/config
.IP 3. 4
\fI$HOME\fR/.\&newsraft/config
.PD
.PP
.SS DATABASE FILE
.PP
This file stores everything you download from feeds in \fBsqlite3\fR(1) format.\&
Although you now know the format in which the data is stored, it is highly
recommended to avoid modifying the database manually - things will break and
it will be very sad.\&
.PP
Search precedence:
.PD 0
.IP 1. 4
\fI$XDG_DATA_HOME\fR/newsraft/newsraft.\&sqlite3
.IP 2. 4
\fI$HOME\fR/.\&local/share/newsraft/newsraft.\&sqlite3
.IP 3. 4
\fI$HOME\fR/.\&newsraft/newsraft.\&sqlite3
.PD
.PP
.SH SETTINGS
.PP
Settings with asterisk \fB(*)\fR on them can be set for individual feeds and sections.\&
.PP
.SS reload-period (*)
Default: \fI0\fR.\& Feed auto reload period in minutes.\& If set to \fI0\fR, no auto reloads
will be run.\&
.PP
.SS suppress-errors (*)
Default: \fIfalse\fR.\& If \fItrue\fR, feed update error indication in the menu will be
disabled.\& It'\&s recommended to set this setting only for specific feeds that are
expected to fail frequently and you are tired of seeing their errors.\&
.PP
.SS item-rule (*)
Default: \fI""\fR.\& Item search condition when accessing database.\& This can be very
useful in managing feeds with a heavy spam flow: you set a condition based on
some parameters and only those entries that meet this condition will be shown in
the feed.\& It'\&s specified in SQL format.\& It probably only makes sense to set this
setting for individual feeds, and not globally (see \fBFEEDS FILE\fR section to
understand how).\&
.PP
Available parameters:
.TS
l l lx
l l l
l l l
l l l
l l l
l l l
l l l
l l l
l l l
l l l.
T{
\fIguid\fR
T} T{
(string)
T} T{
Globally unique identifier of the article which is expected to be unique within the originating feed
T}
T{
\fItitle\fR
T} T{
(string)
T} T{
Title of the article
T}
T{
\fIlink\fR
T} T{
(string)
T} T{
URL of the article
T}
T{
\fIcontent\fR
T} T{
(string)
T} T{
Content of the article which is stored exactly as it appears in the feed, with all original HTML preserved
T}
T{
\fIattachments\fR
T} T{
(string)
T} T{
Serialized string of all attachments with URL links, MIME types and byte sizes
T}
T{
\fIpersons\fR
T} T{
(string)
T} T{
Serialized string of all people related to the article with names and email addresses
T}
T{
\fIdownload_date\fR
T} T{
(integer)
T} T{
Timestamp of download date in seconds since 1970
T}
T{
\fIpublication_date\fR
T} T{
(integer)
T} T{
Timestamp of publication date in seconds since 1970
T}
T{
\fIupdate_date\fR
T} T{
(integer)
T} T{
Timestamp of update date in seconds since 1970
T}
T{
\fIuser_data\fR
T} T{
(string)
T} T{
User-defined data for the item.\& It can be modified using the \fBedit\fR action (see \fBCONFIG FILE\fR section)
T}
.TE
.sp 1
Here are some examples of correct setting values:
.PP
.RS 4
\fItitle NOT LIKE '\&%Rust%'\&\fR
.br
\fIpersons LIKE '\&%PHARMACIST%'\& OR persons LIKE '\&%OFFL1NX%'\&\fR
.br
\fIattachments LIKE '\&%audio/mp3%'\& OR attachments LIKE '\&%video/mp4%'\&\fR
.br
\fICAST(strftime('\&%Y'\&, publication_date, '\&unixepoch'\&) AS INTEGER) >= 2024\fR
.br
\fINOT (title REGEXP '\&.\&+:.\&+\e".\&+\e".\&+by'\& OR title LIKE '\&%(ultra slowed)%'\& OR title LIKE '\&%(1 hour version)%'\&)\fR
.PP
.RE
REGEXP operator uses POSIX Extended Regular Expression syntax, see \fBregex\fR(7).\&
.PP
.SS item-limit (*)
Default: \fI0\fR.\& Maximum number of items stored in a feed.\& If set to \fI0\fR, no limit
will be set.\&
.PP
.SS item-limit-unread (*)
Default: \fItrue\fR.\& If \fItrue\fR, \fBitem-limit\fR setting will also cap unread items.\&
.PP
.SS item-limit-important (*)
Default: \fIfalse\fR.\& If \fItrue\fR, \fBitem-limit\fR setting will also cap important items.\&
.PP
.SS scrolloff
Default: \fI0\fR.\& Minimal number of list menu entries to keep above and below the
selected entry.\& If you set it to a very large value the selected entry will
always be in the middle of the list menu (except for start and end of the list
menu).\&
.PP
.SS scrollwrap
Default: \fIfalse\fR.\& If \fItrue\fR, moving down while on the last item in a list
will wrap around to the top and vice versa.\&
.PP
.SS pager-width (*)
Default: \fI100\fR.\& Pager width in characters.\& If set to \fI0\fR, the pager will take up
all available space.\&
.PP
.SS pager-centering (*)
Default: \fItrue\fR.\& If \fItrue\fR and \fBpager-width\fR is not \fI0\fR, pager will center its
content horizontally.\&
.PP
.SS menu-item-sorting
Default: \fItime-desc\fR.\& Sorting order for the items menu.\& Available values:
\fItime-desc\fR, \fItime-asc\fR, \fItime-download-desc\fR, \fItime-download-asc\fR,
\fItime-publication-desc\fR, \fItime-publication-asc\fR, \fItime-update-desc\fR,
\fItime-update-asc\fR, \fIrowid-desc\fR, \fIrowid-asc\fR, \fIunread-desc\fR, \fIunread-asc\fR,
\fIimportant-desc\fR, \fIimportant-asc\fR, \fIalphabet-desc\fR, \fIalphabet-asc\fR.\&
.PP
.SS menu-feed-sorting
Default: \fInone\fR.\& Sorting order for the feeds menu.\& Available values:
\fIunread-desc\fR, \fIunread-asc\fR, \fIalphabet-desc\fR, \fIalphabet-asc\fR.\&
.PP
.SS menu-section-sorting
Default: \fInone\fR.\& Sorting order for the sections menu.\& Available values:
\fIunread-desc\fR, \fIunread-asc\fR, \fIalphabet-desc\fR, \fIalphabet-asc\fR.\&
.PP
.SS menu-responsiveness
Default: \fItrue\fR.\& If \fItrue\fR, update menu contents as soon as possible.\&
If \fIfalse\fR, the menu will be updated only when you re-open it.\&
.PP
.SS open-in-browser-command (*)
Default: \fIauto\fR.\& Shell command for \fBopen-in-browser\fR action.\& If set to \fIauto\fR,
most operating systems will get \fI${BROWSER:-xdg-open} "%l"\fR while macOS users
have it set to \fIopen "%l"\fR.\&
.PP
.SS copy-to-clipboard-command
Default: \fIauto\fR.\& Shell command for copying text to clipboard.\& All copied data is
piped into the standard input of the specified command.\& If set to \fIauto\fR,
Newsraft will determine the appropriate command based on the user environment:
.PP
.PD 0
.IP \(bu 4
\fI"wl-copy"\fR if environment variable WAYLAND_DISPLAY is set
.IP \(bu 4
\fI"xclip -selection clipboard"\fR if environment variable DISPLAY is set
.IP \(bu 4
\fI"pbcopy"\fR if Newsraft was built for macOS operating system
.IP \(bu 4
\fI"newsraft-osc-52"\fR otherwise
.PD
.PP
\fI"newsraft-osc-52"\fR is a special value that doesn'\&t run an external command but
instead triggers the OSC 52 escape sequence, instructing the terminal to copy
data directly to the system clipboard.\& This behavior is especially useful when
running Newsraft over \fBssh\fR(1), as it allows clipboard operations to affect the
local system rather than the remote one.\&
.PP
.SS notification-command (*)
Default: \fIauto\fR.\& Shell command for invoking system notifications about new news
received.\& If set to \fIauto\fR, Newsraft will determine the appropriate command
based on the user environment:
.PP
.PD 0
.IP \(bu 4
\fI"notify-send '\&Newsraft brought %q news!\&'\&"\fR if WAYLAND_DISPLAY or DISPLAY is set in environment
.IP \(bu 4
\fI"osascript -e '\&display notification "Newsraft brought %q news!\&"'\&"\fR if Newsraft was built for macOS operating system
.IP \(bu 4
\fI"printf '\&\ee]9;Newsraft brought %q news!\&\ea'\&"\fR (OSC 9 escape sequence) otherwise
.PD
.PP
.SS proxy (*)
Default: \fI""\fR.\& Sets the proxy to use for the network requests.\& It must be either
a hostname or dotted numerical IPv4 address.\& To specify IPv6 address you have to
enclose it within square brackets.\& Port number can be set by appending :PORT to
the end of setting value.\& By default proxy protocol is considered HTTP, but you
can set a different one by prepending SCHEME:// to the setting value.\&
.PP
.SS proxy-user (*)
Default: \fI""\fR.\& User for authentication with the proxy server.\&
.PP
.SS proxy-password (*)
Default: \fI""\fR.\& Password for authentication with the proxy server.\&
.PP
.SS global-section-name
Default: \fIGlobal\fR.\& Name of the section that contains all feeds.\&
.PP
.SS global-section-hide
Default: \fIfalse\fR.\& If \fItrue\fR, global section will not be shown.\&
.PP
.SS status-show-menu-path
Default: \fItrue\fR.\& If \fItrue\fR, print menu path in the status bar.\&
.PP
.SS status-placeholder
Default: \fIr:reload R:reload-all tab:explore d:read D:unread f:important F:unimportant n:next-unread N:prev-unread p:next-important P:prev-important\fR.\&
.PP
Placeholder which is put in the status bar if it'\&s empty.\&
.PP
.SS item-content-format (*)
Default: \fIFeed: %f
|Title: %t
|Date: %d
|
%c
|