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
| Command | What it does | Changes 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 |
recover | Resolves journal entries that an interrupted run left behind. | Yes |
scan | Counts 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 |
status | Totals 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
| Option | Meaning |
|---|---|
--dry-run | Report only (compress, decompress, maintain). |
--apply | Let watch really compress. |
--include DIR | Add a scope folder. Repeat it for more. It replaces the defaults. |
--cooldown-hours H | Quiet period before a file is queued. The default comes from the settings. |
--duration SEC | Stop watch after this many seconds. |
--limit N | For estimate: the number of candidates to sample. |
--refresh, --top N | For waste and dups. |
--journal DIR --state FILE | Override 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