Skip to content

yosifonoren/how-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

how-cli

howto is a tiny Go CLI that asks an installed LLM CLI (claude, codex, or opencode) for just the shell command you need.

howto demo

Features

  • Auto-detects installed tool in this order: claude, codex, opencode
  • Optional --tool flag to force one
  • Passes prior shell command as context (best-effort from shell history)
  • Sends strict prompt so output is command-only
  • Easy local install with go install

Install

Homebrew (macOS / Linux)

brew tap yosifonoren/tap
brew install howto

Debian / Ubuntu (.deb)

HOWTO_VERSION=$(curl -sL https://api.github.com/repos/yosifonoren/how-cli/releases/latest | sed -n 's/.*"tag_name": "v\([^"]*\)".*/\1/p')
curl -sLO "https://github.com/yosifonoren/how-cli/releases/latest/download/howto_${HOWTO_VERSION}_linux_$(dpkg --print-architecture).deb"
sudo dpkg -i howto_${HOWTO_VERSION}_linux_$(dpkg --print-architecture).deb

With Go

go install github.com/yosifonoren/how-cli/cmd/howto@latest

From source

git clone https://github.com/yosifonoren/how-cli.git
cd how-cli
go install ./cmd/howto

Usage

howto <your request>
howto --tool claude <your request>
howto --no-history <your request>

Examples

howto how do i list all files recursively
howto --tool codex how do i find all go files changed in last 2 days

How prompt context works

The tool creates a prompt with:

  1. A strict system instruction: return only one shell command.
  2. Your request.
  3. Previous command from shell history (unless --no-history is used).

History is read best-effort from:

  • $HISTFILE (if set)
  • ~/.zsh_history
  • ~/.bash_history
  • ~/.config/fish/fish_history

Local development workflow

1) Run directly

go run ./cmd/howto --help
go run ./cmd/howto how do i list hidden files

2) Run tests

go test ./...

3) Format and vet

go fmt ./...
go vet ./...

4) Install updated local version

go install ./cmd/howto

After code changes, repeat the cycle: go test, go vet, and go install.

Prerequisites

At least one of these LLM CLIs must be installed and in your PATH:

If none are found, howto exits with a clear error.

About

Get the shell command you need, instantly

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages