An open API service indexing awesome lists of open source software.

https://github.com/matsjfunke/wer

⁉️ wer ⁉️ is a cli tool to help you find who last edited a file or directory
https://github.com/matsjfunke/wer

cli-tool filehistory git rust

Last synced: 10 months ago
JSON representation

⁉️ wer ⁉️ is a cli tool to help you find who last edited a file or directory

Awesome Lists containing this project

README

          

[![Crates.io](https://img.shields.io/crates/v/wer.svg)](https://crates.io/crates/wer)
[![Tests](https://github.com/matsjfunke/wer/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/matsjfunke/wer/actions/workflows/test.yml)
[![Crates.io](https://img.shields.io/crates/d/wer.svg)](https://crates.io/crates/wer)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)

# ⁉️ wer ⁉️

`wer` (German "who") is a command-line tool for answering that everyday question:

> _Who touched this last?!_

No more complex `git log` commands, no more hunting for exact file paths. `wer` gives you context aware file / directory search.
`wer` offers both file-level recency and line-specific history through its `blame mode`, bridging the gap between `git blame` and `git-who` plus offering features like smart file finding and syntax highlighting.

![Normal Mode](./screenshots/normal-mode.png)

## 🚀 Quick Start

```bash
# install wer
cargo install wer

# Find who last edited any file
wer main.rs

# Show last 3 contributors to a directory
wer -l 3 src/
```

## 📚 Table of Contents

- [📦 Installation](#-installation)
- [🎮 Usage](#usage)
- [🏁 All Flags](#-all-flags)
- [✨ Smart Path Resolution](#-smart-path-resolution)
- [🎮 Basic Usage](#-basic-usage)
- [👥 Last Contributors](#-last-contributors)
- [🫵 Blame Mode](#-blame-mode)
- [🎨 Display Options](#-display-options)
- [👨‍💻 Contributing](#-contributing)
- [📑 License](#-license)

## 📦 Installation

**From crates.io (Recommended)**

```bash
#install cargo
curl https://sh.rustup.rs -sSf | sh
# install wer crate
cargo install wer
```

**From Source**

```bash
#install cargo
curl https://sh.rustup.rs -sSf | sh
# clone repository
git clone https://github.com/matsjfunke/wer
# install wer
cd wer
cargo install --path .
```

## Usage

### 🏁 All Flags

| Flag | Description |
| ---------------------- | ------------------------------------------------- |
| `-l, --last N` | Show last N contributors (normal mode only) |
| `-b, --blame` | Show git blame for files with syntax highlighting |
| `-d, --date-only` | Show dates only (mutually exclusive with -m) |
| `-m, --commit-message` | Show commit messages on next line |
| `--no-color` | Disable colors and syntax highlighting |
| `-v, --version` | Print version information |
| `-h, --help` | Show help information |

### ✨ Smart Path Resolution

`wer` automatically finds files and directories by name and intelligently handles different path types:

```bash
# Just type the filename - wer finds it automatically
wer main.rs # Finds src/main.rs
wer Cargo.toml # Finds ./Cargo.toml

# Works with directories too
wer src/ # Works from anywhere in the repository

# Relative paths work across repositories
wer ../other-project/file.rs # Finds the git repo in ../other-project/
wer ./subdir/file.py # Within current repository

# For absolute paths, use full paths to skip search
wer ~/Documents/file.txt # Uses absolute path directly
wer /full/path/to/file # No search, direct access

# Shows multiples matches in normal mode
wer config.toml
# → src/config.toml:
# → 61fcdda Mats Julius Funke - 07 Jun 2025: Update config
# →
# → tests/config.toml:
# → a1b2c3d Jane Doe - 05 Jun 2025: Add test config
```

**Path Types Supported:**

| Path Type | Example | Behavior |
| ---------------------------- | -------------------------- | -------------------------------------------- |
| **Filename** | `main.rs` | Searches recursively in current directory |
| **Relative in current repo** | `./src/main.rs` | Checks path directly in current repository |
| **Relative outside repo** | `../other-project/file.rs` | Resolves path and finds appropriate git repo |
| **Absolute path** | `/full/path/to/file` | Uses path directly |
| **Home directory** | `~/Documents/file.txt` | Expands tilde and uses directly |

### 🎮 Basic Usage

```bash
# Check who last edited a file
wer Cargo.toml
# → 61fcdda Mats Julius Funke - 07 Jun 2025: Initial commit

# Check who last edited a directory
wer src
# → 61fcdda Mats Julius Funke - 07 Jun 2025: Added new module

# Check files in other repositories using relative paths
wer ../other-project/README.md
# → a1b2c3d Jane Doe - 05 Jun 2025: Update documentation

# Check current directory
wer
# → 61fcdda Mats Julius Funke - 07 Jun 2025: Latest changes
```

### 👥 Last Contributors

![Last Mode](./screenshots/last-mode.png)

Find the last N unique people who touched a file or directory:

```bash
# Show last 5 contributors
wer -l 5 src/
# → a1b2c3d George Boole - 1854: feat: introduce Boolean algebra and logical foundations
# → e4f5g6h Alan Turing - 30 Nov 1936: feat: develop theoretical computing foundations
# → i7j8k9l Claude Shannon - Jul 1948: feat: establish information theory and digital communication
# → m0n1o2p Steve Wozniak - Jul 1976: feat: launch personal computing revolution
# Searched for 5 but only 4 contributed # (if fewer found)
```

### 🫵 Blame Mode

![Blame Mode](./screenshots/blame-mode.png)

Show git blame with syntax highlighting for any file:

```bash
# Show blame with full commit info and syntax highlighting
wer -b main.rs # Automatically finds src/main.rs
# → 61fcdda (Mats Julius Fun - 07 Jun) | 1 | use anyhow::Result;
# → 6b70ffb (Mats Julius Fun - 07 Jun) | 2 | use clap::Parser;
```

### 🎨 Display Options

![Blame Mode date-only](./screenshots/blame-mode-date-only.png)

```bash
# Show only dates
wer -d main.rs
# → 07 Jun 2025

wer -b -d main.rs # Blame with dates only
# → 07 Jun | 1 | use anyhow::Result;
# → 07 Jun | 2 | use clap::Parser;

# Show commit messages on separate lines
wer -m main.rs
# → 61fcdda Mats Julius Funke - 07 Jun 2025
# Initial commit
wer -b -m main.rs # Blame with commit messages
# → 61fcdda (Mats Julius Fun - 07 Jun) | 1 | use anyhow::Result;
# Initial commit

# Disable colors and syntax highlighting
wer --no-color -b main.rs
```

## 👨‍💻 Contributing

Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## 📑 License

This project is licensed under the MIT License - see [LICENSE.md](LICENSE.md) for details.