Skip to content
/ how Public

Simple CLI tool to give hints on tools using LLMs

Notifications You must be signed in to change notification settings

swibrow/how

Repository files navigation

how

A smart terminal cheatsheet — ask a natural language question, get back a shell command.

$ how find all go files modified in the last 24 hours

  $ find . -name '*.go' -mtime -1
  Finds all .go files modified within the last 24 hours

Features

  • Natural language to shell command translation
  • Multiple LLM backends: Anthropic, OpenAI, and Ollama (local)
  • Clean, colorized terminal output
  • Quiet mode for piping (-q)
  • Optional auto-execution (-y)

Installation

Homebrew

brew install swibrow/tap/how

From source

go install github.com/swibrow/how/cmd/how@latest

From releases

Download a prebuilt binary from Releases.

Usage

# Ask a question
how reverse a string in bash

# Run the suggested command immediately
how -y list listening ports

# Output only the command (useful for piping)
how -q convert png to jpg with imagemagick | sh

Configuration

Initialize a config file:

how config init

This creates ~/.config/how/config.yaml:

provider: anthropic
anthropic:
  api_key: ""
  model: claude-sonnet-4-6
openai:
  api_key: ""
  model: gpt-4o
ollama:
  model: llama3
  url: http://localhost:11434/v1

API keys

Set via environment variables (recommended) or in the config file:

export ANTHROPIC_API_KEY=sk-...
# or
export OPENAI_API_KEY=sk-...

For Ollama, no API key is needed — just have Ollama running locally.

View current config

how config show

Development

Prerequisites

Build & test

make          # lint + test + build
make test     # run tests with race detector
make lint     # run linters
make coverage # generate coverage report
make build    # compile binary

License

MIT

About

Simple CLI tool to give hints on tools using LLMs

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •