# Commands

> Every lemonfiber subcommand, what it does, and when to reach for it.

lemonfiber is one binary with one subcommand at a time. Run it with no
subcommand at all on a machine that is already set up and you get
[the terminal interface](/commands/the-tui/) instead.

Every subcommand below accepts the same six [global flags](/commands/global-flags/),
and every one of them has a machine-readable form. The tables here say what each
command is for; the full generated reference, with every argument and flag,
is [the complete command reference](/commands/every-command/) — generated from the
binary at the revision this site pins, which that page names at its foot.

- [Global flags](/commands/global-flags/)

  The six flags every subcommand takes, and the ones that only look global.
- [The terminal interface](/commands/the-tui/)

  The dashboard and the log viewer, and every key they answer to.
- [The complete command reference](/commands/every-command/)

  Generated from what the binary parses, at the revision this site pins.
- [Words we use](/start/words-we-use/)

  Form, profile, slice, drift, seed — the vocabulary these commands assume.

## Getting started

| Command       | What it does                                                             | Reach for it when                                                                                                                                                       |
| ------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `setup`       | Sets up the stack by answering a few questions                           | You are starting, or re-answering a question you got wrong. Interactive by default; the flags make it unattended                                                        |
| `settled`     | Says what setup settled and whether this stack is set up                 | You want the data root, the ways of downloading and the user the services run as, read from the configuration as it stands, without offering setup or changing anything |
| `migrate`     | Sees what is already on this machine, and takes it over if you choose to | You already run a media stack of your own and want lemonfiber to stand beside it, in place of it, or to carry its records across                                        |
| `walkthrough` | Adds one thing, end to end, and narrates every step                      | You want to watch the stack work once, so you know what it does because you saw it do it                                                                                |
| `version`     | Reports the versions in play                                             | You need the binary, stack, manifest schema and Compose versions in one place                                                                                           |

## Running the stack

| Command   | What it does                                                                                                                                    | Reach for it when                                                                                                                                               |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `forms`   | Lists the forms this stack has, and what each one is for                                                                                        | You want to know what starting something would come to, without starting it                                                                                     |
| `up`      | Starts a form, or the union of several                                                                                                          | You want part or all of the stack running                                                                                                                       |
| `down`    | Stops and removes what a form started                                                                                                           | You want it stopped. `--wait` lets downloads in flight finish first                                                                                             |
| `switch`  | Makes these forms the active set, leaving shared services running                                                                               | You are changing shape and do not want a running download interrupted for it                                                                                    |
| `restart` | Restarts services without touching the rest                                                                                                     | One service is misbehaving and the rest is fine                                                                                                                 |
| `pull`    | Fetches newer images without applying them                                                                                                      | You want the download done now and the change made later                                                                                                        |
| `update`  | Moves something onto a newer version — `stack` or `self`                                                                                        | You want the services on the versions this build pins, or want to know where this copy of lemonfiber stands                                                     |
| `watch`   | Guards the data location while forms run, stopping them if it disappears                                                                        | The library lives on a disk that can go away, and you would rather stop than write to the wrong place                                                           |
| `run`     | Runs a run-and-exit service where one of its times fell due since its last run                                                                  | You want a scheduled service run now rather than at its next time: `--now` runs it at once. The machine's scheduler calls it every minute for each such service |
| `hosting` | Says what this machine keeps running when no terminal is open                                                                                   | You want a long-running command to survive the terminal you started it in, and to know whether it really is                                                     |
| `stack`   | Says how the stack runs without lemonfiber: which stack, where its Compose project and `.env` are, and the `docker compose` words that start it | You want to know the stack would still run if lemonfiber were gone, and exactly how you would start it yourself                                                 |

## Seeing what is happening

| Command      | What it does                                                                                                          | Reach for it when                                                                                                                                                                              |
| ------------ | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ps`         | Reports what each service is actually doing                                                                           | You want the state of the stack in one screen                                                                                                                                                  |
| `logs`       | Shows what services are saying                                                                                        | You want the lines. `--follow` keeps reading; `--watch` opens the scrollable viewer                                                                                                            |
| `trace`      | Follows one show or film across the services                                                                          | You are asking "where is my show?" and want the answer step by step                                                                                                                            |
| `household`  | Shows what the household asked for, and where each request stands                                                     | You want the queue grouped by whoever asked for it                                                                                                                                             |
| `held`       | Shows what one member can actually watch, read from the media server as them                                          | You want to see what an age limit or a library restriction comes to, as the list it produces rather than the setting                                                                           |
| `playing`    | Shows what the media server is playing now: who is watching what, and where                                           | You want to know who is watching before you restart something. `--member` narrows it to one person's sessions                                                                                  |
| `channels`   | Shows the live TV channels one member may watch, each with what is on it now                                          | You want to see what live TV comes to for one person, read as them, so a channel outside their limits is left out                                                                              |
| `guide`      | Shows the live TV guide one member may watch: each channel's programmes from now                                      | You want what is on later as well as now. `LEMONFIBER_GUIDE_HOURS` sets how far ahead it reads, and each channel says where the media server's guide ends                                      |
| `tune`       | Opens a channel's live stream for one member, and says where it is served                                             | You want to watch a channel. Each location carries a pass that lapses after five minutes; `--stream` keeps it and `--stop` closes it, and every location is also drawn as a code to scan       |
| `play`       | Says where one title plays in a member's browser, on a pass holding a session on their own account                    | You want a title playing in a browser as that member. Hand the pass back with `--pass` within five minutes to keep playing; the location is also drawn as a code to scan                       |
| `stuck`      | Lists the items whose downloads are stuck                                                                             | Something reported a count of stuck items and you want them named                                                                                                                              |
| `queue`      | Says what the download queue holds that is wedged, why, how many strikes each has, and what the newest runs did to it | Downloads sit in the queue and never finish. `queue heal` drops each one that has struck out where healing is on, blocklists its release and searches again; `--dry-run` says what it would do |
| `front-door` | Names the one address to send somebody who lives here                                                                 | Somebody in the house asks where to go, and you want one answer rather than a list of ports                                                                                                    |
| `news`       | Lists lemonfiber's releases, what the household asked for, and the checks found wrong, each newest first              | You want what is new in one list. Each entry carries what names it, so a screen can mark what came after the newest it showed; the stack keeps nothing of what anybody has seen                |
| `boot`       | Says when this machine last started, and whether the stack, its tunnel and its forwarded port came back after it      | The machine restarted, and you want to know the stack is back rather than assume it                                                                                                            |
| `watcher`    | Says what the outside watcher sees beside what each of its monitors covers, and what no active monitor covers         | You want to know whether something outside lemonfiber would notice the stack going down, and what it would miss                                                                                |
| `copying`    | Says the backup or restore running here now, how far it has got and how it is moving                                  | A backup or restore is running and you want to know it is still moving rather than stuck                                                                                                       |

## The household

| Command   | What it does                                                             | Reach for it when                                                                                  |
| --------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| `invite`  | Offers somebody in the house an account they can claim                   | Somebody new should be able to watch. They set their own password; you never choose or see it      |
| `reissue` | Lets somebody set a new password, without you choosing or seeing it      | They are locked out. The account stays theirs and becomes claimable again                          |
| `remove`  | Takes somebody out of the household, in both places they have an account | They are leaving. It says what removing them costs before it removes anything                      |
| `clients` | Says which app to watch on, for each kind of device in the house         | Somebody asks what to install, and you want one answer per device rather than a list of everything |

## The disk and the line

| Command        | What it does                                                                  | Reach for it when                                                                                                                              |
| -------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `space`        | Accounts for the disk: where the room went, when it runs out, what can go     | The disk is filling and you want to know what took it, and what could be got back                                                              |
| `stop-seeding` | Stops seeding one completed download, and lets its files go with it           | You want the room back from one torrent, and to be told what letting it go costs first                                                         |
| `bandwidth`    | Accounts for the line: what it carries, what the stack takes, what that costs | The house is complaining, and you want the stack held to a share of the line rather than all of it                                             |
| `downloads`    | Pauses every download client the stack runs, or lets them all fetch again     | You want the line back now, whatever the schedule says. `pause` holds until `resume`: a schedule, a new month or a lifted cap does not undo it |

## Settings and quality

| Command           | What it does                                                                                                       | Reach for it when                                                                                                                                                                                                                                                       |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `config`          | Reads or changes one setting, through the three subcommands below                                                  | You are reaching for one of the three below                                                                                                                                                                                                                             |
| `config get`      | Reads one setting                                                                                                  | You want one value                                                                                                                                                                                                                                                      |
| `config set`      | Changes one setting                                                                                                | You want to change one value without opening a file                                                                                                                                                                                                                     |
| `config show`     | Shows every setting, with credentials withheld                                                                     | You want the whole picture and it is safe to look at                                                                                                                                                                                                                    |
| `settings`        | Lists every setting and secret the stack's services read: whose each is, what reads it, its default and your value | You want to know what a plugin or service can be told, and what it is told now. A secret's value is never printed                                                                                                                                                       |
| `settings set`    | Records your value for one setting, regenerating every entry that reads it                                         | A service should read something other than its declared default                                                                                                                                                                                                         |
| `settings clear`  | Takes your value away, so the declared default is written again                                                    | You want a setting back where its manifest put it                                                                                                                                                                                                                       |
| `alerts`          | Chooses how much lemonfiber tells you about, in plain language                                                     | You are being told too much, or too little, and want to say which                                                                                                                                                                                                       |
| `notify`          | Adds, proves, changes, lists or removes the back-ends the stack delivers its alerts to                             | You want alerts on ntfy, gotify, a webhook, an Apprise URL or a phone. `test` proves a back-end where its history can be read; `set --members` offers one to the household                                                                                              |
| `quality`         | Chooses how good your media should look, in plain language                                                         | You are reaching for one of the four below                                                                                                                                                                                                                              |
| `quality show`    | Shows the quality choice in force, and what each preset means and costs                                            | You are deciding, and the cost is the thing you are deciding on                                                                                                                                                                                                         |
| `quality set`     | Chooses a preset, for everything or for one media type                                                             | You want different quality, from now on                                                                                                                                                                                                                                 |
| `quality reapply` | Re-asserts the recorded preset over a hand-edited Recyclarr config                                                 | You edited the config, changed your mind, and want the preset to win                                                                                                                                                                                                    |
| `quality upgrade` | Re-downloads what is already here at the higher quality                                                            | You want the back catalogue brought up as well. Large and bandwidth-expensive, so it does nothing until `--confirm`                                                                                                                                                     |
| `subtitles`       | Shows the subtitle finder, fetches subtitles now, or proves its wiring                                             | An item is missing a wanted language. `show` names each such item beside the language profile and each provider; `fetch` fetches for one item, or for every item missing one; `prove` checks the wiring with a test fetch for an item lemonfiber picks from the library |

## Checking and repairing

| Command       | What it does                                                                    | Reach for it when                                                                                                                                         |
| ------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `doctor`      | Runs the checks that prove the stack is doing what it should                    | Anything is wrong, or nothing is and you want that established rather than assumed. `--fix` offers repairs one at a time; `--undo` puts the last one back |
| `automations` | Says each automation running beside the stack, and whether it is proved to work | You want to know what runs beside the stack, and which of it has been proved to work                                                                      |
| `history`     | Lists every change lemonfiber made, and how far each could be put back          | You want to know what changed, when, and whether it can be undone                                                                                         |
| `undo`        | Puts back one run of changes, named by the stamp `history` shows                | You want a seed or a reconfigure reversed. The whole run or none of it — the history says how many changes go with each entry                             |

## Wiring, and your own edits

| Command  | What it does                                                                                                             | Reach for it when                                                                                                                               |
| -------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `seed`   | Wires the stack's services to each other, idempotently                                                                   | A service has just joined the running set, or you want the wiring re-checked. It never overwrites what you changed                              |
| `wiring` | Says what the stack wires to what, and how each link was settled; `wiring fill` chooses which service fills a capability | Two services could answer the same need, or something asks for a capability nothing provides. The choice is journalled, and `undo` puts it back |
| `adopt`  | Adopts your current edits as lemonfiber's expected state                                                                 | You are happy with a change you made by hand and want it kept across future seeds and restores                                                  |
| `reset`  | Puts the stack back to lemonfiber's own state, reverting every edit you made                                             | You want your edits gone. It names what will be lost and does nothing until `--confirm`                                                         |

## Keeping and sharing your configuration

| Command   | What it does                                              | Reach for it when                                                                                             |
| --------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `backup`  | Backs up your configuration to an archive                 | You are about to change something, or you would rather your configuration stopped being precious              |
| `restore` | Restores your configuration from a backup archive         | You are putting a stack back, here or on another machine. A different data root needs `--repoint`             |
| `support` | Gathers what a person helping you would ask for, redacted | You are asking for help. A bare run writes nothing and says what the bundle would hold; `--write` produces it |

## What this machine keeps, and what leaves it

| Command       | What it does                                                                         | Reach for it when                                                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catalogue`   | Says what each service in this stack is for, and what became of any it dropped       | The service names convey nothing on their own and you want a sentence for each: what it does for you, what you lose while it is down, and how much that costs   |
| `provenance`  | Says where each service comes from: its licence, its project, and the version pinned | You want to check that what is bundled here is open source rather than take it on faith. It reads the stack description, so it answers with the containers down |
| `outbound`    | Lists everything that leaves this machine, and what refusing each of it costs        | You want to know what lemonfiber asks the internet for, what the services ask for on their own account, and what switching each off would stop                  |
| `stored`      | Lists what lemonfiber keeps on this machine, where it is, and why                    | You want to know what is on your disk because of lemonfiber, and to be sure your library is not part of it                                                      |
| `credentials` | Says which credentials this stack holds, or acts on one of them                      | You want to know what secrets exist, what each is for and where it stands. Values are never printed by a read                                                   |
| `forget`      | Removes everything lemonfiber keeps on this machine                                  | You are done with it. Your library, your downloads and the containers are never touched; it lists what would go and does nothing until `--confirm`              |
| `uninstall`   | Takes lemonfiber off this machine, at one of four removals                           | You are removing it and want to choose how far that goes. It lists what each removal would take before it takes anything                                        |

`outbound` says what would leave. What actually left is written down as it goes,
in `outbound.log` beside your settings: when, which kind of request, where it
went, and what came back. Never a header, never a body, and the address arrives
with its query stripped off, because a search term, a title or an indexer key
ends up there — a record kept to reassure you should not be a file full of your
own keys. It holds the last five hundred lines, oldest dropped, and `stored`
lists it with everything else.

## Serving it over HTTP

| Command         | What it does                                                                                                                        | Reach for it when                                                                                                                                                                                                                                                                                             |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ui`            | Serves the web interface and its JSON API for as long as you leave it running, printing the address and a token minted for that run | You are driving lemonfiber from a browser, a client or a script rather than a terminal. The web app built into the binary is served unless `--assets <PATH>` names a build of your own; `--lan` offers it to your network, once `--set-password` has set one; `--tls` serves it encrypted, on a port you name |
| `companion`     | Pairs a phone with this stack, or replaces the certificate a paired phone pins                                                      | You want a phone to reach this stack. `pair` makes the material it reads — a code for its camera, and the same text to type — and carries no credential; `certificate` replaces what a paired phone pins, which every paired phone then refuses until it is paired again                                      |
| `key`           | Mints, lists or revokes the keys another program reaches the web interface with                                                     | A program — Home Assistant, an assistant, a script — should reach this stack under a key of its own. `mint` gives it one scope, `read`, `act` or `member:<account>`, and shows the secret once; `revoke` refuses it from its next request                                                                     |
| `push-endpoint` | Lists or removes the phones that asked to be woken when this stack has something to say                                             | A phone is lost, replaced or should stop being woken. `list` names each by name, address and when it was registered; `remove` stops waking it                                                                                                                                                                 |

## Plugins

| Command  | What it does                                                          | Reach for it when                                                                                                                                                                                                                                                       |
| -------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `plugin` | Installs, updates and removes plugins, and reads what one may declare | You are adding a service the stack does not bundle, or writing one. `install`, `update` and `remove` change the machine and take `--dry-run`; `installed` lists what is here; `capabilities`, `extension-points`, `schema`, `claims` and `provenance` are for an author |

`install` takes a source: the plugin's name in the catalogue, its directory, the
`plugin.toml` inside it, or a git repository at the branch, tag or commit named
after its last `@`. `update` takes the new version's directory, or the
`plugin.toml` inside it. Neither is kept unless the plugin's own proofs hold
against its running service and the stack's checks still pass afterwards; if
either fails, the install is put back. There is no disable: a plugin is
installed or it is not, and `remove` takes its id. The author's reads need no
network, no catalogue and no running stack, and each names the generation it
reports — except `provenance`, the one read that asks a registry about an
image's signature. [Plugins](/plugins/) is the whole of it.

## Words, and help

| Command   | What it does                                            | Reach for it when                                                                     |
| --------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `explain` | Says what one of this product's words means             | A report used a word you do not have, and you want more than the sentence it gave you |
| `help`    | Prints this message or the help of the given subcommand | You want the same text this site generates its reference from                         |

## Where to go next

The [global flags](/commands/global-flags/) apply to all of the above, and
[the terminal interface](/commands/the-tui/) is what you get when you run none of
them. If you are following what a command told you rather than choosing one,
[when something is wrong](/fixing/) starts with the doctor. If you are writing a
script against the output rather than reading it,
[the API and the SDKs](/api/) describe the shape it arrives in.
