Skip to content

About

现代化的跨平台硬盘占用分析工具,实时树图 · A modern cross-platform disk usage analyzer with a live treemap

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

64 stars

Watchers

0 watching

Forks

Repository files navigation

SpaceKnife icon

SpaceKnife

A modern, cross-platform disk usage analyzer: a live treemap that shows what fills your drives.

English · 简体中文 · Website · Download · Coming next

Latest release Downloads GitHub stars CI Last commit MIT license

Windows, Linux and macOS Interface in English and Simplified Chinese Documentation No telemetry Good first issues

Rust Tauri 2 Vue 3 and Nuxt 4

SpaceKnife in action: hovering over a 2 TB drive, zooming into a folder, switching to the flame graph and the polar flame graph, filtering for large videos, searching with the command palette and comparing two snapshots (mock data)

SpaceKnife draws every folder and file as a block of a nested treemap, sized by the space it takes, so the space hogs stand out at a glance. It scans in parallel (or reads the NTFS Master File Table for a quick scan), can cap the disk load it causes, keeps watching for changes after the scan, and saves a snapshot after each scan so you can see what grew and what is new. Deleting goes to the recycle bin and can be undone. The interface is available in English and Simplified Chinese.

SpaceKnife is an independent project inspired by SpaceSniffer. It is not affiliated with SpaceSniffer or its author.

Screenshots

The screenshots show mock data: a made-up 2 TB data drive generated by cargo run -p sk-store --example mock_snapshot, not a real disk.

Treemap: block area is disk usage; hovering shows the details

Treemap: the area of a block is its disk usage, nested folder by folder. Hovering shows size, type and dates; the side panel shows the selection and its largest items.

Filter: only videos over 1 GB stay lit

Filter: :class:Video;>1gb keeps only videos larger than 1 GB lit and dims the rest; the matches are listed on the right, sortable and one click away in the treemap.

Snapshot comparison: five weeks apart, orange grew and blue shrank

Snapshot comparison: against a snapshot from five weeks earlier, orange grew and blue shrank, new and deleted items are marked; the side panel shows the net growth, the biggest changes and when free space runs out at the current rate.

Command palette: search the whole scan by name

Command palette (Ctrl+K): search the whole scan by name and run any command.

Features

  • Live treemap: WebGL rendering that fills in while the scan runs; zoom animation, hover details, detail levels, grouping of small items, free and unknown space drawn as blocks; split view for two views side by side.
  • Three visualizations: treemap, flame graph and polar flame graph. Switch at any time, even while the scan runs; each view keeps its own.
  • Fast: parallel directory walking in Rust; on Windows a quick scan reads the NTFS Master File Table (through a read-only helper that asks for administrator rights).
  • Polite to your disk: the scan can cap the disk load it causes (max / balanced / quiet / idle / custom) and backs off when other programs need the disk.
  • Live monitoring: after the scan, changes keep flowing in (Windows ReadDirectoryChangesW with USN journal catch-up; Linux inotify, falling back to polling when watches run out; macOS FSEvents); changed blocks flash.
  • Filter language: by name, type, size, dates, attributes and tags, combinable; compatible with SpaceSniffer-style filters, with extensions (syntax, in Chinese).
  • Snapshots and comparison: a snapshot is saved after each scan; compare any two, or a snapshot with now, showing only growth or only shrinkage.
  • Safe cleanup: context menu and a delete basket; items go to the recycle bin by default and can be restored; system and program folders are protected.
  • Export and command line: CSV / JSON / HTML and other templates; spaceknife-cli scan / run / snapshot in a terminal, and spaceknife-cli headless to use SpaceKnife from a browser.
  • Two languages: English and Simplified Chinese, following the system language, switchable at any time.

Download

Installers are on the Releases page (currently a pre-release):

System File
Windows 10+ x64 SpaceKnife-<version>-Setup-x64.exe (for the current user or all users; installs the WebView2 Runtime if it is missing; not code-signed yet, so SmartScreen warns about an unknown publisher on first run: "More info › Run anyway")
Ubuntu 22.04+ / Debian 12+ spaceknife_<version>_amd64.deb (needs WebKitGTK 4.1; apt installs it)
RHEL 9+ / Fedora family spaceknife-<version>.x86_64.rpm
Other Linux x64 SpaceKnife-<version>-x86_64.AppImage (needs FUSE 2, or run it with --appimage-extract-and-run)
Windows 10+ x64, portable SpaceKnife-<version>-win-x64-portable.zip (no installation: unzip anywhere and run SpaceKnife.exe; snapshots and settings stay in the data folder next to it; needs the WebView2 Runtime, which Windows 11 has; the first launch takes a few seconds longer while Windows checks the new files)
Linux x64 / arm64, portable, small SpaceKnife-<version>-linux-<x64 or arm64>-tauri.tar.gz (extract anywhere and run ./spaceknife, no FUSE needed; data stays in the data folder next to it; uses the system's WebKitGTK 4.1, so not for RHEL 9)
Linux x64 / arm64, portable, any distribution SpaceKnife-<version>-linux-<x64 or arm64>-portable.tar.gz (the same, with its own engine (Electron), so it runs on RHEL 9 too; the name of 0.3.4's Linux portable)
Windows 11 on ARM, portable SpaceKnife-<version>-win-arm64-portable.zip (the Windows portable, built for arm64; the installers are x64 only)
macOS 14+, Apple Silicon SpaceKnife-<version>-mac-arm64.dmg (preview: not notarized yet, see below)
macOS 14+, Intel SpaceKnife-<version>-mac-x64.dmg (preview: not notarized yet, see below)
macOS 14+, portable SpaceKnife-<version>-mac-<arm64 or x64>-portable.zip (unzip anywhere and open SpaceKnife.app; data stays in the data folder next to it; allow it once as below)

Every release includes SHA256SUMS.txt and the SHA256SUMS-portable-…, SHA256SUMS-tauri-linux-… and SHA256SUMS-mac-… lists. Each package also carries the command-line program spaceknife-cli next to the app. The window is the same everywhere: most downloads draw it with the system's web view (WebView2, WebKit, WebKitGTK) and are small; the rpm, the AppImage and the portable …-linux-<arch>-portable.tar.gz bring their own (Electron), because RHEL 9 has no WebKitGTK 4.1.

Updating from 0.3.4: the release files keep 0.3.4's names, so 0.3.4's update check finds the newest version and installs it like any update: Seamless update for the Windows installer (it installs the new version where 0.3.4 was, with the same shortcuts and one entry in the app list), the portable copies and the AppImage; the disk image or the package for the dmg, deb and rpm. Settings, file classes, tags and snapshots stay, and the snapshots 0.3.x saved still open. What changes for each kind of install: Upgrading from 0.3.4.

From 0.3.1 on, SpaceKnife checks this repository's releases at most once a day (it sends nothing about you or your files). A small update shows a badge at the top right; a bigger one also shows a summary. The new version is downloaded in the background and checked against the release's checksums. From 0.3.3 on, the update card offers two ways to install it: Seamless update (Windows installer, portable copies, AppImage) puts it in place and opens SpaceKnife again, the classic way opens the installer, the disk image or the package (or shows the file, to replace it yourself); Skip 0.4.x silences a whole series. SpaceKnife never installs an update by itself: nothing starts until you click. Turn the check off in Settings › About & updates.

macOS: the first launch

The macOS build is not notarized by Apple yet, so macOS blocks it the first time. Allow it once:

  1. Open the dmg and drag SpaceKnife into Applications.
  2. Open SpaceKnife. macOS says it could not verify that SpaceKnife is free of malware: click Done.
  3. Open System Settings › Privacy & Security, scroll down to the message that SpaceKnife was blocked, click Open Anyway, then Open Anyway again and enter your password.

From then on SpaceKnife opens normally; after installing a new version, allow it once more. On macOS 14 you can also right-click SpaceKnife in Applications and choose Open. If you prefer the terminal: xattr -dr com.apple.quarantine /Applications/SpaceKnife.app.

To scan everything without a permission prompt for each folder, give SpaceKnife Full Disk Access (System Settings › Privacy & Security › Full Disk Access › +), then restart it. Without it, protected places such as Mail and Messages count as unknown space. After an update, switch SpaceKnife off and on again in that list.

Like it? Give it a star

If SpaceKnife helped you win back some disk space, please give it a ⭐ star at the top of this page. It takes one click, and it is how other people find the project: stars are a big part of how GitHub ranks and recommends repositories. It also tells us the work is worth continuing.

Other ways to help: report a bug or suggest a feature in Issues, ask and share in Discussions, pick a good first issue (see CONTRIBUTING.md), or tell a friend whose drive is full.

Documentation

The design documents are in Chinese:

Development

Requires rustup (the first time cargo runs in the repository it installs the Rust version rust-toolchain.toml pins, edition 2024; CI uses the same one), Node.js 24 and pnpm 10. On Linux, Tauri also needs the system WebView and a few libraries:

sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev patchelf

Build and test the Rust workspace (cargo build builds the crates in crates/; --workspace also takes in the Tauri app in apps/desktop/src-tauri):

cargo build
cargo test --workspace

Run the app window (the backend runs inside the app process):

cd apps/desktop && pnpm install && pnpm tauri dev

The same interface also runs in the Electron shell (apps/electron-shell: the rpm, the AppImage and the Linux portable that brings its own engine use it, as RHEL 9 has no WebKitGTK 4.1). It starts spaceknife-cli serve as its backend and loads the built interface:

cargo build -p sk-server --bin spaceknife-cli && pnpm -C apps/desktop generate && pnpm -C apps/electron-shell install && pnpm -C apps/electron-shell dev

Build the Tauri bundles (pnpm bundle: NSIS on Windows, AppImage / deb / rpm on Linux, app / dmg on macOS) and the portable archives (pnpm bundle:portable, after pnpm bundle), in apps/desktop; the Electron shell's packages are pnpm -C apps/electron-shell package (which of them a release publishes: docs/packaging.md):

pnpm bundle && pnpm bundle:portable

The command-line program is spaceknife-cli. serve prints one ready JSON line on stdout (the WebSocket address and a development token) and logs to stderr:

cargo run -p sk-server --bin spaceknife-cli -- serve

Scan from a terminal (parallel full scan, snapshot saved when done):

cargo run --release -p sk-server --bin spaceknife-cli -- scan "C:\Program Files"

Add --profile to see where the time went: how busy the listing threads were (system calls) and how long the main thread spent folding results into the tree. SPACEKNIFE_SCAN_THREADS sets the number of listing threads, here and in the app, for comparisons.

cargo run -p sk-server --bin spaceknife-cli -- snapshot list

spaceknife-cli headless [--listen <address>] serves the interface to a browser instead of opening a window.

The SPACEKNIFE_HOME environment variable puts snapshots and settings in a folder of your choice (tests and demos use it to stay away from real data).

The README screenshots are rendered off-screen from mock data: no window, no real disk (use a neutral empty folder for --home):

node tools/demo/screenshots.mjs --home <empty folder> --out docs/images --lang both

The demo animation (docs/images/demo*.gif / .mp4) is recorded the same way; it needs ffmpeg:

node tools/demo/screenshots.mjs --home <empty folder> --out docs/images --lang both --video

The website lives in site/ (Astro; GitHub Actions publishes it to GitHub Pages on every push to main):

pnpm -C site install
pnpm -C site dev

Checks before a commit (same as CI):

cargo fmt --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace
node tools/gen_design.mjs --check && node --test "tools/tests/*.test.mjs"
cd apps/desktop && pnpm typecheck && pnpm test
cd apps/electron-shell && pnpm typecheck && pnpm test

cargo test --workspace also replays the parity gate (tests/parity): the Rust backend's answers over the protocol, compared with what 0.3.4's Python backend answered to the same scenarios. More in CONTRIBUTING.md.

License

MIT. The installers carry the third-party licenses in a licenses folder with the app (resources/licenses in the Electron builds; see docs/packaging.md).

Repository layout

Path Contents
crates/sk-protocol Protocol v1: message types, binary frame codec, JSON Schema and the generated TypeScript (cargo run -p sk-protocol --bin gen-ts)
crates/sk-native Native scanning: parallel directory walking, MFT parsing
crates/sk-store Columnar file tree store and snapshots
crates/sk-core Scanning, filter engine, layouts, views, monitoring, export, file operations, settings, updates
crates/sk-server WebSocket server and the command line spaceknife-cli (scan, run, snapshot, serve, headless)
design/tokens, design/icons Design tokens and icon sources; design/build is generated
apps/desktop The desktop app: Tauri 2 (src-tauri) with a Nuxt 4 / Vue 3 interface (app); bundles and portable archives
apps/electron-shell The Electron shell for where Tauri can't run (main process and preload; the interface is apps/desktop's)
packaging Tests of the built packages (smoke, headless, updates, also from 0.3.4) and the Windows console launcher SpaceKnife.com
tests/parity The parity gate: the same protocol scenarios against 0.3.4's backend and the Rust one
site The website (Astro, GitHub Pages)
tools Code generation and developer tools (design tokens: gen_design.mjs; releases: release.mjs; screenshots: demo/screenshots.mjs)

About

现代化的跨平台硬盘占用分析工具,实时树图 · A modern cross-platform disk usage analyzer with a live treemap

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

64 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages