explaingit

m4cs/targkill

Analysis updated 2026-05-18

1RustAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A Rust CLI tool with a live terminal UI that finds all Cargo target/ build folders on your system, shows their sizes as they are computed, and deletes the ones you select to reclaim disk space.

Mindmap

mindmap
  root((targkill))
    What it does
      Finds Cargo target dirs
      Shows sizes live
      Deletes selected folders
    How it scans
      Parallel jwalk traversal
      Cargo.toml sibling check
      Skips git directories
    TUI features
      Multi-select
      Sort by size name age
      Live reclaimable total
      Gigabyte highlighting
    Safety
      Confirmation before delete
      Background deletion
      Accurate target detection
    Install
      cargo install targkill
      Prebuilt binaries
      Cross-platform
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Find every Cargo target/ folder on your system and reclaim gigabytes of disk space with a few keystrokes.

USE CASE 2

Scan a specific development directory for target/ folders and see their sizes sorted from largest to smallest.

USE CASE 3

Use --list mode to pipe Cargo target folder paths to a shell script for automated cleanup.

USE CASE 4

Clean up build artifacts across many old Rust projects without manually navigating each project directory.

What is it built with?

RustCargoratatuijwalk

How does it compare?

m4cs/targkillabyo-software/ferro-stashariasbruno/glyph
Stars111
LanguageRustRustRust
Setup difficultyeasymoderateeasy
Complexity1/54/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

targkill is a command-line tool for Rust developers that finds every target/ build folder on your system and shows you how much space each one is using. When you build Rust projects, the compiler stores compiled artifacts in a folder called target/. These folders can grow to several gigabytes per project and are safe to delete at any time since Cargo regenerates them on the next build. targkill makes it easy to find them all and reclaim the space. You install it with cargo install targkill, which adds it as a Cargo subcommand. Running cargo targkill opens a terminal interface that scans your home directory (or a folder you specify) and lists every Cargo target folder it finds with its size. Sizes appear as they are calculated, so you do not have to wait for the full scan before seeing results. The list highlights any folder over one gigabyte so the largest ones are immediately visible. The tool is careful about what it includes: it only lists a target/ folder if a Cargo.toml file exists next to it. A folder named target/ for another reason is ignored. This keeps the results accurate and avoids touching unrelated directories. In the terminal interface, you navigate with arrow keys or vim-style j/k keys, toggle individual items with Space, select or deselect everything, sort by size, name, or age, and delete the selection. Deletions are permanent with no recycle bin, but a confirmation prompt appears before anything is removed. Deletions run in the background so the interface stays responsive even when removing large folders. A --list option prints results as plain text for use in scripts. The tool runs on Linux, macOS, and Windows.

Copy-paste prompts

Prompt 1
I have dozens of Rust projects on my Mac and want to free up disk space. Walk me through using targkill to scan my home directory and delete the largest target/ folders.
Prompt 2
I want to use targkill's --list flag to pipe the output to a shell script that deletes everything over 2GB. Show me the command pipeline.
Prompt 3
I'm contributing to targkill. Walk me through running cargo fmt and cargo clippy before opening a PR so CI passes.
Prompt 4
How do I use targkill's keybindings to select all target/ folders, then deselect the ones I want to keep, before confirming deletion?

Frequently asked questions

What is targkill?

A Rust CLI tool with a live terminal UI that finds all Cargo target/ build folders on your system, shows their sizes as they are computed, and deletes the ones you select to reclaim disk space.

What language is targkill written in?

Mainly Rust. The stack also includes Rust, Cargo, ratatui.

What license does targkill use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is targkill to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is targkill for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub m4cs on gitmyhub

Verify against the repo before relying on details.