id = "lf" name = "lf" homepage = "https://github.com/gokcehan/lf" description = "A terminal file manager written in Go with a heavy inspiration from ranger file manager." executables = ["lf"] [dotfiles] # doc.md, "CONFIGURATION", gives a table per file: # # lfrc Unix ~/.config/lf/lfrc Windows AppData\Roaming\lf\lfrc # colors Unix ~/.config/lf/colors Windows AppData\Roaming\lf\colors # icons Unix ~/.config/lf/icons Windows AppData\Roaming\lf\icons # # and then the variables behind them, "given with their order of precedences # and their default values": on Unix $LF_CONFIG_HOME, $XDG_CONFIG_HOME, # ~/.config; on Windows %LF_CONFIG_HOME%, %XDG_CONFIG_HOME%, %APPDATA%. That is # the XDG config home under both platform names — macOS is "Unix" here, lf has # no Application Support path — which is exactly [configHome]. paths = [ "[configHome]/lf/lfrc", "[configHome]/lf/colors", "[configHome]/lf/icons", ] # The same section puts lf's four state files in the *data* home, a different # directory: selection (files), marks, tags and command history live at # ~/.local/share/lf/ on Unix and AppData\Local\lf\ on Windows. lf joins those # from $LF_DATA_HOME / $XDG_DATA_HOME / ~/.local/share, so the dotted spelling # is the default rather than a constant; they are named here as literals # because they are being excluded rather than resolved. exclude = [ "~/.local/share/lf/", "%LOCALAPPDATA%/lf/", ] # A file manager with no accounts: lfrc is commands and settings, colors and # icons are per-extension display rules. secret = [] # No machine_lines. An lfrc is `set` options, `map` keybindings and `cmd` # definitions — the user's own shell snippets, which is the whole point of # carrying the file. Some of them do name a previewer script by path, but that # script travels with the config directory rather than staying behind, so # stripping those lines would break the file on arrival. [commands] format = 1 label = "Open lf" description = "Start the lf file manager in a directory, optionally with extra startup commands, a config file, or shell-integration output. Remote control, profiling and server flags are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = false } [[commands.source]] id = "doc" kind = "manual" url = "https://github.com/gokcehan/lf/blob/master/doc.md" revision = "2026-10" evidence = """ **-command** *command* **-config** *path* **-last-dir-path** *path* **-log** *path* **-print-last-dir** **-print-selection** **-selection-path** *path* **-single** [*path*] Execute *command* during client initialization (i.e. after reading configuration, before `on-init`). To execute more than one command, you can either use the **-command** flag multiple times Use the config file at *path* instead of the normal search locations. Print the last directory to stdout when lf exits. Same as **-print-last-dir**, but write the directory to *path* instead of stdout. Print selected files to stdout when opening a file in lf. Same as **-print-selection**, but write the newline-separated list to *path* instead of stdout. Start a stand-alone client without a server. Disables remote control. Append runtime log messages to *path*. """ [[commands.field]] id = "start_dir" label = "Start directory" type = "path" position = 0 path = { kind = "any", role = "input" } sources = ["doc"] [[commands.field]] id = "command" label = "Startup command" description = "lf command run after the config is read; repeat for several." type = "string" option = ["-command"] multiple = true effect = "exec" sources = ["doc"] [[commands.field]] id = "config" label = "Config file" type = "path" option = ["-config"] path = { kind = "file", role = "input" } sources = ["doc"] [[commands.field]] id = "print_selection" label = "Print selection on exit" type = "boolean" option = ["-print-selection"] sources = ["doc"] [[commands.field]] id = "selection_path" label = "Write selection to file" type = "path" option = ["-selection-path"] path = { kind = "file", role = "output", must_exist = false } effect = "overwrite" sources = ["doc"] [[commands.field]] id = "print_last_dir" label = "Print last directory on exit" type = "boolean" option = ["-print-last-dir"] sources = ["doc"] [[commands.field]] id = "last_dir_path" label = "Write last directory to file" type = "path" option = ["-last-dir-path"] path = { kind = "file", role = "output", must_exist = false } effect = "overwrite" sources = ["doc"] [[commands.field]] id = "single" label = "Stand-alone (no server)" type = "boolean" option = ["-single"] sources = ["doc"] [[commands.field]] id = "log" label = "Log file" type = "path" option = ["-log"] path = { kind = "file", role = "output", must_exist = false } sources = ["doc"] [[commands.task]] id = "browse" label = "Browse a directory" fields = ["start_dir"] [[commands.task]] id = "pick_files" label = "Use as a file picker" fields = ["start_dir", "print_selection", "selection_path"] required = ["print_selection"] [[commands.task]] id = "cd_on_exit" label = "Record last directory" fields = ["start_dir", "last_dir_path"] required = ["last_dir_path"] [[commands.group]] id = "basic" label = "Basic" fields = ["start_dir", "print_selection", "print_last_dir", "command"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["config", "selection_path", "last_dir_path", "single", "log"]