MicBot is a command-line assistant that listens to your voice (offline), converts it to text, matches it to known commands (even approximately), and executes system actions on your computer.
- Offline Speech-to-Text: Uses Vosk for fast, private voice recognition.
- Fuzzy Command Matching: Matches your spoken command to a set of known commands, even if phrased differently.
- System Command Execution: Runs matched commands on your system (Linux, macOS).
- Configurable: Add or edit commands in
config/commands.json
.
- Clone the repository and enter the directory:
git clone <repo-url> cd mic-bot
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Download a Vosk model:
- Download from: https://alphacephei.com/vosk/models
- Unzip and place the model folder as
model/
in the project root.
Run the assistant:
python3 main.py
- Speak a command (e.g., "open browser", "shutdown", "open vscode").
- If your command matches (fuzzily) a key in
config/commands.json
, it will be executed. - Say "stop" to exit.
main.py # Main program loop
recognizer/stt.py # Speech-to-text (Vosk)
matcher/command_mapper.py# Fuzzy command matching
executor/command_runner.py# Command execution
config/commands.json # Your command config
ui/console_ui.py # (For future UI improvements)
Edit config/commands.json
to add or change commands. Example for Linux:
{
"open browser": "xdg-open https://www.google.com",
"shutdown": "shutdown -h now",
"restart": "shutdown -r now",
"lock": "cinnamon-screensaver-command -l",
"open vscode": "code",
"open notepad": "gedit",
"open explorer": "xdg-open .",
"open cmd": "gnome-terminal",
"open powershell": "gnome-terminal"
}
- Python 3.8+
- Linux (tested on Linux Mint Cinnamon, should work on most distributions)
- Python 3.8+
- PortAudio (for sounddevice):
sudo apt-get install portaudio19-dev
MIT