Inflammation lets you dictate code inside VSCode/Cursor. It's context aware and let's you convert speech like
export function foo take in string bar and string car return string
into
You can see a demo video here.
It's named inflammation because it's gotten hard for me to type on some days due to inflammation and I needed something I can dictate to on a line-per-line basis.
This extension is simple enough for my needs. Please help improve it by submitting a PR.
After installing, hit cmd + shift + z to start listening. Release when you're done talking.
And that's it.
You can change the hotkey by going into your keyboard shortcut prefs: Preferences :Open Keyboard Shortcuts. from the command pallete.
https://marketplace.visualstudio.com/items?itemName=moughxyz.inflammation
You can find the .vsix files in the vsix dir on GitHub:
The extension requires audio recording software to be installed on your system:
-
macOS: Install SoX
-
Windows: Install SoX
- Download from: http://sox.sourceforge.net/
- Add to your system PATH
-
Linux: Install arecord (usually pre-installed)
sudo apt-get install alsa-utils
You'll need an OpenAI API key with access to:
- Whisper API (for transcription)
- GPT-4 or GPT-3.5 (for text processing)
Get your API key from: https://platform.openai.com/api-keys
https://marketplace.visualstudio.com/items?itemName=moughxyz.inflammation
- Clone this repository
- Install dependencies:
- Compile the extension:
- Open in VSCode and press F5 to run the extension in a new window
To create a .vsix package:
- Install vsce globally:
- Package the extension:
- Install the generated .vsix file in VSCode/Cursor
- Open any text file in VSCode/Cursor
- Press Cmd+Alt+Z (the extension will prompt for your OpenAI API key)
- Enter your API key (it will be stored securely)
- Place your cursor where you want to insert text
- Press Cmd+Alt+Z to start recording (you'll see "Recording..." in the status bar)
- Speak your code or text
- Press Cmd+Alt+Z again to stop recording and process
The extension will:
- Transcribe your audio using Whisper
- Process the transcription with GPT-4 using your file's context
- Insert the result at your cursor position
You can configure the extension in VSCode settings:
- inflammation.openaiModel: Choose the GPT model (default: gpt-4-turbo-preview)
- inflammation.whisperModel: Choose the Whisper model (default: whisper-1)
To change your API key:
- Open Command Palette (Cmd+Shift+P)
- Run "Inflammation: Configure API Key"
- Ensure you have the required audio recording software installed
- Check microphone permissions in your system settings
- Try running the audio recording command manually to test
- Check your microphone is working
- Speak louder or closer to the microphone
- Ensure no other application is using the microphone
- Verify your API key is valid
- Check your OpenAI account has sufficient credits
- Ensure you have access to the selected models
Pull requests are welcome! Please ensure your code follows the existing style and includes appropriate tests.
MIT
For issues and feature requests, please use the GitHub issue tracker.
.png)
