Featured image of post 「 vimai 」 CLI tool

「 vimai 」 CLI tool

Editing text files with natural language, AI and vim-commands without knowing/opening vim.


Natural language AI-powered CLI tool to effortlessly edit one or multiple text files.

Example of the commands:

  • formatting lines in files (e.g. email addresses or HTML tags)
  • removing words
  • replacing words
  • etc.

As we all know it’s dangerous to enter vim. So I’ve created a CLI tool that will allow you to edit text files with vim-commands without actually putting yourself in danger of being trapped in vim forever.

Basically you can apply any vim-commands on multiple files without actually knowing a single vim-command. I am not saying you should though.


how it works

  • you run vimai in your terminal
  • you enter your request in natural language, including the files you want to edit

i want to remove all lines with "example" from file1.txt and file2.txt

  • vimai will come up with a command and output it for you to confirm
  • you can apply the command or relaunch the request
  • after confirmation, vimai will apply the command on the files

where / with whom

This was a personal project made solo by me.


「 vimai 」 on github

Be advised that it’s largely a demo project, AI can hallucinate, so probably do not edit your entire production codebase with it.


so what?

I have made a small prototype back in November 2023 just for fun and recorded a demo video which you can see above. I’ve posted it on my twitter and shared with a couple of collegues just to have some laughs about it during weekly coffee call.

nixcraft reposted my demo aka hey mom i am famous

  • In March 2024 I’ve quoted my post under a meme post which was reposted by nixcraft (niche but popular in certain circles account posting curious and fun stuff about linux, opensource, programming, sysadmin and network stuff).
  • nixcraft asked if vimai is opensource, so I’ve decided to make it a bit more polished and share it on github.
  • After me confirming that vimai is opensource, my post with a demo ended up “featured” (reposted) by nixcraft.

That was nice.

What was even nicer - later on, iTerm (a popular terminal emulator for MacOS) have implemented similar feature “AI Prompt”:

comments powered by Disqus