https://github.com/nicholas-fedor/go-remove
A command-line tool to remove Go binaries with ease.
https://github.com/nicholas-fedor/go-remove
cli cli-app cli-tool go golang tui utility
Last synced: 4 months ago
JSON representation
A command-line tool to remove Go binaries with ease.
- Host: GitHub
- URL: https://github.com/nicholas-fedor/go-remove
- Owner: nicholas-fedor
- License: agpl-3.0
- Created: 2025-04-09T10:38:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-28T14:42:39.000Z (5 months ago)
- Last Synced: 2026-02-28T14:44:37.634Z (5 months ago)
- Topics: cli, cli-app, cli-tool, go, golang, tui, utility
- Language: Go
- Homepage:
- Size: 1.28 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# go-remove

A CLI tool to safely remove Go binaries with undo and history support
[](https://github.com/nicholas-fedor/go-remove/releases)
[](https://dl.circleci.com/status-badge/redirect/gh/nicholas-fedor/go-remove/tree/main)
[](https://codecov.io/gh/nicholas-fedor/go-remove)
[](https://godoc.org/github.com/nicholas-fedor/go-remove)
[](https://goreportcard.com/report/github.com/nicholas-fedor/go-remove)

[](https://www.gnu.org/licenses/agpl-3.0)
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [From Source](#from-source)
- [From Releases](#from-releases)
- [Linux](#linux)
- [Windows](#windows)
- [Archive Naming](#archive-naming)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Direct Removal](#direct-removal)
- [Interactive TUI](#interactive-tui)
- [Undo Deletion](#undo-deletion)
- [Restore from History](#restore-from-history)
- [Command Reference](#command-reference)
- [Filesystem Locations](#filesystem-locations)
- [Data Storage](#data-storage)
- [Trash Locations](#trash-locations)
- [Binary Directories (in precedence order)](#binary-directories-in-precedence-order)
- [Building from Source](#building-from-source)
- [Requirements](#requirements)
- [Contributing](#contributing)
- [License](#license)
## 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
```bash
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](https://github.com/nicholas-fedor/go-remove/releases).
#### Linux
Available architectures: `amd64`, `i386`, `armhf`, `arm64v8`
```bash
# 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`
```powershell
# 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
```bash
# 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:
```bash
go-remove vhs
```
With verbose output:
```bash
go-remove -v vhs
```
Remove from `GOROOT/bin` instead of `GOBIN`/`GOPATH/bin`:
```bash
go-remove --goroot vhs
```
### Interactive TUI
Launch without arguments to use the interactive TUI:
```bash
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:
```bash
go-remove --undo
# or
go-remove -u
```
### Restore from History
Browse and restore from deletion history:
```bash
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
```bash
git clone https://github.com/nicholas-fedor/go-remove.git
cd go-remove
go build -o go-remove .
```
Run locally:
```bash
./go-remove --help
```
## Requirements
- Go 1.26.0 or later
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](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](https://github.com/nicholas-fedor/go-remove).
## License
This project is licensed under the [GNU Affero General Public License v3](LICENSE.md).
---
**Logo Credits:** Special thanks to [Maria Letta](https://github.com/MariaLetta) for the awesome [Free Gophers Pack](https://github.com/MariaLetta/free-gophers-pack).