u/solisoares

Image 1 — Monkeypatsh - Simplify shell monkey patching
Image 2 — Monkeypatsh - Simplify shell monkey patching

Monkeypatsh - Simplify shell monkey patching

I got tired of writing wrapper functions by hand or creating aliases that take too much mental space when I just wanted to patch an existing API.

That's why I created Monkeypatsh.

Monkeypatsh is a tool for easily monkey patching commands in the shell:

  • It wraps any command you register with it, npm, docker, rm ... and lets you easily attach custom behavior to any existing or new subcommands, flags, or default invocation, while keeping the command's API intact.
  • It centralizes all your patches under one tool and extends the original completion with them.
  • Choose whether these patches stay only in your interactive shell, or are globally available through the $PATH variable.

The gif above shows how easy it is to patch npm run <script> to log the run to a log file.

Would appreciate some feedback. Thanks.

Repo: https://github.com/solisoares/monkeypatsh

u/solisoares — 17 hours ago
▲ 12 r/bash+1 crossposts

Monkeypatsh - Make shell monkey patching simple

I got tired of writing wrapper functions by hand or creating aliases that take too much mental space when I just wanted to patch an existing API.

That's why I created Monkeypatsh.

Monkeypatsh is a tool for easily monkey patching commands in the shell:

  • It wraps any command you register with it, npm, git, ls, docker... and lets you attach custom behavior to any existing or new subcommands, flags, or default invocation, while keeping the command's API intact.
  • It centralizes all your patches under one tool and extends the original completion with them.
  • Choose whether these patches stay only in your interactive shell, or are globally available through the $PATH variable.

The gif above shows how easy it is to patch npm run <script> to log the run to a log file.

Would appreciate some feedback. Thanks.

Repo: https://github.com/solisoares/monkeypatsh

u/solisoares — 3 days ago