Documentation

Command-line options

Generated from the app's code - do not edit by hand. cargo xtask site-docs

The text below is what mo-explorer.exe --help prints. mo.exe (next to mo-explorer.exe, for scripts and the console) accepts the same switches, waits for the result with --wait and returns the exit code.

Usage: mo-explorer.exe [path ...] [switches]

  path                  folder = tab (the first one is active); file = open its
                        folder and select it. Relative paths are resolved against
                        the current folder, C: = drive root; sftp://, ftp://
                        and mtp:// paths too
  --select <file>       select a file (repeatable)
  --new-tab             always a new tab (even if the folder is already open)
  --new-window          new window
  --split <folder>      second pane on the right
  --view <view>         list | tiles | grid | detail | columns
  --sort <key>[:desc]   name | size | date | type | ext
  --filter <expr>       list filter (text or [ext = pdf] [size > 10mb])
  --search <text>       name search in the folder including subfolders
  --cmd <id>[=arg]      command palette command in the running window
                        (repeatable, run in order); IDs: --list-commands
  --cmd-arg <value>     argument of the preceding --cmd
  --window <id>         target window for --cmd (list: --list-windows)
  --list-commands, --list-windows [--json]
  --results <file|->    list of paths as a result tab (- = stdin)
  --title <text>        name of the result tab
  mo.exe (scripts) also: --wait (wait until done, return the exit code),
                        --timeout <s>, --no-start
  mo diskmap <folder>   what takes up space (mo diskmap --help)
  mo cleanup [drive]    disk cleanup (mo cleanup --help)
  mo link upload <link> upload the changes of a linked folder without the window
                        (--plan, --yes; codes in the documentation)
  --help, --version

  Values can also be written as --view=columns. View and sorting apply only
  to the opened tab (nothing is saved to settings or templates).

Explorer:         /select,<file>  /e,<folder>  /root,<folder>
Total Commander:  /L=<folder> left pane   /R=<folder> right pane
                  /T new tab   /O into the running window   /N new window

Default folder browser (instead of Explorer):
  --default-fm register|unregister [--all-users]
                        --all-users = all users (run as administrator)

Examples:
  mo-explorer.exe D:\Photos --view grid --sort date:desc
  mo-explorer.exe C:\Projects --split D:\Backups
  mo-explorer.exe --select D:\Downloads\setup.exe
  mo-explorer.exe --cmd nav.go=D:\Photos --cmd select.mask=*.jpg

If MagnumOpus is already running, everything opens in it (turned off by
Settings > General > Folders from other apps as a tab).
Exit code 2 = invalid switch, 4 = unknown command, 6 = no such window,
9 = control from the command line is turned off. Details: README, Command line.

mo diskmap --help - what takes up space, for scripts and agents (see Automation and scripting):

Usage: mo diskmap <folder> [switches]

What takes up space in a folder or on a disk, for scripts and agents. Nothing
is deleted. With the MFT folder size service only the listed folders are
read (instant even for a whole disk), otherwise the folder is scanned.

  --depth <n>           tree levels (default 2)
  --top <n>             largest items per folder (default 20; --flat 50;
                        at most 5000)
  --min-size <size>     hide smaller items: 100MB, 1.5G, 500k or 1%
  --flat                largest files anywhere under the folder instead of
                        the tree (always scans)
  --json                JSON for scripts (non-ASCII characters as \uXXXX;
                        text in the console code page, dates local;
                        JSON in UTC)
  --scan                always scan (do not use the service)
  --help

Hidden items are summed up in a "N more" line. Labels in [ ] say what can
usually be deleted: build output, dependencies, temporary files, caches,
the Recycle Bin, crash dumps, previous Windows; system files are marked
not to be deleted by hand.

Examples:
  mo diskmap C:\ --depth 3
  mo diskmap . --flat --top 20 --min-size 100MB
  mo diskmap D:\Projects --json > usage.json

Paths in the text output are for reading only (characters outside the
code page become ?) - act on paths from --json.

Exit code 0 = done (also when some subfolders cannot be read - see the
error line / "errors"), 1 = the folder cannot be read or an internal
error, 2 = invalid switch or the folder does not exist, 3 = mo-explorer.exe
is missing next to mo.exe.

mo cleanup --help - disk cleanup, for scripts and agents (see Automation and scripting):

Usage: mo cleanup [<drive>] [switches]

Disk cleanup for scripts and agents: what can be freed on a drive, by
category. Without --run nothing is deleted.

  <drive>               C:, D:\ or a path on the drive (default: the drive
                        of the current folder)
  --list <id>           items of a category (paths and sizes); build searches
                        the folders with projects now
  --run <id,id...>      clean up categories permanently - only temp, thumbs,
                        mo, browser, shader, dumps (the same as the tab: open
                        files are skipped)
  --yes                 do not ask before --run
  --json                JSON for scripts (non-ASCII characters as \uXXXX)
  --help

The Recycle Bin, personal files, developer caches, projects and system
items (administrator) are cleaned only in the tab (Clean up disk...), item
by item.

Examples:
  mo cleanup
  mo cleanup D: --json
  mo cleanup C: --list browser
  mo cleanup C: --run temp,browser --yes

Exit code 0 = done (skipped open files too - see --json), 1 = a category
failed or the question was declined, 2 = invalid switch, drive or category, 3 = mo-explorer.exe is
missing next to mo.exe.
Something wrong or missing? Open an issue