Getting a local development environment running for Desktop Assistant is straightforward. The project is a pure-Python application, so all you need is a compatible Python interpreter, a virtual environment, and the platform-specific dependency list provided in the repository. This page covers every step from forking the repo to running Jarvis in text-input (debug) mode so you can iterate on new commands without needing a microphone attached.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Harsha200105/DesktopAssistant/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure the following are available on your machine:- Python 3.9 or later — the project’s Ubuntu dependency snapshot was built against Python 3.9.7. Run
python --versionto check. - git — needed to clone the repository and manage branches.
- A microphone (optional for development) — Jarvis uses
speech_recognitionto capture voice input. Setdebug = Trueinconfig.inito bypass the microphone entirely and type commands instead.
On Ubuntu you also need the system libraries
portaudio19-dev and espeak before installing Python packages. The commands are shown in the setup steps below.Setting Up Your Environment
Fork and clone the repository
Fork the repository on GitHub, then clone your fork:If you plan to contribute back, also add the upstream remote:
Create and activate a virtual environment
Create a virtual environment inside the repository root so your system Python is not affected:Then activate it for your platform:Your terminal prompt will be prefixed with
- Windows
- Ubuntu / macOS
(venv) once the environment is active.Install dependencies
The repository ships two requirements files — one per platform.The Windows requirements file installs:
- Windows
- Ubuntu
Copy config.ini into the src/ directory
Jarvis reads Open Key settings:
config.ini from the current working directory at startup (see the os.path.isfile('./config.ini') check at the bottom of src/Jarvis2_4windows.py). Copy the template and then edit it:src/config.ini and fill in your details:| Key | Description |
|---|---|
master | The name Jarvis uses when greeting you |
search_engine | Google, Bing, DuckDuckGo, or Youtube |
debug | Set to True to use keyboard input instead of the microphone |
musicpath | Absolute path to a folder containing music1.mp3 … music4.mp3 |
voice | Male or Female — maps to the first or second pyttsx3 voice |
rate | Speech rate in words per minute (default 150) |
volume | Volume as a percentage from 0 to 100 (default 100) |
energy_threshold | Microphone sensitivity; increase if Jarvis misses commands |
Run Jarvis in debug mode
With The Tkinter window will open and you will see the
debug = True in config.ini, Jarvis replaces the microphone with a simple input() prompt. This lets you test command routing without any audio hardware.Command |--> prompt in your terminal. Type a command (e.g., wikipedia Python programming language) and press Enter to see Jarvis respond.Code Structure
The project is intentionally lean — most logic lives in four Python files undersrc/:
src/Jarvis2_4windows.py
Windows entry point. Contains
run() (reads config.ini, builds the take_command closure, calls wish_me) and main() (holds the phrases dict for zero-argument commands and the execute_the_command_said_by_user inner function for argument-bearing commands). This is the file to edit when wiring in a new command.src/Jarvis2.py
Ubuntu entry point. A self-contained monolithic script that inlines
speak, wish_me, take_command, and execute_the_command_said_by_user without importing from commands.py or actions.py. Useful as a reference for the expected end-to-end behaviour of each command.src/commands.py
Individual command handlers. Each public function handles one user intent. Current handlers:
command_wikipedia, command_whatsup, command_open, command_search, command_mail, command_nothing, command_hello, command_bye, command_play_music, command_pause_music, command_stop_music, command_unpause_music. New commands belong here.src/actions.py
Core utilities shared across commands. Exports:
speak(text), wish_me(master), open_url(url), search(search_query, search_engine), search_engine_selector(config), change_rate(query, take_command), change_voice(query, take_command), change_volume(query, take_command), set_gui_speak(command). The pyttsx3 engine is initialised at module level.src/gui.py
Tkinter GUI. Builds a 700 × 500 root window with a scrollable
Listbox that displays assistant responses and a Speak button wired to execute_the_command_said_by_user. The speak(text) function here appends Assistant: <text> to the listbox. mainloop is the Tkinter root.mainloop function re-exported for use by the entry points.Requirements&COC/
Config and dependency files.
config.ini — settings template; requirements.txt — Windows pip dependencies; ubuntu_requirements.txt — Ubuntu pip dependencies (also documents required system packages as comments).Adding a New Command
Adding a voice command to Jarvis takes two steps: implement the handler incommands.py, then register the trigger phrase in Jarvis2_4windows.py.
1. Implement the handler in src/commands.py
Follow the existing pattern. Zero-argument commands accept no parameters; commands that need user input accept query and/or take_command (and optionally debug):
actions.py:
2. Wire the phrase in src/Jarvis2_4windows.py
Zero-argument commands — add an entry to the phrases dict inside execute_the_command_said_by_user:
elif branch in the same function, after the phrases loop:
Linting
The CI pipeline (.github/workflows/lint_python.yml) runs flake8 with a maximum line length of 88 and maximum cyclomatic complexity of 19. Run the same check locally before pushing:
bandit for security issues, isort for import ordering, codespell for typos, and mypy for type checking. Install them all at once: