An open API service indexing awesome lists of open source software.

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

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