whspr 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -16
- package/dist/index.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
# whspr
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/whspr)
|
|
4
|
+
[](https://choosealicense.com/licenses/mit/)
|
|
5
|
+
[](./CONTRIBUTING.md)
|
|
6
|
+
|
|
3
7
|
A CLI tool that records audio from your microphone, transcribes it using Groq's Whisper API, and post-processes the transcription with AI to fix errors and apply custom vocabulary.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="./demo.gif" alt="whspr demo" width="600">
|
|
11
|
+
</p>
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
- 15-minute max recording time
|
|
9
|
-
- Transcription via Groq Whisper API
|
|
10
|
-
- AI-powered post-processing to fix transcription errors
|
|
11
|
-
- Custom vocabulary support via `WHSPR.md`
|
|
12
|
-
- Automatic clipboard copy
|
|
13
|
+
## Installation
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g whspr
|
|
17
|
+
```
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
- FFmpeg (`brew install ffmpeg` on macOS)
|
|
18
|
-
- Groq API key
|
|
19
|
+
### Optional: Alias as `whisper`
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
If you'd like to use `whisper` instead of `whspr`, add this to your shell config (`~/.zshrc` or `~/.bashrc`):
|
|
21
22
|
|
|
22
23
|
```bash
|
|
23
|
-
|
|
24
|
-
npm run build
|
|
25
|
-
npm link
|
|
24
|
+
alias whisper="whspr"
|
|
26
25
|
```
|
|
27
26
|
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- Node.js 18+
|
|
30
|
+
- FFmpeg (`brew install ffmpeg` on macOS)
|
|
31
|
+
- Groq API key
|
|
32
|
+
|
|
28
33
|
## Usage
|
|
29
34
|
|
|
30
35
|
```bash
|
|
@@ -40,9 +45,18 @@ whspr --verbose
|
|
|
40
45
|
|
|
41
46
|
Press **Enter** to stop recording.
|
|
42
47
|
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- Live audio waveform visualization in the terminal
|
|
51
|
+
- 15-minute max recording time
|
|
52
|
+
- Transcription via Groq Whisper API
|
|
53
|
+
- AI-powered post-processing to fix transcription errors
|
|
54
|
+
- Custom vocabulary support via `WHSPR.md`
|
|
55
|
+
- Automatic clipboard copy
|
|
56
|
+
|
|
43
57
|
## Custom Vocabulary
|
|
44
58
|
|
|
45
|
-
Create a `WHSPR.md` file in your current directory to provide custom vocabulary, names, or instructions for the AI post-processor:
|
|
59
|
+
Create a `WHSPR.md` (or `WHISPER.md`) file in your current directory to provide custom vocabulary, names, or instructions for the AI post-processor:
|
|
46
60
|
|
|
47
61
|
```markdown
|
|
48
62
|
# Custom Vocabulary
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,13 @@ function formatDuration(seconds) {
|
|
|
23
23
|
return `${secs}s`;
|
|
24
24
|
}
|
|
25
25
|
async function main() {
|
|
26
|
+
// Check for API key before recording
|
|
27
|
+
if (!process.env.GROQ_API_KEY) {
|
|
28
|
+
console.error(chalk.red("Error: GROQ_API_KEY environment variable is not set"));
|
|
29
|
+
console.log(chalk.gray("Get your API key at https://console.groq.com/keys"));
|
|
30
|
+
console.log(chalk.gray("Then run: export GROQ_API_KEY=\"your-api-key\""));
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
26
33
|
try {
|
|
27
34
|
// 1. Record audio
|
|
28
35
|
const recording = await record(verbose);
|