nbs2ctx is a minimal CLI for turning a directory of notebooks (e.g. an NBDev project) into context for an LLM. For example, from the root dir of this github repo we could run:
nbs_to_ctx nbs ctx.xml
This will create a file ctx.xml with the contents of all the notebooks in the nbs folder.
<documents>
<document index="1">
<source>00_core.ipynb</source>
<document_content>
# nbs_to_ctx
> Turning Jupyter notebooks into LLM-ready context
```python
#| default_exp core
... and so on, with the full contents of the notebook
Install latest from the GitHub repository:
$ pip install git+https://github.com/AnswerDotAI/nbs2ctx.gitor from pypi
$ pip install nbs2ctx