---
name: "lei"
section: "1"
platform: "linux"
package: "lei"
version: "2.1.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/lei"
---

# lei(1)

local email interface

## NAME

lei - local email interface

## SYNOPSIS

lei \[OPTIONS\] COMMAND

## DESCRIPTION

lei is a command-line tool for importing and searching email, regardless of whether it is from a personal mailbox or a public-inbox. lei supports a local, writable store built on top of [**public-inbox-v2-format**(5)](/public-inbox-v2-format/5.md) and [**public-inbox-extindex**(1)](/public-inbox-extindex/1.md). [**lei-q**(1)](/lei-q/1.md) provides an interface for querying messages across the lei store and read-only local and remote "externals" (inboxes and external indices).

Warning: lei is still in its early stages and may destroy mail. Be sure to have backups of destinations lei writes to.

Available in public-inbox 1.7.0+.

## OPTIONS

- \-c NAME=VALUE

  Override configuration `"NAME"` to `"VALUE"`.

- \-C DIR

  Change current working directory to the specified directory before running the command.  This option can be given before or after `"COMMAND"` and is accepted by all lei subcommands except [**lei-daemon-kill**(1)](/lei-daemon-kill/1.md).

## COMMANDS

Subcommands for initializing and managing local, writable storage:

- •

  [**lei-init**(1)](/lei-init/1.md)

- •

  [**lei-import**(1)](/lei-import/1.md)

- •

  [**lei-tag**(1)](/lei-tag/1.md)

The following subcommands can be used to manage and inspect external locations:

- •

  [**lei-add-external**(1)](/lei-add-external/1.md)

- •

  [**lei-forget-external**(1)](/lei-forget-external/1.md)

- •

  [**lei-ls-external**(1)](/lei-ls-external/1.md)

Subcommands related to searching and inspecting messages from the lei store and configured externals are

- •

  [**lei-blob**(1)](/lei-blob/1.md)

- •

  [**lei-config**(1)](/lei-config/1.md)

- •

  [**lei-edit-search**(1)](/lei-edit-search/1.md)

- •

  [**lei-forget-search**(1)](/lei-forget-search/1.md)

- •

  [**lei-lcat**(1)](/lei-lcat/1.md)

- •

  [**lei-ls-search**(1)](/lei-ls-search/1.md)

- •

  [**lei-p2q**(1)](/lei-p2q/1.md)

- •

  [**lei-q**(1)](/lei-q/1.md)

- •

  [**lei-rediff**(1)](/lei-rediff/1.md)

- •

  [**lei-up**(1)](/lei-up/1.md)

Other subcommands include

- •

  [**lei-add-watch**(1)](/lei-add-watch/1.md)

- •

  [**lei-config**(1)](/lei-config/1.md)

- •

  [**lei-convert**(1)](/lei-convert/1.md)

- •

  [**lei-daemon-kill**(1)](/lei-daemon-kill/1.md)

- •

  [**lei-daemon-pid**(1)](/lei-daemon-pid/1.md)

- •

  [**lei-forget-mail-sync**(1)](/lei-forget-mail-sync/1.md)

- •

  [**lei-mail-diff**(1)](/lei-mail-diff/1.md)

- •

  [**lei-inspect**(1)](/lei-inspect/1.md)

- •

  [**lei-ls-label**(1)](/lei-ls-label/1.md)

- •

  [**lei-ls-mail-source**(1)](/lei-ls-mail-source/1.md)

- •

  [**lei-ls-mail-sync**(1)](/lei-ls-mail-sync/1.md)

- •

  [**lei-ls-watch**(1)](/lei-ls-watch/1.md)

- •

  [**lei-rm-watch**(1)](/lei-rm-watch/1.md)

## FILES

By default, storage is located at `"$XDG_DATA_HOME/lei/store"`.  The configuration for lei resides at `"$XDG_CONFIG_HOME/lei/config"`.

## ERRORS

Errors and diagnostics for interactive commands are reported to stderr.  Some errors for background tasks are emitted via [**syslog**(3)](/syslog/3.md) as [**lei-daemon**(8)](/lei-daemon/8.md) for the top-level daemon, and `"lei/store"` for the [**lei-store-format**(5)](/lei-store-format/5.md) worker.

## CONTACT

Feedback welcome via plain-text mail to \<mailto:meta@public-inbox.org\>

The mail archives are hosted at \<https://public-inbox.org/meta/\> and \<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/\>

## COPYRIGHT

Copyright all contributors \<mailto:meta@public-inbox.org\>

License: AGPL-3.0+ \<https://www.gnu.org/licenses/agpl-3.0.txt\>

## SEE ALSO

[**lei-overview**(7)](/lei-overview/7.md), [**lei-daemon**(8)](/lei-daemon/8.md)
