https://github.com/primaprashant/hns
A simple, privacy-focused speech-to-text CLI tool that records your voice, transcribes it locally using faster-whisper, and copies the transcription to your clipboard.
https://github.com/primaprashant/hns
cli clipboard faster-whisper python speech-to-text whisper
Last synced: 3 months ago
JSON representation
A simple, privacy-focused speech-to-text CLI tool that records your voice, transcribes it locally using faster-whisper, and copies the transcription to your clipboard.
- Host: GitHub
- URL: https://github.com/primaprashant/hns
- Owner: primaprashant
- License: mit
- Created: 2025-06-30T06:43:33.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-19T03:07:42.000Z (3 months ago)
- Last Synced: 2025-07-19T04:00:01.784Z (3 months ago)
- Topics: cli, clipboard, faster-whisper, python, speech-to-text, whisper
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cli-apps-in-a-csv - hns - A privacy-focused open-source command-line tool for on-device speech-to-text. It records your voice, transcribes it completely locally using faster-whisper, and automatically copies the text to clipboard for immediate use in any application. (<a name="ai"></a>AI / ChatGPT)
- awesome-cli-apps - hns - A privacy-focused open-source command-line tool for on-device speech-to-text. It records your voice, transcribes it completely locally using faster-whisper, and automatically copies the text to clipboard for immediate use in any application. (<a name="ai"></a>AI / ChatGPT)
- awesome-whisper - hns - On-device speech-to-text CLI using faster-whisper with automatic clipboard copy. (CLI tools / Self-hosted)
README
# hns - A simple, privacy-focused speech-to-text CLI tool
A simple, privacy-focused speech-to-text CLI tool that records your voice, transcribes it locally using [faster-whisper](https://github.com/SYSTRAN/faster-whisper), and copies the transcription to your clipboard. Perfect for interacting with Claude Code, VS Code, Slack, or any application where native dictation falls short.
Click the image below to see the demo ⬇️ (warning: demo has sound)
[](https://cdn.anandprashant.com/hns/demo.mp4)
## Highlights
- **100% Local & Private**: Audio is processed entirely on your local machine. No data leaves your device
- **Works Offline**: After the initial model download, no internet connection is required
- **Instant Clipboard**: Transcribed text is automatically copied to your clipboard for immediate pasting
- **Multi-Language Support**: Transcribe in any language supported by Whisper
- **Configurable**: Choose models and languages via environment variables
- **Focused** - Does one thing well: speech → clipboard
- **Open Source** - MIT licensed, fully transparent## Use Cases
- **Claude Code & AI Assistants**: Perfect for Claude Code or any AI interface without native dictation. Run `hns`, speak your prompt, then paste into Claude Code.
- **Brain Dump → Structured Output**: Ramble your scattered thoughts, then paste into an LLM to organize:
```sh
hns # "So I'm thinking about the refactor... we need to handle auth, but also consider caching..."
# Paste to LLM: "Create a structured plan from these thoughts:"
```
- **Communication**: Compose Slack messages, emails, or chat responses hands-free.
- **Note-Taking**: Quickly capture thoughts and ideas without switching from the keyboard.
- **Accessibility**: Helpful for users who find typing difficult or painful.## Installation
Install via [uv](https://github.com/astral-sh/uv) (recommended):
```sh
uv tool install hns
```
or `pipx`:
```sh
pipx install hns
```
or `pip`:
```sh
pip install --user hns
```The first time you run `hns`, it will download the default Whisper model (`base`). This requires an internet connection and may take a few moments. Subsequent runs can be fully offline.
## Usage
### Basic Transcription
1. Run the command in your terminal:
```sh
hns
```
2. The tool will display `🎤 Recording...`. Speak into your microphone.
3. Press `Enter` when you have finished.
4. The transcribed text is automatically copied to your clipboard and printed to the console.### Configuration
#### Listing Models
To see all available transcription models:
```sh
hns --list-models
```#### Setting the Model
Select a model by setting the `HNS_WHISPER_MODEL` environment variable. The default is `base`. For higher accuracy, use a larger model like `medium` or `large-v3`.
```sh
# Use the 'small' model for the current session
export HNS_WHISPER_MODEL="small"
hns
```To make the change permanent, add `export HNS_WHISPER_MODEL=""` to your shell profile (`.zshrc`, `.bash_profile`, etc.).
#### Setting the Language
By default, Whisper auto-detects the language. To force a specific language, set the `HNS_LANG` environment variable.
```sh
# Use an environment variable for Japanese
export HNS_LANG="ja"
hns
```## License
This project is licensed under the [MIT License](./LICENSE).