Skip to content

CLI Batching & Quick‐List Workspaces

Thiago Lucio edited this page Aug 25, 2026 · 2 revisions

CLI Batching & Quick‑List Workspaces

Flux provides a command‑line interface for scripting, pipeline automation, multi‑folder workspaces, and bulk icon customisation.

CLI Arguments

Argument Description
[PATH] Opens Flux at the given path. If PATH is an archive file (.zip, .7z, etc.), Flux enters virtual archive browsing.
-h, --help Print help and exit.
-v, --version Print version and exit.
--menu-editor Launch the context‑menu editor standalone.
--file-properties PATH Open a file‑properties dialog for PATH.
--set-icon TARGET IMAGE Apply a custom icon image to TARGET (file or directory).
--set-icons-stdin Read TARGET IMAGE pairs from standard input (tab or whitespace separated) and apply in bulk.
--reset-icon TARGET Remove custom icon from TARGET, restore default.
--reset-icons-stdin Read TARGET paths from standard input (one per line) and reset all custom icons.
--quick-list PATH... Open Flux with Quick‑List pre‑populated with PATHs.
--quick-list-stdin Read newline‑delimited folder paths from stdin and load them into the Quick‑List (empty lines and lines starting with # are ignored).

Batching‑specific arguments

The following arguments are designed for headless bulk operations:

  • --set-icons-stdin – reads a stream of TARGET IMAGE pairs and applies each override in a single run.
  • --reset-icons-stdin – reads a list of TARGET paths and removes all custom icon overrides for them.
  • --quick-list-stdin – reads a list of directory paths and opens Flux with all of them loaded into the Quick‑List panel.

Examples

1. Dynamic Project Auditing

Generate a list of top‑level directories in your home folder and open them as a triage workspace:

find ~ -maxdepth 1 -type d | flux-fm --quick-list-stdin

2. Persistent Workspace Launchers

Create a desktop entry that opens a set of frequently used project directories:

[Desktop Entry]
Type=Application
Name=Flux: Active Code Reviews
Exec=flux-fm --quick-list /home/user/Projects/core /home/user/Projects/api
Icon=applications-development
Categories=Utility;FileTools;

3. Automated Asset Branding

Apply custom folder icons from a manifest file (TSV):

cat project-icons.tsv | flux-fm --set-icons-stdin

The manifest contains one TARGET IMAGE pair per line, separated by a tab or whitespace.

4. Bulk Icon Reset for Archived Projects

Reset all custom icons for a list of obsolete project folders:

cat archived-projects.txt | flux-fm --reset-icons-stdin

5. Project Scaffolding with Custom Icon

Create a new project directory and assign a custom icon in a single command:

mkdir -p ~/Projects/new-service
flux-fm --set-icon ~/Projects/new-service ~/.local/share/icons/rust-badge.png

6. Headless File Properties

Inspect metadata of a file without opening the main window:

flux-fm --file-properties /path/to/document.pdf

7. Open an Archive in Browse Mode

Directly open a compressed archive as a virtual folder:

flux-fm ~/Downloads/archive.zip

8. Open a Directory in a New Window

Combined with the shell, this opens the current directory in a new Flux instance:

flux-fm .

Architecture

Quick List vs. Traditional Tabs

Flux's Quick List (exclusive_list) is a lightweight alternative to maintaining multiple fully active directory views.

  • Low overhead – inactive entries are stored as PathBuf values in memory.
  • Single active render tree – only the currently selected folder view creates UI widgets and file‑monitoring resources.
  • Ephemeral workspaces – lists supplied through --quick-list-stdin can be generated dynamically, requiring no persistent configuration.

This design keeps large triage queues inexpensive compared with maintaining multiple simultaneously active views.

Non‑Blocking Argument Parsing

Startup argument handling separates input‑stream processing from the process's global stdin behaviour through a generic BufRead implementation.

The resolve_startup_action_with_reader function accepts an injected reader, allowing production code and tests to use the same parsing logic without depending directly on an open process‑level stdin:

pub fn resolve_startup_action_with_reader<R: BufRead>(
    args: &[String],
    home_dir: PathBuf,
    reader: R,
) -> StartupAction

In tests, an in‑memory reader such as std::io::Cursor can be supplied, avoiding blocking on an unclosed or unavailable stdin stream while keeping the argument‑processing logic deterministic and testable.

Summary

The CLI capabilities provide three complementary automation paths:

  • Quick List loading – for dynamically assembling lightweight multi‑folder triage workspaces.
  • Batch icon operations – for applying or removing custom visual metadata across large numbers of files and directories.
  • Headless utilities – for standalone property inspection, archive browsing, and menu editing.

Together, these features make Flux easy to integrate into shell pipelines, project‑generation workflows, desktop launchers, and administrative automation.