VSCode has a comprehensive API that you can create scripts for in Typescript
What I like about it is how it exposes pretty much all capabilities with no chance of breaking the editor host itself. Just the right balance of constrained-enough-but-seemingly-unconstrained.
You can develop these extensions in JS/TS super-smoothly inside VSC and run-with-F5 to open a new window with your extension running.
But frankly for small-script purposes, it's a bit overkill, unless/until you have enough of those that bundling them all up into one "my extension with all the Foos I demand" begins to make sense.
Unfortunately local-only, private one-off extensions aren't installed as trivially as dumping just-a-script-file in some dot folder and calling it done. I mean it almost is with `~/.vscode/extensions/my-ext/` but not 100% reliable. I have 2 custom exts in there that are always available but 1 that inexplicably never is (but builds & runs error/warning-free with F5). The official installation story is a "vsx package" (probably just a ZIP but haven't looked into it yet).