|
| 1 | +.TH HOW 1 "2026-03-23" "how 1.0" "User Commands" |
| 2 | +.SH NAME |
| 3 | +how \- ask an LLM questions from the terminal |
| 4 | +.SH SYNOPSIS |
| 5 | +.B how |
| 6 | +.RI [ question... ] |
| 7 | +.br |
| 8 | +.B what |
| 9 | +.RI [ question... ] |
| 10 | +.br |
| 11 | +.B when |
| 12 | +.RI [ question... ] |
| 13 | +.br |
| 14 | +.B why |
| 15 | +.RI [ question... ] |
| 16 | +.SH DESCRIPTION |
| 17 | +.B how |
| 18 | +is a one-shot CLI utility that sends a question to a large language model and |
| 19 | +prints the answer. |
| 20 | +The command name forms the start of the query: running |
| 21 | +.B how to list files |
| 22 | +sends \(lqhow to list files\(rq to the configured LLM provider. |
| 23 | +.PP |
| 24 | +Symlinks |
| 25 | +.BR what , |
| 26 | +.BR when , |
| 27 | +and |
| 28 | +.B why |
| 29 | +allow different question styles. |
| 30 | +For example, |
| 31 | +.B what is my ip |
| 32 | +sends \(lqwhat is my ip\(rq. |
| 33 | +.PP |
| 34 | +The response is tailored to the user\(aqs operating system, shell, and working |
| 35 | +directory. |
| 36 | +Answers are concise and fit on a standard terminal screen. |
| 37 | +When a command is relevant, the LLM provides a brief explanation followed by the |
| 38 | +exact command(s). |
| 39 | +.SH CONFIGURATION |
| 40 | +.B how |
| 41 | +reads its configuration from |
| 42 | +.IR ~/.config/how/config . |
| 43 | +The file must have 0600 permissions. |
| 44 | +.PP |
| 45 | +The format is simple key=value pairs, one per line. |
| 46 | +Lines starting with |
| 47 | +.B # |
| 48 | +are comments. |
| 49 | +.SS Required keys |
| 50 | +.TP |
| 51 | +.B default_provider |
| 52 | +The LLM provider to use. |
| 53 | +Valid values: |
| 54 | +.BR openai , |
| 55 | +.BR anthropic , |
| 56 | +.BR mistral , |
| 57 | +.BR google , |
| 58 | +.BR custom . |
| 59 | +.TP |
| 60 | +.IB provider _api_key |
| 61 | +API key for the given provider (e.g., |
| 62 | +.BR mistral_api_key ). |
| 63 | +.SS Optional keys |
| 64 | +.TP |
| 65 | +.IB provider _model |
| 66 | +Override the default model for a provider (e.g., |
| 67 | +.BR openai_model ). |
| 68 | +.TP |
| 69 | +.B custom_endpoint |
| 70 | +URL for the custom provider (required when using |
| 71 | +.BR custom ). |
| 72 | +Compatible with OpenAI-format APIs such as Ollama and vLLM. |
| 73 | +.TP |
| 74 | +.B allow_insecure_ssl |
| 75 | +Set to |
| 76 | +.B true |
| 77 | +to disable SSL certificate verification. |
| 78 | +Intended for local LLM servers with self-signed certificates. |
| 79 | +.SS Example configuration |
| 80 | +.nf |
| 81 | +default_provider = mistral |
| 82 | +mistral_api_key = sk-... |
| 83 | +mistral_model = mistral-small-latest |
| 84 | +.fi |
| 85 | +.SH ENVIRONMENT |
| 86 | +.TP |
| 87 | +.B HOW_PROVIDER |
| 88 | +Override the configured default provider for this invocation. |
| 89 | +.TP |
| 90 | +.B HOW_MODEL |
| 91 | +Override the configured model for this invocation. |
| 92 | +.SH FOLLOW-UP DETECTION |
| 93 | +.B how |
| 94 | +caches the last exchange and automatically includes it as context when it |
| 95 | +detects a follow-up question: |
| 96 | +.IP \(bu 2 |
| 97 | +Within 2 minutes: always treated as a follow-up. |
| 98 | +.IP \(bu 2 |
| 99 | +2\(en10 minutes: treated as a follow-up if the query is short (3 words or |
| 100 | +fewer after the command name) or contains signal words like \(lqbut\(rq, |
| 101 | +\(lqalso\(rq, \(lqinstead\(rq, etc. |
| 102 | +.IP \(bu 2 |
| 103 | +After 10 minutes: never treated as a follow-up. |
| 104 | +.SH FILES |
| 105 | +.TP |
| 106 | +.I ~/.config/how/config |
| 107 | +Configuration file (must be 0600). |
| 108 | +.TP |
| 109 | +.I ~/.cache/how/history |
| 110 | +Cached last exchange for follow-up detection. |
| 111 | +.SH EXIT STATUS |
| 112 | +.TP |
| 113 | +.B 0 |
| 114 | +Success. |
| 115 | +.TP |
| 116 | +.B 1 |
| 117 | +Error (missing config, network failure, invalid response, etc.). |
| 118 | +A diagnostic message is printed to standard error. |
| 119 | +.SH EXAMPLES |
| 120 | +.TP |
| 121 | +.B how to find large files |
| 122 | +Ask how to find large files on this system. |
| 123 | +.TP |
| 124 | +.B what is the default gateway |
| 125 | +Ask what the default gateway is. |
| 126 | +.TP |
| 127 | +.B how in rust |
| 128 | +Short follow-up: repeat the previous question but for Rust. |
| 129 | +.TP |
| 130 | +.B HOW_PROVIDER=anthropic how to list containers |
| 131 | +Use Anthropic for a single query. |
| 132 | +.SH NOTES |
| 133 | +The |
| 134 | +.B ? |
| 135 | +character is a shell glob. |
| 136 | +Quote it or omit it when asking questions: |
| 137 | +.PP |
| 138 | +.nf |
| 139 | +how "what is my ip?" # quoted |
| 140 | +how what is my ip # omit the question mark |
| 141 | +.fi |
| 142 | +.SH AUTHORS |
| 143 | +Mattias Lindblad |
0 commit comments