## Commands

**eilmeldung** provides a comprehensive command system that can be invoked in two ways:

- **Command line**: Press `:` to open the command line, then type your command and press Enter
- **Key bindings**: Commands are bound to key sequences (see the Keybindings section for defaults and customization)

Commands may accept parameters such as scopes, queries, names, URLs, and colors. On the command line, press TAB to see autocomplete suggestions for available values.

---

## Table of Contents

- [Example Commands](#example-commands)
- [Application Commands](#application-commands)
- [Panel Management](#panel-management)
- [Feed List Management](#feed-list-management)
- [Article List](#article-list)
- [Article Actions](#article-actions)
- [Import/Export](#importexport)
- [Navigation Commands](#navigation-commands)
- [Input-Related Commands](#input-related-commands)
- [Sorting Articles](#sorting-articles)

---

## Example Commands

Here are some common command examples to get you started:

```
:quit                                    # Quit the application
:sync                                    # Sync all feeds
:read                                    # Mark current article as read
:read %                                  # Mark all articles as read
:read unread today                       # Mark all unread articles from today as read
:in feeds read %                         # Mark all articles in selected feed as read
:filter title:breaking newer:"1 hour"    # Filter breaking news from last hour
:tag important                           # Tag current article as important
:tag tech unread                         # Tag all unread articles as tech
:untag work %                            # Remove work tag from all articles
:share clipboard                         # Share current article to clipboard
:feedadd https://example.com/feed.xml    # Add a new feed
:feedadd https://news.site/rss News      # Add feed with custom name
:categoryadd Technology                  # Add a new category
:tagadd urgent red                       # Add a red "urgent" tag
:rename Tech News Daily                  # Rename selected item
:importopml feeds.opml                   # Import feeds from OPML file
:exportopml backup.opml                  # Export feeds to OPML file
:focus articles                          # Focus the article list panel
:show unread                             # Show only unread articles in current panel
:show feeds all                          # Show all articles in the feed list
:searcharticles author:john newer:"3 days"  # Search for articles by John from last 3 days
:sort date                               # Sort by date (newest first)
:sort >date                              # Sort by date (oldest first)
:sort feed title                         # Sort by feed name, then by title
:sort feed date                          # Sort by feed (A-Z), then by date (newest first)
:sortreverse                             # Reverse current sort order
:sortclear                               # Clear sort order, restore default
```

---

## Application Commands

| Command   | Syntax                 | Context   | Description                                                                                        |
| --------- | --------               | --------- | -------------                                                                                      |
| `quit`    | `quit`                 | All       | Quit eilmeldung                                                                                    |
| `cmd`     | `cmd [<content>]`      | All       | Open command line with optional pre-filled content                                                 |
| `redraw`  | `redraw`               | All       | Redraw the screen                                                                                  |
| `refresh` | `refresh`              | All       | Refreshes the contents of all panels according to the current selections                           |
| `confirm` | `confirm <command>`    | All       | Ask for confirmation before executing command (typically used in key bindings)                     |
| `in`      | `in <panel> <command>` | All       | Run a command in the given panel (`feeds`, `articles`, `content`) (typically used in key bindings or `read`, `show` and `unread`) |
| `LOGOUT`  | `LOGOUT NOW`           | All       | Logout and remove ALL local data (requires `NOW` as confirmation)                                  |
| `nop`     | `nop`                  | All       | No operation (useful for unmapping key bindings)                                                   |

## Panel Management

| Command | Syntax | Context | Description |
|---------|--------|---------|-------------|
| `focus` | `focus <panel>` | All | Focus a specific panel: `feeds`, `articles`, or `content`. Examples: `:focus feeds`, `:focus articles` |
| `next` | `next` | All | Focus next panel (stops at article content) |
| `prev` | `prev` | All | Focus previous panel (stops at feed list) |
| `nextc` | `nextc` | All | Focus next panel (cycles back to feed list) |
| `prevc` | `prevc` | All | Focus previous panel (cycles back to content) |
| `zen` | `zen` | Article Content | Toggle distraction-free mode (hides all panels except article content) |



## Feed List Management

| Command            | Syntax                     | Context   | Description                                                                                                                                      |
| ---------          | --------                   | --------- | -------------                                                                                                                                    |
| `sync`             | `sync`                     | Feed List | Sync all feeds                                                                                                                                   |
| `feedadd`          | `feedadd <URL> [<name>]`   | Feed List | Add a new feed. Examples: `:feedadd https://example.com/feed.xml`, `:feedadd https://news.site/rss "News Site"`                                  |
| `categoryadd`      | `categoryadd <name>`       | Feed List | Add a new category. Example: `:categoryadd Technology`                                                                                           |
| `tagadd`           | `tagadd <name> [<color>]`  | Feed List | Add a new tag with optional color (e.g., `red`, `#ff0000`). Press TAB for suggestions. Examples: `:tagadd important red`, `:tagadd tech #0088ff` |
| `rename`           | `rename <new name>`        | Feed List | Rename the selected feed, category, or tag. Example: `:rename Tech News`                                                                         |
| `remove`           | `remove`                   | Feed List | Remove the selected item (only works for childless items)                                                                                        |
| `removeall`        | `removeall`                | Feed List | Remove the selected item with all its children                                                                                                   |
| `feedchangeurl`    | `feedchangeurl <URL>`      | Feed List | Change the URL of the selected feed. Example: `:feedchangeurl https://newurl.com/feed.xml`                                                       |
| `tagchangecolor`   | `tagchangecolor <color>`   | Feed List | Change color of selected tag (e.g., `blue`, `#0000ff`). Press TAB for suggestions. Examples: `:tagchangecolor green`, `:tagchangecolor #ff5500`  |
| `toggle`           | `toggle`                   | Feed List | Toggle selected item in the tree                                                                                                                 |
| `expand`           | `expand`                   | Feed List | Expands the current item in the tree                                                                                                             |
| `expandcategories` | `expandcategories <scope>` | Feed List | Expand categories with articles in scope, i.e., `all`, `unread` or `marked` articles                                                             |
| `collapse`         | `collapse`                 | Feed List | Collapses the current item in the tree                                                                                                           |
| `collapseall`      | `collapseall`              | Feed List | Collapses all items in the tree                                                                                                                  |
| `yank`             | `yank`                     | Feed List | Yank (copy) the selected feed or category for moving                                                                                             |
| `paste`            | `paste <position>`         | Feed List | Paste the yanked item. Position: `before` or `after`. Examples: `:paste after`, `:paste before`                                                  |
| `search`           | `search <searchterm>`      | Feed List | Search item in feed list; search term can be single word, quoted string or regular expression (see [Article Queries](queries.md))                | 
| 'sortfeeds`        | `sortfeeds`                | Feed List | Sort feed list alphabetically (cannot be undone)                                                                                                 |

## Article List

| Command | Syntax | Context | Description |
|---------|--------|---------|-------------|
| `nextunread` | `nextunread` | Article List | Select the next unread article in the list |
| `searcharticles` | `searcharticles <query>` | Article List | Search for articles matching the query. Example: `:searcharticles title:security newer:"1 week"` |
| `filter` | `filter <query>` | Article List | Filter the article list by query (non-sticky filter is not applied when changing when choosing another entry in feed list). Example: `:filter unread author:john` |
| `filtersticky` | `filtersticky <query>` | Article List | *Always* filter the article list by query. Example: `:filtersticky unread today` |
| `filterapply` | `filterapply` | Article List | Apply the current filter |
| `filterclear` | `filterclear` | Article List | Clear the current filter and show all articles |
| `query` | `query <query>` | Article List | Filter ALL articles and show result in article list. Example: `:filter lastsync unread` |
| `sort` | `sort <sort order>` | Article List | Sort the article list by the specified sort order. Examples: `:sort date`, `:sort >date`, `:sort feed title`, `:sort <feed >date author` |
| `sortreverse` | `sortreverse` | Article List | Reverse the current sort order (newest <-> oldest, A-Z <-> Z-A). Toggle between ascending and descending |
| `sortclear` | `sortclear` | Article List | Clear the current sort order and restore the default sort order |
| `scrape` | `scrape` | Article List, Article Content | Scrape the full article content from the web (for articles with truncated content) |

## Article Actions

These commands support a **scope parameter** to target specific articles:
- `.` or `current` or omitted: currently selected item only
- `%` or `all`: all items  
- `below`: all articles below (and including) the currently selected article (only in article list)
- `above`: all articles above (and including) the currently selected article (only in article list)
- Any query: all articles matching the query (only in article list)

| Command         | Syntax                       | Context                       | Description                                                                                                                                                                                                         |
| ---------       | --------                     | ---------                     | -------------                                                                                                                                                                                                       |
| `show`          | `show <scope>`               | Article List, Feed List       | Filter articles by scope: `all`, `unread`, or `marked`. Examples: `:show unread`, `:show marked`, `:in articles show all`                                                                                           |
| `read`          | `read [<scope>]`             | Feed List, Article List       | Mark articles as read. Examples: `:read` (current), `:read %` (all), `:read unread today` (unread from today), `:read feed:bbc` (all from BBC)                                                                      |
| `unread`        | `unread [<scope>]`           | Feed List, Article List       | Mark articles as unread. Examples: `:unread` (current), `:unread %` (all), `:unread marked` (all marked)                                                                                                            |
| `mark`          | `mark [<scope>]`             | Article List                  | Mark articles (starred/bookmarked). Examples: `:mark` (current), `:mark %` (all), `:mark unread` (all unread)                                                                                                       |
| `flag`          | `flag [<scope>]`             | Article List                  | Flag article (select for bulk-operation). Examples: `:flag` (current), `:flag %` (all), `:flag unread` (all unread)                                                                                                 |
| `unflag`        | `unflag [<scope>]`           | Article List                  | Unflag article (deselect for bulk-operation). Examples: `:unflag` (current), `:unflag %` (all), `:unflag read` (all read articles)                                                                                  |
| `flaginvert`    | `flaginvert [<scope>]`       | Article List                  | Invert flags (selection for bulk-operation). Examples: `:flaginvert` (current), `:flaginvert %` (all), `:flaginvert newer:"1 hour ago"` (articles newser than one hour)                                             |
| `unmark`        | `unmark [<scope>]`           | Article List                  | Unmark articles. Examples: `:unmark` (current), `:unmark %` (all)                                                                                                                                                   |
| `open`          | `open [<scope>]`             | Article List                  | Open articles in the web browser. Examples: `:open` (current), `:open marked` (all marked)                                                                                                                          |
| `openenclosure` | `open [<type>]`              | Article Content               | Opens an enclosure of the article (if available), if a type (`audio`, `video`, `image`) is given, the enclosure of the given type is opened (see also configuration options `enclosure_command`)                    |
| `tag`           | `tag <tag name> [<scope>]`   | Article List                  | Add tag to articles. Examples: `:tag important` (current), `:tag tech unread` (all unread), `:tag news %` (all articles)                                                                                            |
| `untag`         | `untag <tag name> [<scope>]` | Article List                  | Remove tag from articles. Examples: `:untag important` (current), `:untag tech marked` (all marked)                                                                                                                 |
| `share`         | `share <target>`             | Article List, Article Content | Share article title and URL. Built-in targets: `clipboard`, `reddit`, `mastodon`, `telegram`, `instapaper`. Custom targets (URL and commands) can be defined in the configuration file. Example: `:share clipboard` |

**Note:** By default, the commands `show`, `read` and `unread` are executed in the currently focused panel (feeds or articles). If you want to execute the command in a specific panel, use the `in` meta command, e.g., `in articles read %`, `in feeds show all`, etc.

## Import/Export

| Command | Syntax | Context | Description |
|---------|--------|---------|-------------|
| `importopml` | `importopml <path>` | All | Import feeds from an OPML file. Example: `:importopml feeds.opml` |
| `exportopml` | `exportopml <path>` | All | Export all feeds to an OPML file. Example: `:exportopml backup-feeds.opml` |

## Navigation Commands

These commands are typically used via key bindings rather than the command line.

| Command      | Syntax       | Context                 | Description                                                 |
| ---------    | --------     | ---------               | -------------                                               |
| `up`         | `up`         | All                     | Navigate up in the current context                          |
| `down`       | `down`       | All                     | Navigate down in the current context                        |
| `left`       | `left`       | All                     | Navigate left in the current context                        |
| `right`      | `right`      | All                     | Navigate right in the current context                       |
| `pageup`     | `pageup`     | All                     | Navigate up by one page                                     |
| `pagedown`   | `pagedown`   | All                     | Navigate down by one page                                   |
| `gotofirst`  | `gotofirst`  | All                     | Navigate to the first item                                  |
| `gotolast`   | `gotolast`   | All                     | Navigate to the last item                                   |
| `searchnext` | `searchnext` | Article List, Feed List | Jump to the next item matching the current search query     |
| `searchprev` | `searchprev` | Article List, Feed List | Jump to the previous item matching the current search query |


## Input-Related Commands

These commands belong to text input (e.g. command-line or search input) and must be assigned to single keys:

| Command   | Syntax    | Context                        | Description              |
| --------- | --------  | ---------                      | -------------            |
| `_submit` | `_submit` | Input                          | Submit the current input |
| `_abort`  | `_abort`  | Input                          | Abort the current input  |
| `_clear`  | `_clear`  | Input                          | Clear the current input  |
| `_search` | `_search` | Input, Article List, Feed List | Open find (search) input |

---

## Sorting Articles

Articles can be sorted by one or more criteria. Set sort orders directly via the `sort` command, e.g.

```
sort feed date
```

Sorts articles first by feed (ascending) and then by date (newest-first).

To reverse the sorting order, use `sortreverse`. To revert to the default sorting order, use `sortclear`.
The [Configuration](configuration.md) option `default_sort_order = "..."` defines the default sorting order.
An [Article Query](queries.md) can also contain a sort order which takes precedence over the default sorting order.
A sorting order defined by the command `sort` in turn takes precedence over the sorting order from the query. The priority is therefore (from highest to lowest):

- sort order from `sort` command
- sort order from `query`
- default sort order


### Sort Keys

| Key | Description |
|-----|-------------|
| `date` | Sort by article publication date/age |
| `synced` | Sort by when article was synced/fetched |
| `title` | Sort by article title (case-insensitive) |
| `author` | Sort by article author (case-insensitive) |
| `feed` | Sort by feed name (case-insensitive) |

### Sort Direction

| Symbol | Direction | Behavior |
|--------|-----------|----------|
| `<` or omitted | Ascending | A-Z for text, newest-first for dates |
| `>` | Descending | Z-A for text, oldest-first for dates |

**Note:** For date-based sorting (`date` and `synced`), the natural display order is newest-first. Therefore:
- `date` or `<date` shows newest articles first
- `>date` shows oldest articles first

### Multi-Level Sorting

Combine multiple sort keys (separated by spaces) to create multi-level sorting. Articles are sorted by the first key, then ties are broken by the second key, and so on.

### Sort Order Examples

```
date                              # Sort by date (newest first)
<date                             # Sort by date (newest first, explicit)
>date                             # Sort by date (oldest first)
feed                              # Sort by feed name (A-Z)
>feed                             # Sort by feed name (Z-A)
feed date                         # Sort by feed (A-Z), then date (newest first)
feed >date                        # Sort by feed (A-Z), then date (oldest first)
date title                        # Sort by date (newest first), then title (A-Z)
feed date author                  # Sort by feed (A-Z), date (newest), then author (A-Z)
```
