Developing and Debugging JitAI Applications With VSCode or PyCharm
This guide walks you through setting up a local development and debugging environment using the desktop version of JitAI for efficient application development.
🛠️ Environment setup
Ensure you have completed the basic installation and configuration. If not yet installed, refer to the Download and Installation guide.
JitAI supports multiple mainstream IDEs for local development and debugging. Choose the one that best suits your workflow:
- Visual Studio Code: A lightweight editor with a rich Python extension ecosystem
- PyCharm: A professional Python IDE with powerful debugging and refactoring capabilities
⚙️ IDE debug configuration
Visual Studio Code
Opening the project
Open the JitNode directory from your JitAI installation directory in VSCode:
/Applications/Jit.app/Contents/Resources/app.asar.unpacked/JitNode
C:\Program Files\jit\resources\app.asar.unpacked\JitNode
Creating the debug configuration file
Create a .vscode/launch.json file in the project root directory:
If the .vscode directory does not exist, create it first.
- 🍎 macOS / Linux
- 🪟 Windows
{
"version": "0.2.0",
"configurations": [
{
"name": "JitNode Debug",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/system/jitDebugger.py",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"pythonPath": "${workspaceFolder}/system/bin/python/bin/python3",
"justMyCode": true,
"env": {
"PYTHONPATH": "${workspaceFolder}/system/bin/python/lib/python3.12/site-packages"
},
"stopOnEntry": false,
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "JitNode Debug",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/system/jitDebugger.py",
"console": "integratedTerminal",
"pythonPath": "${workspaceFolder}/system/bin/python/python.exe",
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}/system/bin/python/Lib/site-packages"
},
"stopOnEntry": false,
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
}
]
}
Starting the debugger
- Click the Run and Debug icon in the sidebar
- Select the "JitNode Debug" configuration
- Click the green run button to start debugging
PyCharm
Opening the project
Open the JitNode directory from your JitAI installation directory in PyCharm:
/Applications/Jit.app/Contents/Resources/app.asar.unpacked/JitNode
C:\Program Files\jit\resources\app.asar.unpacked\JitNode
Configuring the system interpreter
Before creating a run configuration, add JitNode's Python interpreter to the system interpreter list:
-
Open interpreter settings:
- Menu:
File→Settings...(Windows/Linux) orPyCharm→Settings(macOS) - Left navigation:
Project→Python Interpreter
- Menu:
-
Add new interpreter:
- Click the gear icon in the top right →
Add Interpreter, then selectAdd Local Interpreter - Select
System Interpreter - Click the
...browse button
- Click the gear icon in the top right →
-
Select JitNode Python interpreter:
- 🍎 macOS / Linux
- 🪟 Windows
Interpreter path: [project path]/system/bin/python/bin/python3
Interpreter path: [project path]\system\bin\python\python.exe
- Apply configuration:
- Click
OKto confirm the interpreter path - Wait for PyCharm to index and configure the environment
- Click
ApplyandOKto save the settings
- Click
After successful addition, you should see JitNode's Python version information in the interpreter list. If errors appear, verify that the path is correct.
Creating the run configuration
-
Open run configuration:
- Menu:
Run→Edit Configurations... - Or click the run configuration dropdown in the top right →
Edit Configurations...
- Menu:
-
Add new configuration:
- Click
+→ SelectPython
- Click
-
Configure parameters:
- 🍎 macOS / Linux
- 🪟 Windows
Name: JitNode Debug
Script path: [project path]/system/jitDebugger.py
Parameters: (leave empty)
Python interpreter: [project path]/system/bin/python/bin/python3
Working directory: [project path]
Environment variables:
PYTHONPATH=[project path]/system/bin/python/lib/python3.12/site-packages
Name: JitNode Debug
Script path: [project path]\system\jitDebugger.py
Parameters: (leave empty)
Python interpreter: [project path]\system\bin\python\python.exe
Working directory: [project path]
Environment variables:
PYTHONPATH=[project path]\system\bin\python\Lib\site-packages
Starting the debugger
- Click
OKto save the configuration - Select the "JitNode Debug" configuration
- Click the green run button or press
Shift+F10to start
Ensure that you select the JitNode interpreter you just added in the "Python interpreter" field of the run configuration, not the system's default Python.
📝 Configuration overview
- Debug entry point: Always use the
system/jitDebugger.pyfile - Python interpreter: Use JitNode's built-in Python environment
- Working directory: Set to the JitNode project root directory
- Environment variables: Configure
PYTHONPATHto point to JitNode's Python environment
After completing the above configuration, you're ready to begin local development and debugging!