What is marked in the panes in your commands, your commands’ output in the panes, and file operations from the shell that Ctrl+Z takes back.
What it is
fn is a small program that TheFile.Ninja hands to everything it starts: the terminal under a list, the commands a Lua script runs, a program on the toolbar, a .ps1 or .bat opened with Enter. Through it the shell sees what the panes show — the folder, the marked items, every place the app can list — and the panes show what the shell makes.
It is there only inside the app. It is not put on the computer’s PATH: a command that fails whenever the app is not running would be worse than none. Standard output is data, standard error is talk, and the exit code is the outcome, so fn fits in a pipeline, in $(…) and in for /f.
A first look
Open a terminal under the list (Ctrl+O, by default) and try:
fn sel # the marked items, else the one under the cursor: one path a line
fn cp --sel # copy them into the other pane's folder, as F5 does
fn rm *.tmp # to the Recycle Bin; fn undo, or Ctrl+Z, puts them back
rg -l TODO | fn mount todos --open # the files a search found, as a folder in the pane
cd "$(fn pick --folder)" # the pane as the shell's folder dialog
fn help lists the commands, and fn help cp says everything about one. This page is those texts, for fn 0.1.6.
Which pane
A terminal sits under a tab, and fn run in it means that tab: its folder, its marks. Not whichever pane happens to be active. --pane reaches the others: here (this terminal's tab), active, other, left, right. Where there is no terminal (a program started from the toolbar), “here” is the active pane.
Items
The commands that act on files take their items in three ways:
Named, wildcards too: fn rm *.tmp. fn expands the wildcards itself, so PowerShell and cmd, which pass *.tmp on as it is, work as bash does. Hidden and system files are left out.
Piped in, with -: fn sel | fn rm - (-0 for names ending in a NUL character).
The pane’s own, with --sel: the marked items, else the one under the cursor.
Never none. A command that changes files and names no items is refused, so nothing ever acts on whatever happens to be marked because the items were left out. The items may be anywhere the app reaches: on a server, inside an archive, on a phone.
Undo
fn cp, fn mv, fn rm, fn ren, fn mkdir, fn tag, fn untag and fn desc --set do not touch the files themselves. They start an operation of the app, the same one a key would: its progress shows in the strip under the panes and as one line in the terminal, a name that is already taken is asked about in the app (or answered in advance with --overwrite, --skip, --keep-both, --older), and it is in the operation history for 30 days.
So fn rm deletes to the Recycle Bin, a file that is replaced is kept aside, and fn undo or Ctrl+Z takes the whole thing back. That is the reason to write fn rm in a script where you would have written rm. The one exception says so in its name: fn rm --for-good.
Paths and shells
Paths come and go in the shell’s own form: C:\Users\me in PowerShell and cmd, /mnt/c/Users/me and /home/me in WSL, /c/Users/me in Git Bash. --win prints Windows’ form everywhere. Lists are one item a line, -0 ends each with a NUL character instead, and --json gives one object a line.
PowerShell pipes objects, not text. Get-ChildItem *.pdf | fn mount pdfs mounts the files, Select-String’s matches arrive as places in files, and Get-Service | fn mount services shows each service’s display properties. fn cd changes the location.
bash, in WSL and Git Bash: fn is a function there, so fn cd works and WSL finds the Windows program.
cmd has no functions: fn cd asks the app, which types the cd at the terminal’s next prompt.
None of this touches your own shell settings: the terminal sets it up for the shells it starts.
What the panes show
Reading: nothing here changes a file. Places need not be folders on a disk: an archive, a server, a phone, a tag or a search lists the same way.
fn pwd [PANE] [options]
The folder a pane shows
--pane PANE
Which pane: here (this terminal's tab, the default), active, other, left, right
--any
Also a place that is no folder on a disk (a server, an archive, a search): its address
--win
Paths as Windows writes them, also in WSL and Git Bash
fn pwd
fn pwd other
cp report.pdf "$(fn pwd other)"
fn sel [options]
A pane's items: the marked ones, else the one under the cursor
--marked
Only the marked items
--cursor
Only the item under the cursor
--shown
Every item the pane shows (its filter applied)
--all
Every item of the folder, hidden ones too
--any
Also items that are not on a disk (on a server, in an archive): their addresses
-0, --null
Each item ends with a NUL character instead of a line break
--json
One JSON object per line
--win
Paths as Windows writes them, also in WSL and Git Bash
--pane PANE
Which pane: here (this terminal's tab, the default), active, other, left, right
fn sel
fn sel --pane other
fn sel -0 | xargs -0 du -h
fn sel | ForEach-Object { magick $_ ($_ -replace '\.\w+$', '.webp') }
fn ls [PLACE] [options]
What a place holds, any place the app lists: a folder, an archive (a.zip|in), a server, a phone, tag://, coll://, Recent; none: the pane's folder
--all
Hidden and system items too
--dirs
Only folders
--files
Only files
-0, --null
Each item ends with a NUL character instead of a line break
--json
One JSON object per line
--win
Paths as Windows writes them, also in WSL and Git Bash
--pane PANE
Which pane: here (this terminal's tab, the default), active, other, left, right
fn ls
fn ls 'D:\photos.zip|2024'
fn ls sftp://me@nas/var/www --json
fn ls tag://WORK
fn find QUERY… [options]
The app's search (Everything's syntax; Everything where it indexes, its own walk elsewhere): here and below
--in FOLDER
Search there (else here: the shell's folder and below)
--everywhere
Search everywhere, not only here
--max N
At most N results
-0, --null
Each item ends with a NUL character instead of a line break
--json
One JSON object per line
--win
Paths as Windows writes them, also in WSL and Git Bash
Do not wait for the operation: its number is printed
fn undo
fn redo [options]
Does the operation undone last again
--no-wait
Do not wait for the operation: its number is printed
fn redo
fn jobs [options]
The file operations running now and the newest ones done
--json
One JSON object per line
fn jobs
fn wait [IDS…]
Waits for operations (their numbers; none: all that run)
fn wait
fn wait 42
A command’s output as a folder
Whatever a command prints becomes rows in a pane; rows that name files are those files, to preview, open, copy and drag.
fn mount ID [options]
A command's output as a folder, lua://ID/: files it names are those files, other fields show beside them
--json
The input is JSON: one object per line, or an array
--tsv
The input is tab-separated, its first line the field names
--csv
The input is comma-separated, its first line the field names
--lines
Each line is a row (else the kind of input is recognised)
-0, --null
Records end with a NUL character (names may hold line breaks)
--fields A,B
The field names, when the first line is no header
--name-field FIELD
Which field names a row (else name, else the item's name, else the first)
--add
Add to the folder's rows instead of replacing them
--open
Show the folder in the pane
--paths
Rows naming files and folders are those items (the default: recognised)
--no-paths
Rows are only text, even when they name a file
--pane PANE
Which pane: here (this terminal's tab, the default), active, other, left, right
rg -l TODO | fn mount todos --open
cargo build 2>&1 | fn mount errors --open
git status --porcelain | fn mount changed --open
Get-ChildItem -Recurse -Filter *.pdf | fn mount pdfs --open
docker ps --format '{{.Names}}\t{{.Image}}\t{{.Status}}' | fn mount docker --tsv --fields name,image,status
fn unmount ID
Empties the script folder lua://ID/
fn unmount todos
fn mounts [options]
The script folders and how many rows each holds
--json
One JSON object per line
fn mounts
fn itself
fn ping
Whether the app answers, and which pane and tab this terminal belongs to
fn ping
fn help [COMMAND]
What fn does, or one command in full
fn help
fn help mount
fn version
fn's version
fn version
Exit codes
0
done
1
error
2
usage
3
the app is not running
4
timed out
5
not authorised
6
cancelled
7
nothing
“Nothing” (7) is what grep answers when it finds nothing: no rows, no folder. fn pwd && … goes on only where the pane shows a real folder.
Editions
fn is in the free Core edition, where the terminal runs cmd. Three things around it are part of Pro: the other shells in the terminal (PowerShell, Git Bash, WSL), fn mount (script folders), and fn ai (the AI features).
The terminal’s own assistant writes fn commands where they fit, and checks each against fn’s grammar before it shows it. An AI assistant started in the terminal has fn too; one started elsewhere reaches the app through its MCP server.