DIFFT(1)
π NAME
okay so bestie, meet difft β a structural diff tool that understands syntax β from the General Commands Manual, aka DIFFT(1). sheβs not like other diff tools, fr fr π«Άβ¨
β¨ SYNOPSIS β¨
difft [OPTIONS] OLD-PATH NEW-PATH
difft [OPTIONS] DIRECTORY-ONE DIRECTORY-TWO
difft [OPTIONS] FILE-WITH-CONFLICTS
difft --list-languages
difft --help
π¦ DESCRIPTION
difftastic (difft) is a CLI diff tool that compares files based on their syntax, not line-by-line. Difftastic produces accurate diffs that are easier for humans to read. itβs giving βactually helpfulβ energy πβ¨
π OPTIONS π
--background BACKGROUNDβ set the background brightness. Difftastic will prefer brighter colours on dark backgrounds.--byte-limit LIMITβ use a line-oriented diff if either input file exceeds this size.--check-onlyβ report whether there are any changes, but donβt calculate them. much faster.--color WHENβ when to use color output.-c,--context LINESβ the number of contextual lines to show around changed lines.--display MODEβ display mode for showing results. the modes are:side-by-side: display the before file and the after file in two separate columns, with line numbers aligned according to unchanged content. if a change is exclusively additions or exclusively removals, use a single column.side-by-side-show-both: the same asside-by-side, but always uses two columns.inline: a single column display, closer to traditional diff display.json: output the results as a machine-readable JSON array with an element per file.
--exit-codeβ set the exit code to1if there are syntactic changes in any files. for files where there is no detected language (e.g. unsupported language or binary files), sets the exit code if there are any byte changes.--graph-limit LIMITβ use a line-oriented diff if the structural graph exceeds this number of nodes in memory.-h,--helpβ print help information.--ignore-commentsβ donβt consider comments when diffing.--list-languagesβ print all the languages supported by difftastic, along with their extensions.--override GLOB:NAMEβ associate this glob pattern with this language, overriding normal language detection. for example:
$ difft --override='*.c:C++' old.c new.c
see --list-languages for the list of language names. language names are matched case insensitively. overrides may also specify the language text to treat a file as plain text.
this argument may be given more than once. for example:
$ difft --override='CustomFile:json' --override='*.c:text' old.c new.c
to configure multiple overrides using environment variables, difftastic also accepts DFT_OVERRIDE_1 up to DFT_OVERRIDE_9.
$ export DFT_OVERRIDE='CustomFile:json'
$ export DFT_OVERRIDE_1='*.c:text'
$ export DFT_OVERRIDE_2='*.js:javascript jsx'
when multiple overrides are specified, the first matching override wins.
--parse-error-limit LIMITβ use a line-oriented diff if the number of parse errors exceeds this value.--skip-unchangedβ donβt display anything if a file is unchanged.--sort-pathsβ when diffing a directory, output the results sorted by path. this is slower.--strip-crβ remove any carriage return characters before diffing. this can be helpful when dealing with files on Windows that contain CRLF, i.e.\r\n.--syntax-highlight on/offβ enable or disable syntax highlighting.--tab-width NUMSPACESβ treat a tab as this many spaces.-V,--versionβ print version information.--width COLUMNSβ use this many columns when calculating line wrapping. if not specified, difftastic will detect the terminal width.
π DEBUG OPTIONS
--dump-syntax PATHβ parse a single file with tree-sitter and display the difftastic syntax tree.--dump-ts PATHβ parse a single file with tree-sitter and display the tree-sitter parse tree.
π MANUAL
a full HTML manual is available at https://difftastic.wilfred.me.uk/introduction β¨
π BUGS
see GitHub issues at https://github.com/Wilfred/difftastic/issues π
π AUTHOR
Wilfred Hughes me@wilfred.me.uk π«Ά
thatβs the whole page, bestie π
β source: General Commands Manual; page: DIFFT(1); date/version: not printed here, so Iβm not making one up ππ
π¦ where this page comes from
- arch rolling: difftastic 0.72.0-1 Β· MIT
- nixpkgs unstable: difftastic 0.72.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms