A slim LLM CLI for your terminal.
Ask questions, debug errors with session context, and redact secrets — all from a single shell script.
Deps: curl (always present), jq (auto-installed if missing)
Install
curl -sL https://github.com/lazyville/qsh/releases/latest/download/q.sh > ~/.local/bin/q && chmod +x ~/.local/bin/q
Setup
Add session logging so q debug / q wtf have terminal context to work with:
q install-hook # prints the hook — paste into ~/.zshrc or ~/.bashrcThe hook logs commands (skipping vim, fzf, claude, etc.) and provides q-stop / q-start aliases to pause/resume logging around interactive tools.
Usage
q <prompt> one-shot question
q debug [question] ask with recent terminal output as context
q wtf shortcut: "what went wrong and how do I fix it?"
q log preview what context would be sent (dry run)
q clear wipe the session log
q-stop pause logging (shell alias — preserves TTY for vim/claude/fzf)
q-start resume logging (shell alias)
q config show active config
q install-hook print shell hook to add to your rc file
q completions [bash|zsh|fish] print shell completion script
q ignore list redaction patterns
q ignore add <PATTERN> redact a word/var from context (e.g. API_KEY)
q ignore remove <PATTERN> remove a pattern
Note:
q-stopandq-startare shell aliases, not subcommands. They must run in your current shell to take effect — usingq stop/q startwon't work.
Shell Completions
Enable tab completion for subcommands:
# zsh — add to ~/.zshrc eval "$(q completions zsh)" # bash — add to ~/.bashrc eval "$(q completions bash)" # fish — run once q completions fish > ~/.config/fish/completions/q.fish
Providers
Set Q_PROVIDER (default: openai):
| Provider | Endpoint | Key var |
|---|---|---|
openai |
api.openai.com/v1 | OPENAI_API_KEY |
nova |
api.nova.amazon.com/v1 | AWS_API_KEY |
azure |
your resource URL | AZURE_API_KEY |
anthropic |
api.anthropic.com (native fmt) | ANTHROPIC_API_KEY |
<custom> |
set Q_ENDPOINT directly |
Q_API_KEY |
Config
Config is auto-saved on first run to ~/.config/q/config.sh. Override with env vars:
Q_PROVIDER openai | nova | azure | anthropic | <custom>
Q_MODEL model name
Q_ENDPOINT override the preset base URL
Q_API_KEY override the preset key var
Q_SYSTEM system prompt
Q_SESSION_LOG log path (default: ~/.q/current.log)
Q_CONTEXT_LINES lines of context to send (default: 80)
Azure extras: Q_AZURE_BASE, Q_AZURE_DEPLOY, Q_AZURE_API_VER
Show Config
➜ qsh git:(main) q config
provider openai
endpoint https://api.nova.amazon.com/v1
model nova-2-lite-v1
api key set (36 chars)
log ~/.q/current.log (last 80 lines)
config ~/.config/q/config.sh
ignore ~/.config/q/qignore
ignore patterns:
vim
claude
Examples
q "explain this regex: ^[a-z]+$" q wtf # after a command fails Q_PROVIDER=anthropic Q_MODEL=claude-opus-4-6 q "refactor this" Q_PROVIDER=azure Q_AZURE_BASE=https://myco.openai.azure.com Q_AZURE_DEPLOY=gpt-4o q "hello" Q_PROVIDER=custom Q_ENDPOINT=http://localhost:11434/v1 Q_API_KEY=ollama Q_MODEL=llama3 q "hello"
qignore
Redact sensitive values from context before they're sent to the LLM:
q ignore add MY_SECRET_VAR q ignore add AWS_SECRET_ACCESS_KEY
Patterns are stored in ~/.config/q/qignore and matched as word boundaries and VAR=value pairs.























