how - Natural Language to Shell Commands
A CLI tool that turns plain English into shell commands, powered by LLMs running locally with Ollama
You know what you want to do in the terminal, but can’t remember the exact flags. Was it find -mtime or find -mmin? Does tar need -xvf or -xzf? You Google it, wade through Stack Overflow circa 2012, and eventually find the answer buried under AI-generated SEO spam.
how fixes that. It’s a Go CLI that turns plain English into shell commands.
$ how find all go files modified in the last 24 hours
find . -name '*.go' -mtime -1
Finds all files ending in .go that were modified within the last day.
No fluff. No ads. No cookie banners. Just the command and a short explanation.
Running it locally with Ollama
The tool supports Anthropic, OpenAI, and Ollama as backends. I use Ollama for local inference - no API keys, no network calls, no usage costs. Just a model running on my machine. Everything stays private and it works offline, which is handy on a plane or in an environment where you’d rather not send queries to external APIs.
Setup
Install with Go or grab a binary from the releases page:
go install github.com/swibrow/how@latest
Then initialise the config:
how config init
This creates ~/.config/how/config.yaml. Point it at Ollama:
provider: ollama
ollama:
model: llama3
url: http://localhost:11434
That’s it. No API key required - just make sure Ollama is running.
Usage
Basic query:
how reverse a string in bash
Auto-execute the returned command with -y:
how -y list listening ports
Pipe directly into your shell with -q (quiet mode):
how -q convert png to jpg with imagemagick | sh
Examples
The code is on GitHub: github.com/swibrow/how - MIT licensed, written in Go, contributions welcome.