Some AI scripts I use daily.
-
holefill
: I use it on VIM to fill code snippets -
aiemu
: emulate any game on the terminal (example) -
chatsh
: like ChatGPT but in the terminal (example chat) (example coding) (example refactor) -
agda2ts
: compile Agda to/from TypeScript (example)
For VIM integration, this is my messy vimrc. Use Sonnet to extract the relevant functions for you (:
This repo in general is kinda gambiarra. Opus-4 might clean it up
Just npm install -g
and run the given command the terminal.
You'll need to add Anthropic/OpenAI keys to a location. The CLI will inform where.
Most of this scripts will save a log to ~/.ai
. If you don't want this behavior, edit the scripts to suit your needs. (TODO: add a proper option.)
To add fzf completion for openrouter models, put this in .bashrc or similar:
_fzf_complete_chatsh() {
_fzf_complete --multi --reverse --prompt="chatsh> " -- "$@" < <(
curl -s https://openrouter.ai/api/v1/models | jq -r '.data[].id' | sed 's/^/openrouter:/'
)
}
[ -n "$BASH" ] && complete -F _fzf_complete_chatsh -o default -o bashdefault chatsh
Then type:
$ chatsh **<tab>
Everything here is MIT-licensed.