Configuration¶
findfmt supports flexible, structured configuration loading through standard TOML files. This
enables setting persistent personal defaults or project-level standards for output formatting,
visual styling, traversal boundaries, and tag filtering.
1. Configuration Resolution Hierarchy¶
When findfmt executes, it determines effective settings according to a strict six-tier hierarchy
where higher-priority sources override lower-priority sources:
Explicit CLI arguments and flags (Highest Priority): Direct options passed on the command line (e.g.
--format table,--no-hidden,-t python) always override environment variables and file settings.Environment Variables: System environment settings such as
NO_COLOR,CLICOLOR,CLICOLOR_FORCE,LANGUAGE, andLC_*override file defaults.Explicit Configuration File: A custom configuration path specified via
--config <path>or theFINDFMT_CONFIGenvironment variable.Standard User Configuration Path: User-level configuration located at
$XDG_CONFIG_HOME/findfmt/config.toml(or~/.config/findfmt/config.tomlon POSIX systems;%APPDATA%\findfmt\config.tomlon Windows).Project Local Configuration: A
pyproject.tomlfile containing a[tool.findfmt]table located in the current working directory.Built-in Defaults (Lowest Priority): Factory default options (
format = "text",color = "auto",pager = "auto", etc.).
Note
Passing --no-config on the command line or setting FINDFMT_CONFIG="" completely
suppresses discovery and loading of configuration files, forcing findfmt to rely strictly on
built-in defaults and command-line flags.
2. Configuration Inspection¶
To inspect the currently active configuration file and resolved settings:
findfmt --show-config
When custom options are loaded, findfmt outputs the active path and effective configuration table:
Active configuration: /home/user/.config/findfmt/config.toml
[tool.findfmt]
color = "always"
format = "table"
hidden = true
table_style = "rounded"
To view configuration status as part of general system diagnostics:
findfmt --diagnostics
3. Configuration File Formats¶
findfmt natively parses configuration using standard TOML. Configuration can be defined either in
a standalone config.toml file or embedded inside a repository’s pyproject.toml.
3.1. Standalone config.toml¶
A standalone file can place options at top level or under a [tool.findfmt] table:
# ~/.config/findfmt/config.toml
# Default output serialization format (text, table, tree, json, etc.)
format = "table"
# Border style for table and tree formatters (rounded, grid, ascii, etc.)
table_style = "rounded"
# ANSI color policy: "auto", "always", or "never"
color = "auto"
# Terminal pager policy: "auto", "always", or "never"
pager = "auto"
# Include hidden files (dotfiles) by default
hidden = false
# Honor .gitignore and global gitignore files (true) or ignore them (false)
ignore = true
# Default tags to include
tags = ["python", "shell"]
# Maximum directory descent depth
max_depth = 5
# Group directories first
dirs_first = true
3.2. Project Configuration (pyproject.toml)¶
In repositories managed by modern Python tooling (uv, hatch, flit, poetry), findfmt reads
the [tool.findfmt] table:
# pyproject.toml
[tool.findfmt]
format = "tree"
table_style = "rounded"
tags = ["python"]
exclude_tags = ["text"]
ignore = true
hidden = false
dirs_first = true
4. Configuration Schema Reference¶
Setting |
Type |
CLI Equivalent |
Description |
Default |
|---|---|---|---|---|
|
string |
|
Output serialization format ( |
|
|
bool |
|
Prefix formula triggers in CSV/TSV cells with single quote to prevent spreadsheet formula injection. |
|
|
string |
|
Table border style ( |
|
|
string / bool |
|
Color policy: |
|
|
string / bool |
|
Terminal paging policy: |
|
|
bool |
|
Include dotfiles and hidden directories in traversal. |
|
|
bool |
|
Respect |
|
|
list[str] / str |
|
Default tag inclusions. |
|
|
list[str] / str |
|
Default tag exclusions. |
|
|
bool |
|
Require all specified tags to match rather than any tag. |
|
|
string |
|
Sort key criterion ( |
|
|
bool |
|
Reverse sort ordering. |
|
|
bool |
|
Group directories before files. |
|
|
bool |
|
Group files before directories. |
|
|
bool |
|
Follow directory symlinks during traversal. |
|
|
bool |
|
Emit directories only and suppress files. |
|
|
int |
|
Maximum directory descent depth limit. |
|
|
int |
|
Directory entry count threshold. |
|
|
bool |
|
Omit directories containing zero matching items. |
|
|
list[str] / str |
|
Wildcard filename include patterns. |
|
|
list[str] / str |
|
Wildcard filename exclude patterns. |
|
|
bool |
|
Case-insensitive pattern matching. |
|
|
bool |
|
Inherit pattern matches to subdirectories. |
|
|
string |
|
Interpreter shebang pattern filter. |
|
|
bool |
|
Output absolute paths instead of relative paths. |
|
|
bool |
|
Prepend search prefix to relative paths. |
|
|
bool |
|
Delimit paths with NUL ( |
|
|
bool |
|
Display detected format and content tags. |
|
|
bool |
|
Print match count statistics to stderr. |
|
|
bool |
|
Exit with code 1 if no matching files are found. |
|
|
bool |
|
Format file permissions in |
|
|
bool |
|
Display file owner username or UID. |
|
|
bool |
|
Display file group name or GID. |
|
|
bool |
|
Print file size in bytes. |
|
|
bool |
|
Format file sizes using binary units (KiB, MiB). |
|
|
bool |
|
Format file sizes using SI metric units (kB, MB). |
|
|
bool |
|
Accumulate recursive directory disk usage. |
|
|
bool |
|
Display file last modification date and time. |
|
|
bool |
|
Display last file status change date and time. |
|
|
string |
|
Custom strftime syntax format string. |
|
|
bool |
|
Append file type indicators ( |
|
|
bool |
|
Enclose filenames in double quotes. |
|
|
bool |
|
Render paths as OSC 8 terminal hyperlinks. |
|
|
string |
|
Default display and translation locale. |
|
5. Troubleshooting & Diagnostics¶
Syntax Errors: If a configuration file contains invalid TOML syntax,
findfmtdisplays an informative syntax error and exits with code2:Error: Invalid TOML in configuration file '/home/user/.config/findfmt/config.toml': Expected '=' after a key in a key/value pair (at line 4, column 1)
Unknown Keys: If an unsupported or misspelled key is provided,
findfmtrejects the configuration:Error: Unknown configuration key 'frmat' in '/home/user/.config/findfmt/config.toml'.
Type Mismatches: Supplying an unexpected type (e.g., a string where a boolean is required) triggers a clear validation error:
Error: Invalid value for 'hidden' in '/home/user/.config/findfmt/config.toml': expected boolean (true/false), got str
Bypassing Configuration: In scripts or CI environments where deterministic, clean-room behavior is required regardless of existing user configurations, supply
--no-config:findfmt --no-config -t python