Interactive REPL Sessions
The kagglex exec command allows you to connect directly to an active Kaggle notebook session via the Kaggle Jupyter Proxy server. This provides an interactive workflow with sub-second feedback without waiting for batch kernel scheduling.
Getting the Proxy URL
- Open or start an interactive notebook in your browser at kaggle.com/code.
- Start the notebook session and select your desired accelerator (e.g. GPU T4 x2).
- In the top navigation menu, click Run -> Kaggle Jupyter Server -> Copy URL.
- The copied URL will look similar to:
Setting the Proxy URL
You can pass the URL explicitly using --url, configure it via the KAGGLE_JUPYTER_URL environment variable, or define it in configuration files.
export KAGGLE_JUPYTER_URL="https://kkb-production.jupyter-proxy.kaggle.net/k/12345678/abcdef123456?token=kaggle-proxy-token"
Testing Connection
Verify connectivity to the running Kaggle kernel:
GPU Profiling
Query GPU device count, device names, and VRAM memory utilization directly:
Executing Python Code Remotely
Inline Code Snippets
Run arbitrary Python code directly from your terminal:
Local Python Files
Execute a local script on the remote GPU session without staging or uploading a new kernel:
Bidirectional File Transfers
You can transfer files directly to and from /kaggle/working in the live notebook environment: