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!