diff --git a/README.md b/README.md index 652234f..ffebfbe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Hush -A Linux speech-to-text daemon that records audio, transcribes it via the Groq Whisper API, optionally cleans up the text with an LLM, and types the result into whatever window currently has focus. +A Linux speech-to-text daemon that records audio, transcribes it via the Groq or Fireworks Whisper API, cleans up the text with an LLM, and types the result into whatever window currently has focus. -The intended workflow: bind `hush toggle` to a global hotkey, press to start recording, press again to stop, and the transcribed text appears in your active application. +The intended workflow: bind `hush toggle` to a global hotkey, press to start recording, press again to stop, and the transcribed text appears in your active application. Use profiles to switch behaviour per hotkey — e.g. one binding for normal dictation, another for translating speech into a shell command. ## Requirements @@ -11,7 +11,7 @@ The intended workflow: bind `hush toggle` to a global hotkey, press to start rec - [pw-record](https://pipewire.org/) (PipeWire) or `ffmpeg` (PulseAudio) — audio capture - [wtype](https://github.com/atx/wtype) (Wayland) or [xdotool](https://github.com/jordansissel/xdotool) (X11) — text injection - `notify-send` — desktop notifications -- A [Groq API key](https://console.groq.com/) +- A [Groq](https://console.groq.com/) or [Fireworks](https://fireworks.ai/) API key **Build dependencies:** @@ -54,6 +54,16 @@ Config is stored at `~/.config/hush/config` in TOML format. | `hush latency-test` | Measure STT and LLM round-trip latency | | `hush daemon` | Run the daemon in the foreground | | `hush setup` | Interactive configuration wizard | +| `hush profiles list` | List all profiles | +| `hush profiles get ` | Print the contents of a profile | +| `hush profiles new ` | Create a new profile (manual or AI-generated) | +| `hush profiles edit ` | Open a profile in `$EDITOR` | + +`hush toggle` and `hush stop` accept a `--profile ` flag to apply a named profile when processing the recording: + +```bash +hush toggle --profile cmd +``` ## Building Manually @@ -70,9 +80,43 @@ Key settings in `~/.config/hush/config`: | Key | Default | Description | |---|---|---| | `groq_api_key` | | Groq API key | +| `fireworks_api_key` | | Fireworks API key | +| `whisper_provider` | `groq` | `groq` or `fireworks` | +| `llm_provider` | `groq` | `groq` or `fireworks` | | `whisper_model` | `whisper-large-v3-turbo` | Whisper model to use | | `llm_model` | `openai/gpt-oss-20b` | LLM model for text cleanup | | `audio_backend` | `pw-record` | `pw-record` or `ffmpeg` | | `typing_backend` | `wtype` | `wtype` or `xdotool` | -| `whisper_language` | | Optional ISO 639-1 language code | +| `whisper_language` | | Optional ISO 639-1 language code (e.g. `en`) | | `min_recording_duration` | `500` | Minimum recording length in ms | +| `system_prompt` | | Custom LLM system prompt (empty = built-in default) | + +## Profiles + +Profiles let you switch Hush's behaviour on a per-hotkey basis without touching the main config or restarting the daemon. A profile is a partial TOML file stored in `~/.config/hush/profiles/` — only the fields you list override the base config. + +Create a profile interactively: + +```bash +hush profiles new cmd +``` + +You will be asked whether to write the prompt manually or have the AI generate it from a description. The profile opens in `$EDITOR` for final review. + +Example profile at `~/.config/hush/profiles/cmd`: + +```toml +whisper_language = "en" +system_prompt = """ +Convert the spoken input into a single valid bash command. Output only the raw +command with no explanation, no markdown, and no backticks. If the input is +unclear, output an empty string. +""" +``` + +Bind a second hotkey to use it: + +``` +Super+R → hush toggle +Super+Shift+R → hush toggle --profile cmd +``` diff --git a/completions/_hush b/completions/_hush index b498c8b..051f34c 100644 --- a/completions/_hush +++ b/completions/_hush @@ -20,6 +20,7 @@ _hush() { 'latency-test:Run a full STT+LLM round-trip latency test' 'setup:Interactive configuration wizard' 'show:Display current configuration' + 'profiles:Manage configuration profiles' ) _describe 'command' commands ;; @@ -30,9 +31,31 @@ _hush() { '--plain[Show plain key=value pairs instead of a table]' \ '--json[Show raw JSON output]' ;; + toggle|stop) + _arguments \ + '--profile[Profile name to apply when processing]:profile:_hush_profiles' \ + '-p[Profile name to apply when processing]:profile:_hush_profiles' + ;; + profiles) + local subcommands=( + 'list:List all available profiles' + 'get:Print the contents of a profile' + 'new:Create a new profile' + 'edit:Open a profile in $EDITOR' + ) + _describe 'profiles subcommand' subcommands + ;; esac ;; esac } +_hush_profiles() { + local profiles_dir="${HOME}/.config/hush/profiles" + if [[ -d "$profiles_dir" ]]; then + local profiles=("${profiles_dir}"/*(N:t)) + _describe 'profile' profiles + fi +} + _hush "$@"