A stream processor as a todo app.
  • C 92.9%
  • Shell 4%
  • Makefile 3.1%
Find a file
Matthew Phillips d5cbe352b2
All checks were successful
Release / create-release (push) Successful in 14s
Release / build-linux (push) Successful in 28s
Add man page to Homebrew formula
- Upload chop.1 as release asset during macOS build
- Use Homebrew resource block to download and install man page
- Fixes 'man chop' not working on macOS
2026-01-09 07:21:26 -05:00
.forgejo/workflows Add man page using scdoc 2025-12-23 20:54:45 -05:00
.github/workflows Add man page to Homebrew formula 2026-01-09 07:21:26 -05:00
debian Add .deb package builds and apt repository support 2025-12-21 18:08:56 -05:00
freebsd-package Add man page using scdoc 2025-12-23 20:54:45 -05:00
.gitignore Add man page using scdoc 2025-12-23 20:54:45 -05:00
chop.1.scd Add man page using scdoc 2025-12-23 20:54:45 -05:00
chop.c build out the app 2025-12-14 18:52:01 -05:00
chop.h build out the app 2025-12-14 18:52:01 -05:00
CLAUDE.md Add --file/-f and --write/-w for alias convenience 2025-12-16 07:25:36 -05:00
LICENSE Update LICENSE with full name 2025-12-16 07:26:02 -05:00
main.c Add --file/-f and --write/-w for alias convenience 2025-12-16 07:25:36 -05:00
Makefile Add AUR publishing support 2025-12-24 08:11:37 -05:00
README.md Add AUR install instructions to README 2025-12-24 08:33:09 -05:00

chop

A stream filter for todo lists. Like sed or sort, but for todos.

echo "Buy milk" | chop
# - [ ] Buy milk

chop -it < todos.txt
# - [ ] Pending item 1
# - [ ] Pending item 2

Chop normalizes any text into todo format and filters by status. It reads from stdin (via < or pipe), writes to stdout, and composes with standard unix tools.

Install

Platform Binary Package Manager
Linux chop-linux-amd64 apt install chop / yay -S chop
FreeBSD chop-freebsd-amd64 pkg install chop
macOS chop-macos-arm64 brew install chop

Debian/Ubuntu (apt)

curl -fsSL https://codeberg.org/api/packages/mphillips/debian/repository.key | sudo tee /etc/apt/keyrings/chop.asc
echo "deb [signed-by=/etc/apt/keyrings/chop.asc] https://codeberg.org/api/packages/mphillips/debian stable main" | sudo tee /etc/apt/sources.list.d/chop.list
sudo apt update && sudo apt install chop

Arch Linux (AUR)

yay -S chop

Or with any AUR helper (paru -S chop, etc).

FreeBSD (pkg)

sudo mkdir -p /usr/local/etc/pkg/repos
cat <<'EOF' | sudo tee /usr/local/etc/pkg/repos/chop.conf
chop: {
  url: "https://matthewp.github.io/chop/freebsd/",
  enabled: yes
}
EOF
sudo pkg update
sudo pkg install chop

macOS (Homebrew)

brew tap matthewp/chop
brew install chop

Binary download

Grab a binary from Releases:

# Linux
curl -LO https://codeberg.org/mphillips/chop/releases/latest/download/chop-linux-amd64

# macOS (Apple Silicon)
curl -LO https://codeberg.org/mphillips/chop/releases/latest/download/chop-macos-arm64

# FreeBSD
curl -LO https://codeberg.org/mphillips/chop/releases/latest/download/chop-freebsd-amd64

chmod +x chop-*
sudo mv chop-* /usr/local/bin/chop

Build from source

make
sudo make install  # copies to /usr/local/bin

Usage

# Normalize text to todos
chop < notes.txt > todos.txt

# Include by status
chop -it < todos.txt            # pending only
chop -id < todos.txt            # completed only
chop -iip < todos.txt           # in-progress only

# Exclude by status
chop -xd < todos.txt            # exclude done (clear finished)
chop -xd < todos.txt | sponge todos.txt  # clear done and save

# Add new items
echo "Buy milk" | chop >> todos.txt

# Mark all items
chop -md < todos.txt | sponge todos.txt   # all done
chop -mip < todos.txt | sponge todos.txt  # all in-progress

# Mark items interactively (with fzf)
chop -md --fzf < todos.txt | sponge todos.txt
chop -mip --fzf < todos.txt | sponge todos.txt

Both chop < file and cat file | chop work - use whichever you prefer.

Long forms: --include=STATUS, --exclude=STATUS, --mark=STATUS (STATUS: todo, done, in-progress)

File format

Standard markdown checkboxes:

- [ ] Pending task
- [x] Completed task
- [>] In-progress task

Any plain text piped through chop becomes - [ ] text.

Composing with other tools

# Browse with fzf
chop -it < todos.txt | fzf

# Sort alphabetically
chop < todos.txt | sort

# Count pending items
chop -it < todos.txt | wc -l

Install moreutils for sponge: apt install moreutils or brew install moreutils

File mode

For convenience, -f FILE reads from a file and -w writes back to it:

chop -f todos.txt -iip          # view in-progress
chop -f todos.txt -xd -w        # clear done items
chop -f todos.txt -md --fzf -w  # interactive mark done

This is useful for shell aliases:

alias t="chop -f ~/todos.txt"
t                    # view all
t -iip               # view in-progress
t -xd -w             # clear done
t -mip --fzf -w      # mark in-progress interactively

License

BSD 3-Clause. See LICENSE.