CLI & ForkLift
Use Prism Compare in place of Kaleidoscope with this replacement for its ksdiff CLI. When you compare two files or folders in a compatible app such as ForkLift, Prism Compare opens and compares them instead.
Your usual compare action. Prism Compare.
No Kaleidoscope installation is needed. Use it with apps that pass two comparison paths to ksdiff.
Download CLIVerify the download (SHA-256)
b4f00b85161028acacde6af630ec27d9269e83fb428a35c6862c25e5067b3578
1. Install the App Store app
Install Prism Compare in Applications before installing the CLI. The launcher opens only the production app at the following path.
/Applications/PrismCompare.app
2. Copy and run in Terminal
Extract the download and put the PrismCompare-CLI folder in Downloads. Open Terminal, paste the entire command below and press Return.
(
cd "$HOME/Downloads/PrismCompare-CLI" &&
test -f ksdiff &&
test ! -d /usr/local/bin/ksdiff &&
test ! -d /usr/local/bin/ksdiff_org &&
sudo mkdir -p /usr/local/bin &&
if ! cmp -s ksdiff /usr/local/bin/ksdiff; then
if [ -e /usr/local/bin/ksdiff ] || [ -L /usr/local/bin/ksdiff ]; then
test ! -e /usr/local/bin/ksdiff_org &&
test ! -L /usr/local/bin/ksdiff_org &&
sudo mv /usr/local/bin/ksdiff /usr/local/bin/ksdiff_org
fi &&
sudo /usr/bin/install -S -m 755 ksdiff /usr/local/bin/ksdiff
fi &&
printf 'Done.\n'
)
If asked, enter your Mac login password and press Return. Nothing appears while you type the password. When you see “Done.”, setup is complete.
Keep the PrismCompare-CLI folder so you can undo setup later.
3. Compare from Terminal or ForkLift
In ForkLift, choose Kaleidoscope as the comparison app, then compare as usual. This CLI receives the two paths through ksdiff and passes them to Prism Compare, which displays the differences. Kaleidoscope does not need to be installed.
Other apps can use the same integration if they invoke ksdiff with two file or folder paths. If an app lets you specify a comparison command, set it to /usr/local/bin/ksdiff. See the supported options below for compatibility limits.
Use from Terminal
/usr/local/bin/ksdiff "/path/to/before.txt" "/path/to/after.txt"
/usr/local/bin/ksdiff "/path/to/folder-A" "/path/to/folder-B"
With no inputs, ksdiff opens the app. Options: --help, --version, --check and --.
What this launcher supports
- Launch the app and pass two local files or folders using the standard macOS open mechanism.
- Kaleidoscope merge, wait, label and snapshot options, and Git completion or conflict-resolution signaling, are not supported.
- Remote-file upload after saving is not implemented by this CLI. ForkLift’s File Merge setting uses a different launch route.
- The destination remains /Applications/PrismCompare.app. It never falls back to a development build. File access follows macOS permissions and the app’s sandbox.
Undo setup
Run the command below in Terminal. Enter your Mac login password if asked.
(
cd "$HOME/Downloads/PrismCompare-CLI" &&
test -f ksdiff &&
test ! -d /usr/local/bin/ksdiff_org &&
if { [ ! -e /usr/local/bin/ksdiff ] && [ ! -L /usr/local/bin/ksdiff ]; } ||
cmp -s ksdiff /usr/local/bin/ksdiff; then
sudo rm -f /usr/local/bin/ksdiff &&
if [ -e /usr/local/bin/ksdiff_org ] || [ -L /usr/local/bin/ksdiff_org ]; then
sudo mv /usr/local/bin/ksdiff_org /usr/local/bin/ksdiff
fi &&
printf 'Done.\n'
else
printf 'ksdiff was changed. Nothing was removed.\n' >&2
fi
)
Your previous comparison tool is restored. If there was none, the Prism Compare integration is removed. Prism Compare itself and your files are kept.
Inspect the included files
The download includes ksdiff and instructions in Japanese and English.
ksdiff
#!/bin/bash
# Optional, separately distributed launcher for the App Store app.
set -euo pipefail
PATH=/usr/bin:/bin:/usr/sbin:/sbin
readonly APP_PATH=/Applications/PrismCompare.app
readonly APP_ID=jp.co.extrainnovation.PrismCompare
readonly VERSION=1.0.0
usage() {
printf '%s\n' \
'Usage: ksdiff [--] [LEFT RIGHT]' \
' ksdiff --check | --help | --version' \
'Opens the App Store version of Prism Compare through macOS.' \
'No merge, wait, label, snapshot or remote-upload protocol.'
}
check_only=false
case "${1-}" in
--help|-h)
[[ "$#" == 1 ]] || { usage >&2; exit 2; }
usage
exit 0
;;
--version)
[[ "$#" == 1 ]] || { usage >&2; exit 2; }
printf 'Prism Compare CLI %s\n' "$VERSION"
exit 0
;;
--check)
[[ "$#" == 1 ]] || { usage >&2; exit 2; }
check_only=true
shift
;;
--) shift ;;
-*) usage >&2; exit 2 ;;
esac
if [[ "$#" != 0 && "$#" != 2 ]]; then
usage >&2
exit 2
fi
if [[ ! -x "$APP_PATH/Contents/MacOS/PrismCompare" ]]; then
printf 'Install Prism Compare from the App Store in %s first.\n' "$APP_PATH" >&2
exit 1
fi
bundle_id=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$APP_PATH/Contents/Info.plist")
if [[ "$bundle_id" != "$APP_ID" ]]; then
printf 'Unexpected application identifier at %s.\n' "$APP_PATH" >&2
exit 1
fi
requirement='=identifier "jp.co.extrainnovation.PrismCompare" and anchor apple generic and (certificate leaf[field.1.2.840.113635.100.6.1.9] exists or certificate leaf[subject.OU] = "94UZ76XWYL")'
if ! /usr/bin/codesign --verify --strict -R "$requirement" "$APP_PATH"; then
printf 'The Prism Compare application signature could not be verified.\n' >&2
exit 1
fi
if $check_only; then
printf 'Verified App Store application: %s\n' "$APP_PATH"
exit 0
fi
for input in "$@"; do
if [[ ! -e "$input" ]]; then
printf 'Comparison input not found: %s\n' "$input" >&2
exit 1
fi
done
exec /usr/bin/open -a "$APP_PATH" -- "$@"