Skip to main content

JupyterLab extension that adds AI-powered Explain, Fix, and Generate buttons to notebook cells

Project description

jupyter-vibe-coding

A JupyterLab 4.x extension that adds AI-powered buttons to notebook cells

  • 💡 Explain – when a cell throws an error, click Explain to get a plain-language description of what went wrong, powered by an LLM via OpenAI's API.
  • 🔧 Fix – click Fix to automatically replace the erroneous cell code with an LLM-corrected version.
  • 🪄 Generate Code – a command (jupyter-vibe-coding:generate-code) is contributed to the Cell toolbar via jupyter.lab.toolbars; it opens a prompt dialog and replaces the current code cell with generated code.

Installation

pip install jupyter-vibe-coding

This installs both the Python server extension and the pre-built JupyterLab frontend extension.

You also need an OpenAI API key exported as an environment variable:

export OPENAI_API_KEY=sk-...

Development install

The development install works on Windows, macOS, and Linux without requiring Administrator/Developer Mode privileges.

git clone https://github.com/haesleinhuepf/jupyter-vibe-coding.git
cd jupyter-vibe-coding

# 1. Install JupyterLab and build tools
pip install jupyterlab

# 2. Install JS dependencies
jlpm install

# 3. Build the frontend extension
jlpm run build

# 4. Install the Python package in editable mode
#    This also registers the server extension automatically.
pip install -e ".[test]"

After these steps, start JupyterLab normally:

jupyter lab

Verify both extensions are detected:

jupyter server extension list
jupyter labextension list

You should see jupyter_vibe_coding in the server list and jupyter-vibe-coding in the labextension list.

To pick up TypeScript source changes during development, rebuild and restart:

jlpm run build
jupyter lab

Usage

  1. Start JupyterLab: jupyter lab
  2. Open or create a Python notebook.
  3. Run a cell that contains an error – 💡 Explain and 🔧 Fix buttons appear below the output.
  4. Click 🪄 Generate Code in the Cell toolbar to open the prompt dialog.

Architecture

jupyter-vibe-coding/
├── src/
│   ├── index.ts      # JupyterLab plugin (frontend)
│   └── handler.ts    # Helper for calling the Jupyter server REST API
├── style/
│   └── index.css     # Button styles
├── jupyter_vibe_coding/
│   ├── __init__.py   # Server extension registration
│   ├── handlers.py   # Tornado handlers + LLM helper functions
│   └── tests/
│       └── test_handlers.py
├── package.json
├── tsconfig.json
└── pyproject.toml

API endpoints

Method Path Body Response
POST /jupyter-vibe-coding/explain {ename, evalue, traceback} {explanation}
POST /jupyter-vibe-coding/fix {code, ename, evalue, traceback} {fixed_code}
POST /jupyter-vibe-coding/generate {prompt} {code}

Running the tests

pip install -e ".[test]"
pytest jupyter_vibe_coding/tests/ -v

License

BSD 3-Clause – see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_vibe_coding-0.1.0.tar.gz (148.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_vibe_coding-0.1.0-py3-none-any.whl (70.3 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_vibe_coding-0.1.0.tar.gz.

File metadata

  • Download URL: jupyter_vibe_coding-0.1.0.tar.gz
  • Upload date:
  • Size: 148.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for jupyter_vibe_coding-0.1.0.tar.gz
Algorithm Hash digest
SHA256 702504d2f2172570dc6db287d75b27588554512ed06617cbe164d98df6dbbe96
MD5 0a4b44df82d21788ee0f057c35b44d70
BLAKE2b-256 d6db59132a5ac537615f8e7d3a9f9a63fb6d6a3472487f817e2c50063f178b6d

See more details on using hashes here.

File details

Details for the file jupyter_vibe_coding-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_vibe_coding-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d79e4a4a7a681369d75964a5f6f01646bc3b8ec18b2e7e3bfc8d6120509ee60
MD5 a49ba6491970548b727163f1083af5cb
BLAKE2b-256 74351343a12f73bb8779b8091ecf3ba3896c6f2224ffd7d2701613fa169689c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page