User setup guide: PyCharm AI plugin and ChatGPT subscription
On this page
This guide records the PyCharm AI Assistant / Codex setup that was validated
for the original Dockerized PyCharm environment under docker4pycharm/.
Treat it as historical/reference user setup for that PyCharm MVP. Active
framework development now happens under devcapsule-src/, and current CLI
usage belongs in devcapsule-src/README.md.
Recommended PyCharm plugin
Install the official JetBrains AI Assistant plugin and use Codex from inside JetBrains AI Chat.
Do not start with an arbitrary third-party plugin named “ChatGPT”, “GPT”, or similar. Several third-party plugins exist, but the current supported route for using OpenAI Codex from PyCharm is through JetBrains AI Assistant / JetBrains AI Chat.
As of the documentation checked on 2026-06-18:
- OpenAI documents Codex IDE support for JetBrains IDEs, including PyCharm.
- JetBrains documents Codex as integrated into JetBrains AI Chat starting with JetBrains IDE version 2025.3.
- The JetBrains/OpenAI path supports authentication using a ChatGPT account, an OpenAI API key, or a JetBrains AI subscription.
- ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex according to OpenAI’s Codex IDE documentation.
Before installing
Use a recent PyCharm build. For Codex inside JetBrains AI Chat, prefer PyCharm 2025.3 or newer.
For this Docker project, that means the PyCharm .tar.gz or unpacked PyCharm directory supplied to docker4pycharm/build-image.sh should ideally be PyCharm 2025.3+.
Example rebuild:
cd docker4pycharm
./build-image.sh \
--pycharm /path/to/pycharm-2025.3-or-newer.tar.gz \
--image pycharm-isolated:latest
Then run PyCharm:
./run-pycharm-container.sh \
--project /path/to/this/repository \
--ssh-agent \
--git-identity-from-host
Git identity and GitHub access
For normal development, launch PyCharm with a Git author identity and one explicit remote credential path.
To reuse only the host global Git identity values:
./run-pycharm-container.sh \
--project /path/to/this/repository \
--ssh-agent \
--git-identity-from-host
To set identity explicitly:
./run-pycharm-container.sh \
--project /path/to/this/repository \
--ssh-agent \
--git-user-name "Your Name" \
--git-user-email you@example.com
For GitHub remotes, prefer SSH agent forwarding when your host agent already has a suitable key:
ssh-add -l
./run-pycharm-container.sh \
--project /path/to/this/repository \
--ssh-agent \
--git-identity-from-host
For HTTPS GitHub remotes, pass a token as a temporary secret:
export GITHUB_TOKEN=ghp_...
./run-pycharm-container.sh \
--project /path/to/this/repository \
--git-identity-from-host \
--git-token-env GITHUB_TOKEN
Do not mount host ~/.ssh, ~/.gitconfig, or credential-manager directories
into the IDE container. The launcher passes only the requested identity values,
SSH agent socket, or token secret.
Install JetBrains AI Assistant in PyCharm
Inside the Dockerized PyCharm window:
- Open Settings / Preferences.
- Go to Plugins.
- Open the Marketplace tab.
- Search for AI Assistant.
- Install JetBrains AI Assistant.
- Restart PyCharm if prompted.
Alternative: if the JetBrains AI widget or AI Chat tool window is visible in the IDE, click Let’s Go or Install Plugin and follow the prompts.
Connect it to your ChatGPT subscription
After JetBrains AI Assistant is installed:
- Open the JetBrains AI widget or AI Chat tool window.
- Complete the first-run activation prompts and accept the applicable JetBrains/OpenAI terms if you agree with them.
- In AI Chat, open the model/agent picker.
- Choose Codex.
- When authentication is requested, choose the ChatGPT account option.
- Sign in with the same account that has your active ChatGPT subscription.
- Return to PyCharm and confirm that Codex is available in the AI Chat agent picker.
Use your ChatGPT subscription path first. Use an OpenAI API key only if you intentionally want API-key billing or if the ChatGPT account login flow does not work reliably inside the Dockerized IDE.
Container-specific login notes
Because PyCharm runs inside a container, enable the narrow host-browser bridge for a launch that needs browser-based sign-in:
devcapsule project run --authorize host-browser true
The bridge accepts only absolute HTTP(S) URLs and opens them in the physical host's default browser. It is a run-once host capability available to every process running as the capsule user, so it is not enabled implicitly.
Expected possibilities:
- The plugin may open a login URL through the authorized host browser and allow normal browser sign-in.
- The plugin may offer a copy/paste login URL that you can open in the host browser.
- The localhost callback may fail if the browser opens on the host while the callback listener is inside the container.
If login fails, try these in order:
- Look for a copy link, manual sign-in, or device-code style option in the plugin login window.
- Retry from a freshly started PyCharm container.
- Confirm the container has normal network access.
- As a fallback, use an OpenAI API key authentication path or JetBrains AI subscription path if acceptable.
- Record exactly what failed before changing the Docker launcher.
Do not broaden Docker access casually just to make login work. Browser
bridging is independent of Docker and networking authorization; use the
dedicated host-browser authorization (run-once as above, or persistently
with devcapsule project config authorize host-browser true) rather than
adding a session-bus mount or a general host command bridge.
What to ask the future ChatGPT development agent to do
Once PyCharm is running and JetBrains AI Assistant/Codex is connected, open this repository in the Dockerized IDE and ask the development agent something like:
Read README.md, CURRENT-STATUS.md, index.md, REQUIREMENTS.md, WORKFLOW.md, and devcapsule-src/README.md. Continue the DevCapsule project. Treat devcapsule-src as the active Python distribution project and docker4pycharm as the historical PyCharm reference baseline. Preserve the isolation model: only the selected project, IDE state, IDE plugins, X11 runtime resources, and narrowly scoped credential resources should be mounted. Work from the current task in CURRENT-STATUS.md.
Links to re-check later
Plugin behavior and account/subscription rules can change. Before making major changes to the AI plugin integration, re-check:
- OpenAI Codex IDE extension documentation: https://developers.openai.com/codex/ide
- JetBrains Codex integration announcement: https://blog.jetbrains.com/ai/2026/01/codex-in-jetbrains-ides/
- JetBrains AI Assistant install guide: https://www.jetbrains.com/help/ai-assistant/installation-guide-ai-assistant.html
- JetBrains AI Assistant Marketplace page: https://plugins.jetbrains.com/plugin/22282-jetbrains-ai-assistant