Skip to content

nicholas-fedor/go-remove

go-remove

go-remove Logo

A CLI tool to safely remove Go binaries with undo and history support

Latest Version CircleCI Codecov GoDoc Go Report Card GitHub go.mod Go version License

Table of Contents

Features

  • Interactive TUI: Browse and select binaries to remove from a grid interface
  • Undo Support: Restore the most recently deleted binary with a single command
  • Deletion History: Browse and restore any previously removed binary
  • Safe Removal: Moves binaries to system trash instead of permanent deletion
  • Cross-Platform: Works on Linux (XDG-compliant) and Windows
  • Verbose Logging: Optional detailed output for debugging

Installation

From Source

go install github.com/nicholas-fedor/go-remove@latest

The binary will be installed to $GOPATH/bin (typically ~/go/bin/go-remove).

From Releases

Download the latest release for your platform from the releases page.

Linux

Available architectures: amd64, i386, armhf, arm64v8

# Download and extract (replace amd64 with your architecture)
curl -LO https://github.com/nicholas-fedor/go-remove/releases/latest/download/go-remove_linux_amd64_latest.tar.gz
tar -xzf go-remove_linux_amd64_latest.tar.gz
chmod +x go-remove
sudo mv go-remove /usr/local/bin/

# Verify checksum (optional)
curl -LO https://github.com/nicholas-fedor/go-remove/releases/latest/download/checksums.txt
sha256sum -c checksums.txt --ignore-missing

Windows

Available architectures: amd64, i386, arm64v8

# Download and extract (replace amd64 with your architecture)
Invoke-WebRequest -Uri "https://github.com/nicholas-fedor/go-remove/releases/latest/download/go-remove_windows_amd64_latest.zip" -OutFile "go-remove.zip"
Expand-Archive -Path "go-remove.zip" -DestinationPath "."

# Move to a directory in your PATH (requires Administrator privileges)
Move-Item -Path ".\go-remove.exe" -Destination "$env:LOCALAPPDATA\Microsoft\WindowsApps\"

Archive Naming

Release archives follow the pattern: go-remove_{OS}_{ARCH}_{VERSION}.{ext}

OS Architecture Archive Name Example
Linux amd64 go-remove_linux_amd64_v1.0.0.tar.gz
Linux arm64 go-remove_linux_arm64v8_v1.0.0.tar.gz
Windows amd64 go-remove_windows_amd64_v1.0.0.zip

Quick Start

# Launch interactive TUI to select binaries
go-remove

# Remove a specific binary
go-remove vhs

# Undo the last deletion
go-remove --undo

Usage

Direct Removal

Remove a specific binary by name:

go-remove vhs

With verbose output:

go-remove -v vhs

Remove from GOROOT/bin instead of GOBIN/GOPATH/bin:

go-remove --goroot vhs

Interactive TUI

Launch without arguments to use the interactive TUI:

go-remove

TUI Controls:

Key Action
/// or k/j/h/l Navigate grid
Enter Remove selected binary
s Toggle sort order (ascending/descending)
r Open deletion history
q or Ctrl+C Quit

Undo Deletion

Restore the most recently deleted binary:

go-remove --undo
# or
go-remove -u

Restore from History

Browse and restore from deletion history:

go-remove --restore
# or
go-remove -r

History View Controls:

Key Action
/ Navigate history
Enter Restore selected binary to original location
d Permanently delete from trash
u Undo most recent deletion
q Return to main view

Command Reference

Flag Short Description
--undo -u Restore the most recently deleted binary
--restore -r Open the deletion history view
--goroot Target GOROOT/bin instead of GOBIN/GOPATH/bin
--log-level Set log level (debug, info, warn, error)
--help -h Show help message

Filesystem Locations

Data Storage

Deletion history is stored in a Badger KV database:

Linux:

  • $XDG_DATA_HOME/go-remove/history.badger
  • Fallback: ~/.local/share/go-remove/history.badger

Windows:

  • %LOCALAPPDATA%\go-remove\history.badger
  • Fallback: %USERPROFILE%\go-remove\history.badger

Trash Locations

Linux: XDG-compliant trash at $XDG_DATA_HOME/Trash (fallback: ~/.local/share/Trash)

  • files/ - Trashed binaries
  • info/ - Metadata files (.trashinfo)

Windows: Windows Recycle Bin via Shell API

Binary Directories (in precedence order)

  1. GOROOT/bin (when using --goroot flag)
  2. GOBIN (environment variable)
  3. GOPATH/bin (from GOPATH environment variable)
  4. Default fallback: ~/go/bin (Linux/macOS) or %USERPROFILE%\go\bin (Windows)

Building from Source

git clone https://github.com/nicholas-fedor/go-remove.git
cd go-remove
go build -o go-remove .

Run locally:

./go-remove --help

Requirements

  • Go 1.26.0 or later

Contributing

We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines on:

  • Setting up your development environment
  • Code standards and testing requirements
  • Submitting pull requests
  • Commit signing requirements
  • AI policy

You can also submit issues or pull requests on GitHub.

License

This project is licensed under the GNU Affero General Public License v3.


Logo Credits: Special thanks to Maria Letta for the awesome Free Gophers Pack.

About

A command-line tool to remove Go binaries with ease.

Topics

Resources

License

AGPL-3.0, Unknown licenses found

Licenses found

AGPL-3.0
LICENSE.md
Unknown
license-header.txt

Contributing

Stars

Watchers

Forks

Contributors