Kaleidoscope Command Line Tool
The Kaleidoscope ksdiff command line tool serves two main purposes:
- It acts as the driving force behind many other integrations, in particular with source control systems like git.
- It can be used directly to compare and merge any number of files
Installation
To install or remove, follow these instructions:
Update Available
Install the latest version to ensure a properly working setup.
Manual Installation
The automatic installation above requires an admin account. If you are not administrator of your Mac, but still want to use ksdiff, follow these steps for manual configuration. Show more…
The idea if to add (a link to) ksdiff to your PATH, so you can just enter ksdiff instead of typing the full path. The steps assume you are using the default macOS zsh shell. Otherwise adjust commands as needed.
Open Terminal (or similar). Terminal is located in /Applications/Utilities
Locate ksdiff (inside of Kaleidoscope) using Terminal. On typical macOS installations, apps are located in /Applications. In that case, you could locate it by:
ls -l
The listing should show two entries, Kaleidoscope and ksdiff.
Open the .zshrc file with an editor, e.g. TextEdit.
Now we expand the PATH variably by including the path to Kaleidoscope. Scroll to the end of the file and insert a new line. Paste the following line, assuming Kaleidoscope is in the default location. Otherwise use the location you found in step 2 above.
Quit TextEdit, confirm saving the changes.
Quit your Terminal app and start it again. The following command should now show the help for ksdiff:
Usage Examples
Compare the text content two draft plain text documents with the final Word document:
Merge conflicting changes between Draft1.txt and Draft2.txt into Merge.txt:
Pipe content into ksdiff using -. This command will compare an original LoremIpsum.txt file with one where all u characters have been replaced with v.
Process Substitution can help comparing the output of multiple other calls. The following sample will compare the output of sorting file1 with the output of sorting file2, without the need to store the sorted files somewhere.
Repeatedly send content into the same Kaleidoscope window using the -l option (and piping). The following command will show processes that consume at least 1% of CPU. Use multiple times to compare over time.