In this guide, we’ll show you how to use Cursor AI along with Superwhisper to create a Python script without typing code. This means you can build, edit, and troubleshoot your code just by using your voice.
Whether you’re someone who prefers hands-free interaction or just looking to boost productivity, these tools make coding more accessible and efficient.
What Are Cursor AI and Superwhisper?
Cursor AI is a smart Integrated Development Environment (IDE) that helps you write code faster by providing helpful suggestions, catching errors in real-time, and generally making the coding process smoother.
Superwhisper is a powerful speech-to-text tool that accurately converts your spoken words into text. When these two tools are combined, you get a fully hands-free coding experience. Just say what you want, and Cursor AI will write the code for you.
This guide will walk you through how to use these tools to build a Python script. Everything we do here will be controlled through simple voice commands.
Setting Up Cursor AI and Superwhisper Together
Before we dive into the hands-on section, it’s important to understand how to set up Cursor AI and Superwhisper to work together.
Step-1 : Open Cursor AI and Superwhisper
Start by downloading and installing Cursor AI from its official website.https://www.cursor.com/. Cursor AI is available for multiple operating systems and provides a powerful IDE to make coding fast and intuitive.
Now, Install Superwhisper from its official website. https://superwhisper.com/. Currently it is available only on macOS and requires macOS 13+
Start by launching both the Cursor AI and Superwhisper applications.
Step 2: Set Up Superwhisper’s New Coding Mode for Cursor App
Navigate to Superwhisper’s settings to create a new mode. To do this:
- Open Settings in Superwhisper.
- Find the Modes section and click on the Create Mode button.
- A dialog box will open. Choose Custom to create a new mode.
- In the dialog box, create a new mode named Python Coding and select Activate in Cursor App to link this new mode with Cursor AI for hands-free integration.
- With Superwhisper running, activate the Python Coding mode using the keyboard shortcut Option + Spacebar. This shortcut lets you quickly toggle into coding mode whenever you need to start dictating your code.
If the selected mode is incorrect, click on the name of the model and change it to your custom model named Python Coding.
This setup enables the Python coding mode, which is now ready to capture your spoken prompts, allowing you to build Python scripts entirely with voice commands.
Step 3: Speak and Code
Let’s write a script to read a CSV file in Python.
Voice Command: “Write code to input a CSV files”
The prompt will be sent directly into Cursor AI, and it will automatically start writing the corresponding Python code. Cursor AI will generate the following Python code using pandas library to read the CSV file:
If you need to make changes, you can use voice commands like:
Voice Command: Load customers.csv file from current directory and for each row, print the customer’s name and email address.
Let’s add a function that generates usernames from the customer’s name and email address:
Voice Command: “Define a function named create_username that takes a person’s name and email address and generates a username with the format: first letter of first name, followed by last name, all lowercase.”
Cursor AI will create the function like this:
You can further refine the function with additional commands, for example:
Voice Command: “Ensure the first and last names are lowercase and use only the first character of the last name.”
Next you can extract the state code from a customer’s address using regular expressions:
Voice Command: “Write a function named get_state_code that extracts the state code from an address string using regular expressions.”
This allows you to easily extract state information from the customer data.
Pro Tips for an Optimized Workflow
Customizing Voice Commands
One of the greatest strengths of using Superwhisper is the ability to customize commands based on your workflow. For example, you can:
- Tailor Commands for Common Tasks: If you often run specific code tests or debugging tasks, create custom voice commands that execute those actions automatically.
- Shorten Commands: Use brief, memorable voice commands to perform frequently used operations.
Additional Customizations on code
One of the best parts of using Cursor AI and Superwhisper is the ability to customize how your code is written:
- Control Imports: If you prefer not to have Cursor automatically import libraries, you can specify that in your commands.
- Custom Naming: You can also control how variables are named to ensure they match your preferred coding style.
Leveraging Cursor AI Macros
Cursor AI allows for macro creation, which can be triggered using Superwhisper voice commands. You can create macros to automate repetitive, time-consuming tasks, like running tests, reformatting code, or checking specific error patterns in your script.
Real-World Applications of Hands-Free Coding
Accessibility for Developers with Physical Challenges
Hands-free coding is revolutionary for developers who have physical limitations. With the power of Cursor AI and Superwhisper, coding becomes inclusive and accessible, helping individuals overcome challenges like limited hand mobility.
Reducing Repetitive Strain Injuries
Voice-driven coding provides an alternative way to develop software without enduring hours of typing. This is a valuable option for developers prone to repetitive strain injuries, carpal tunnel syndrome, or similar issues.
Enhanced Focus During Pair Programming
In pair programming scenarios, hands-free coding allows one programmer to dictate the code while the other reviews or suggests improvements. This keeps both individuals engaged and allows for a more seamless and interactive collaboration.
A Step Towards AGI
The integration of tools like Cursor AI and Superwhisper is a step closer to making Artificial General Intelligence (AGI) possible.
AGI aims to bring human-level understanding to machines, and hands-free coding is a small but significant move in that direction. Combining advanced speech recognition with intelligent code generation, these tools lay the groundwork for more adaptable and generalized AI capabilities.
Using Cursor AI and Superwhisper together means you can write and edit Python scripts just by speaking. You don’t need to type anything, which makes it faster, reduces strain and is particularly useful if you have accessibility needs.
The examples above show how easy it is to code, edit, and troubleshoot using voice commands. With Cursor AI and Superwhisper, you can transform how you approach coding, making it a more enjoyable and productive experience.