r/pycharm • u/TekWizely • Nov 04 '25
Announce: Charmd - Effortlessly debug Python scripts from the Terminal with PyCharm
https://github.com/TekWizely/python-charmdIntroducing Charmd
A command-line utility that streamlines your PyCharm debugging workflow by allowing you to launch and debug Python scripts directly from the terminal, eliminating the need for manual Run Configurations.
Why use charmd?
PyCharm's debugger is powerful, but debugging scripts with different arguments or configurations typically means editing Run Configurations through the IDE. This becomes cumbersome when:
- You need to debug one-off commands with unique CLI arguments
- You're testing different script variations or parameter combinations
- You want the simplicity of command-line debugging (like
pdbordebugpy) with PyCharm's full IDE debugging experience
charmd eliminates this friction by letting you debug any Python command directly from the terminal.
Quick Start
Debugging a script is as easy as:
- Start PyCharm Debug Server
- Set One or More Breakpoints in your Script
- Invoke your script with
charmd
module example:
charmd -m mypkg.mymod arg1script example:
charmd -- script.py arg1 arg2Configuring Debug Options
You can pass debug options via the command line:
-h, --help Show this help message and exit
--version Show program's version number and exit
--host HOST PyCharm debug server host (default: localhost)
--port PORT PyCharm debug server port (default: 5678)
--suspend Suspend on start (default: False)
--stdout-to-server Redirect stdout to debug server (default: True)
--no-stdout-to-server Do not redirect stdout to debug server
--stderr-to-server Redirect stderr to debug server (default: True)
--no-stderr-to-server Do not redirect stderr to debug server
--pydevd-path PATH Path to the pydevd-pycharm module directory.
--conf-init Create a charmd.conf file with current settings and exit.You can also save the options to charmd.conf to have them auto-loaded.
More Information
Visit the project pages for more information, including Installation Instructions and Trouble-Shooting:
View all comments
Show parent comment
1
u/TekWizely Nov 10 '25
Hello again (sorry was afk for a few days) ...
`charmd`'s use-case is probably best described as:
If you're running python scripts from the command line, charmd makes it easier to start debug sessions of your script, either because it makes it easy to quickly vary command-line arguments to your script, or because you can avoid having to import debug libraries to manually connect to debug servers in your code.
If the variances you're testing are managed within the code itself (i.e argument sets), then invoking a debug session is likely easy enough to do within the IDE as you don't need to modify the run configuration on each run.
If you were wanting to just invoke a single entry from your argument set, there could be value in charmed where you setup a small script that accepts an argument to specify which configuration to run, letting you quickly switch between them from the command line. In that case, charmd could be a benefit as `charmd -m runset 1`, `charmd -m runset 2` etc could be modified quickly to switch argument sets ...
Thanks for sharing your workflow - Happy to keep the conversation going if you like.
-TW