Reusable Fish shell scripts, functions, completions, startup snippets and other helpful scripts.
- Go 90.6%
- Shell 9.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| completions | ||
| conf.d | ||
| functions | ||
| scripts | ||
| .gitignore | ||
| mise.toml | ||
| README.md | ||
| renovate.json | ||
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.