https://github.com/blakechambers/deno-whisper-cli
A command-line interface tool that records audio and converting it into text via the OpenAI Whisper API
https://github.com/blakechambers/deno-whisper-cli
cli deno openai speech-to-text
Last synced: 4 months ago
JSON representation
A command-line interface tool that records audio and converting it into text via the OpenAI Whisper API
- Host: GitHub
- URL: https://github.com/blakechambers/deno-whisper-cli
- Owner: blakechambers
- License: mit
- Created: 2023-06-10T18:23:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T13:18:45.000Z (over 2 years ago)
- Last Synced: 2023-12-14T14:31:35.543Z (over 2 years ago)
- Topics: cli, deno, openai, speech-to-text
- Language: TypeScript
- Homepage: https://deno.land/x/whisper_cli
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deno Whisper CLI
Deno Whisper CLI is a command-line interface tool that records audio using
`sox`, converts it into text via the OpenAI Whisper API, and copies the
resulting text to your clipboard for further use. This utility leverages local
tools such as `sox` for audio recording and `pbcopy` for transferring text to
the clipboard. An environment key is required to facilitate the translation
process. Currently, support for this tool has only been tested on the latest
versions of MacOS. While there's potential for future extensions to Windows,
there are no immediate plans for such support.
## Installation
You'll need `deno` and `sox` locally:
```bash
brew install deno
brew install sox
```
Then, make sure you have an `OPENAI_API_KEY` environment variable:
```bash
export OPENAI_API_KEY=your_openai_api_key
```
Then you can install via deno.land:
```bash
deno install \
--name your_custom_executable_name
--allow-env=OPENAI_API_KEY \
--allow-run=sox,pbcopy \
--allow-read=./temp.mp3 \
--allow-write=./temp.mp3 \
--allow-net=api.openai.com \
https://deno.land/x/whisper_cli/cli.ts
```
From there, run:
```bash
your_custom_executable_name
```
## Usage
```bash
> deno run cli.ts --help
```
## Future ideas
- add quiet option to configure the logger to not prompt as much
- detect stdout and route prompt text stderr
- accept an option to write content to a file (instead of requiring stdout)
- use a configurable temp directory and file name for the audio file
- enable/disable cleanup of the audio file
- colorize and organize output