Documentation menu

Operating the server

The memex command

The program that runs the server is also the tool that manages it. memex with no argument opens an assistant that takes the whole terminal and offers every action as a box to select; each action is also a subcommand with flags, so everything can be scripted.

Keys

KeyEffect
Arrows, or h j k lMove between the boxes.
EnterChoose; in a form, go to the next field, then save.
EscGo back, or cancel a question. On the first menu, q or Esc quits.
Tab, Shift-TabNext and previous field of a form.
PgUp, PgDnScroll the output of an action.
Ctrl-CQuit. While an action runs, this interrupts it.

Secrets such as a tunnel token or an API key are typed masked. Anything you must keep (the admin key and the setup link, a password-reset link) is printed again on the normal screen when the assistant closes, so it remains in the scrollback.

Line-by-line mode

The full-screen interface is used only when both the input and the output are a terminal. On a dumb terminal, or on request with the global --plain flag, the same questions are asked one line at a time, with the same result.

sudo memex --plain
sudo memex --plain install

Without a terminal at all (a script, a pipe) nothing is asked: commands need their flags, and destructive ones need --yes.

Subcommands

CommandPurpose
memex setupThe interactive assistant (same as memex alone).
memex installInstall, reinstall or change the access mode. See Quick install.
memex statusShow the state of the instance.
memex updateCheck for a new version and install it; --check, --rollback, --mode. See Updates.
memex backupWrite a backup archive. See Backup and restore.
memex restore <archive>Replace the data with the content of a backup.
memex reindexRebuild the search indexes and record files changed on disk.
memex configShow or change settings. See Configuration.
memex notifyManage notification channels. See Notifications.
memex modelManage the model of semantic search. See Semantic search.
memex admin-keyPrint a fresh setup key, only while no account exists.
memex resetCreate a password-reset link for an administrator, or erase everything. See Recovering administrator access.
memex uninstallRemove Memex from the machine. See Uninstalling.
memex serveRun the server; this is what the systemd service starts.
memex versionPrint the version.

Run them with sudo: the configuration and the data are not readable by ordinary users. Three flags apply to every command: --config <file> (default /etc/memex/config.toml), --lang en|fr and --plain.

The service

systemctl status memex
sudo systemctl restart memex
journalctl -u memex -f

The service runs as the memex user, restarts on failure and is sandboxed, with only /var/lib/memex writable. Reference: install.md.