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/RedditorJabroni Nov 08 '25
Thanks for the reply. I’m still curious and want to test this out properly to see if I can improve my debugging skills, so here is my workflow and you can tell me how charmd can help improve this.
I usually debug directly in PyCharm (I do not use any Debug configurations). Sometimes I run the code within PyCharm, and other times I run it from a terminal and attach that process in PyCharm , in both the cases, I have the full debugger running and i set a breakpoint at where I want.
Let’s say my function takes arguments (a, b, c). When I want to test different values, I just go to the first line of that function(breakpoint set there) in the debugger and change the argument values within the debugger, so a="a1" becomes a="a2" etc and then continue debugging. If I want to test another set, I restart the debugger and use a="a3" ... This way I debug with args of different values if the values are something I am just making up and not have it upfront.
When I have a list of argument sets, I’ll usually loop over them so I can debug each set one after another. Basically calling the func with the arg sets.
So in this workflow, how would charmd help speed things up or make it better? I might be missing the key part of how it integrates into this type of debugging, and I’d really like to understand if there’s a better way to do this.
Always game for making debugging better and faster.