| title | Notebook Command |
|---|---|
| sidebarTitle | notebook |
| description | Open a Jupyter notebook with the current codebase loaded |
| icon | book |
| iconType | solid |
The notebook command launches a Jupyter Lab instance with a pre-configured notebook for exploring your codebase.
codegen notebook [--background]--background: Run Jupyter Lab in the background (default: false)
By default, Jupyter Lab runs in the foreground, making it easy to stop with Ctrl+C. Use --background if you want to run it in the background.
This will:
- Create a Python virtual environment in
.codegen/.venvif it doesn't exist - Install required packages (codegen and jupyterlab)
- Create a starter notebook in
.codegen/jupyter/tmp.ipynb - Launch Jupyter Lab with the notebook open
The notebook comes pre-configured with:
from codegen import Codebase
# Initialize codebase
codebase = Codebase('../../')After running codegen notebook, your repository will have this structure:
.codegen/
├── .venv/ # Virtual environment for this project
├── jupyter/ # Jupyter notebooks
│ └── tmp.ipynb # Pre-configured notebook
└── config.toml # Project configuration
# Run Jupyter in the foreground (default)
codegen notebook
# Run Jupyter in the background
codegen notebook --background
# Initialize a new repository and launch notebook
codegen init && codegen notebook