---
name: write_jupyter_launcher
kind: function
lang: bash
domain: infra
version: "1.0.0"
purity: impure
signature: "write_jupyter_launcher([project_dir: string]) -> string"
description: "Genera un script run-jupyter-lab.sh que lanza Jupyter Lab en modo colaborativo con autodeteccion de puerto y token deshabilitado."
tags: [jupyter, launcher, setup, infra]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
params:
  - name: project_dir
    desc: "directorio del proyecto Jupyter (default: directorio actual)"
output: "ruta del script run-jupyter-lab.sh generado"
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/infra/write_jupyter_launcher.sh"
---

## Ejemplo

```bash
source write_jupyter_launcher.sh
path=$(write_jupyter_launcher /home/lucas/analysis/finanzas)
echo "Launcher creado en: $path"

# Luego en otra terminal:
# ./run-jupyter-lab.sh [puerto]
```

## Notas

El launcher generado:
- Autodetecta un puerto libre (8888-8899)
- Guarda el puerto en `.jupyter-port` para que otros procesos lo lean
- Activa el venv automaticamente
- Lanza Jupyter Lab en modo `--collaborative` (requiere jupyter-collaboration)
- Token y password deshabilitados para acceso local
