Reusable Fish shell scripts, functions, completions, startup snippets and other helpful scripts.
  • Go 90.6%
  • Shell 9.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-10 07:28:40 +00:00
completions Initial fish scripts repository 2026-06-08 21:21:01 +02:00
conf.d Initial fish scripts repository 2026-06-08 21:21:01 +02:00
functions Initial fish scripts repository 2026-06-08 21:21:01 +02:00
scripts Add git-sweeper tool for cleanup tasks 2026-06-14 14:33:02 +02:00
.gitignore Initial fish scripts repository 2026-06-08 21:21:01 +02:00
mise.toml Update dependency rumdl to v0.2.53 2026-08-10 06:42:59 +00:00
README.md Add git-sweeper tool for cleanup tasks 2026-06-14 14:33:02 +02:00
renovate.json Add renovate.json 2026-06-08 19:50:47 +00:00

fish-scripts

Reusable Fish shell scripts, functions, completions, and startup snippets for the m0sh1.cc workspace.

Layout

Path Purpose
functions/ Autoloaded Fish functions, usually one function per *.fish file.
completions/ Fish completions for local commands and scripts.
conf.d/ Optional startup snippets loaded by Fish. Keep these small and predictable.
scripts/ Standalone Fish scripts or helper commands.

Go cleanup utility (git-sweeper)

Path: scripts/git-sweeper/main.go

git-sweeper is a safety-first cleanup CLI for ~/git trees. It is designed to:

  • find old temporary files
  • find duplicate files by content
  • exclude git-tracked files by default
  • use dry-run planning first
  • quarantine files (default) instead of hard delete

Build

go build -C ./scripts/git-sweeper -o git-sweeper .

Typical workflow

# read-only analysis
./scripts/git-sweeper/git-sweeper scan --root ~/git

# generate dry-run action plan
./scripts/git-sweeper/git-sweeper plan --root ~/git

# execute plan (quarantine default)
./scripts/git-sweeper/git-sweeper apply --yes

# if the run is larger than defaults, explicitly allow it
./scripts/git-sweeper/git-sweeper apply --yes --allow-large-run

apply defaults to safety thresholds (--max-actions=1000, --max-bytes=2147483648). Override them with --max-actions, --max-bytes, or explicit --allow-large-run.

Restore and retention

# restore by apply run id
./scripts/git-sweeper/git-sweeper restore --run-id <run-id> --yes

# clear quarantine entries older than 30 days
./scripts/git-sweeper/git-sweeper vacuum --days 30 --yes

Install

Clone the repository:

git clone https://git.m0sh1.cc/m0sh1/scripts.git ~/git/m0sh1.cc/scripts

Symlink only the files you want to use:

ln -s ~/git/m0sh1.cc/scripts/functions/example.fish ~/.config/fish/functions/example.fish

Notes

  • Keep scripts idempotent where possible.
  • Do not commit secrets, host-only credentials, or machine-specific tokens.
  • Prefer Fish-native code over shell portability shims unless a script needs to call external tools directly.
  • Add comments for surprising behavior, not for obvious assignments.

License

No license has been selected yet.