Documentation / Command line

Command line

The coldpack tool shares its engine with the app. It is inside the app, in Coldpack.app/Contents/Resources.

coldpack <command> [options] [path...]

Commands

CommandWhat it doesChanges files?
compress <file> [--dry-run]Compresses one file in place, with the same inode. With --dry-run it only reports.Yes
decompress <file> [--dry-run]Reverts a compressed file completely, dates included.Yes
recoverResolves journal entries that an interrupted run left behind.Yes
scanCounts the eligible files of the configured scope. Stores nothing.No
estimate [--limit N]Walks the scope from the app's saved position, samples candidates and estimates savings. Default limit 500. Writes neither files nor the app's state database.No
watch [--apply] [--duration SEC]Watches file events. Dry run unless you pass --apply.Only with --apply
statusTotals and the learned format classes.No
maintain [--dry-run] [--compact]Runs the daily housekeeping now. --dry-run prints what would go. --compact adds a full vacuum and prints the sizes.State only
config check [FILE]Validates a settings file (default: the real one). Exit code 1 when it is invalid.No
config show [FILE]Prints every effective key and where its value comes from: file or default.No
explain <path>Tells which built-in exclude, include folder or rule decides about a path, and why. Relative paths use the working directory.No
waste [--refresh] [--top N]Cleanup suggestions: waste per category and the largest items. Collects first when no result is stored, or with --refresh.State only
dups [--refresh] [--rescan] [--apply] [--top N]Duplicate files: groups of identical files with their source. Checks first when no result is stored, or with --refresh; --rescan walks the folders again to rebuild the file map; --apply replaces every listed copy with an APFS clone of its source (details).State only; files with --apply

Options

OptionMeaning
--dry-runReport only (compress, decompress, maintain).
--applyLet watch really compress.
--include DIRAdd a scope folder. Repeat it for more. It replaces the defaults.
--cooldown-hours HQuiet period before a file is queued. The default comes from the settings.
--duration SECStop watch after this many seconds.
--limit NFor estimate: the number of candidates to sample.
--refresh, --top NFor waste and dups.
--journal DIR --state FILEOverride the journal folder and the state database (for tests).

One process at a time

Only one process may change files for a journal folder. The app and every command that changes files take an exclusive lock for their whole life. If another process holds it, the second one stops at once with a message. Read-only commands (status, scan, estimate, explain, config) never take the lock and never run recovery. Commands that change files run recovery first.

Try it on a copy

To try Coldpack without any risk to your real data, give it its own support folder and a scratch tree:

export COLDPACK_SUPPORT_DIR="$(mktemp -d)"
coldpack watch --include ~/scratch --duration 120
coldpack watch --include ~/scratch --apply --duration 120

COLDPACK_SUPPORT_DIR moves the state database, the journal, the settings and the log. The scan scope is separate: use --include.

Examples

# How much could I save in my projects folder? (read-only)
coldpack estimate --limit 2000 --include ~/Projects

# Why is this file skipped?
coldpack explain ~/Projects/app/node_modules/x/index.js

# Is my settings file valid? What is in effect?
coldpack config check
coldpack config show

# Expand a file again
coldpack decompress ~/Documents/old-report.txt