用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Sidiora-Labs/ion-agent --skill jupyter-live-kernel命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | jupyter-live-kernel |
| description | Iterative Python via live Jupyter kernel (hamelnb). |
| version | 1.0.0 |
| author | Ion Agent |
| license | MIT |
| platforms | ["linux","macos","windows"] |
| metadata | {"ion":{"tags":["jupyter","notebook","repl","data-science","exploration","iterative"],"category":"data-science"}} |
Provides a persistent Python REPL backed by a live Jupyter kernel. Variables
and state are maintained between executions. Reach for this instead of
execute_code when you need to accumulate state over time, poke at APIs,
examine DataFrames, or refine complex code iteratively.
| Tool | Use When |
|---|---|
| This skill | Step-by-step exploration, shared state across calls, data science, ML, "try something and inspect" |
execute_code | Single-run scripts that need ion tool access (web_search, file ops). No state retained. |
terminal | Shell commands, builds, installs, git, process management |
Guideline: If a Jupyter notebook would be your natural choice for the task, reach for this skill.
which uv)uv tool install jupyterlabThe hamelnb script lives at:
SCRIPT="$HOME/.agent-skills/hamelnb/skills/jupyter-live-kernel/scripts/jupyter_live_kernel.py"
If you haven't cloned it yet:
git clone https://github.com/hamelsmu/hamelnb.git ~/.agent-skills/hamelnb
First check whether a server is already up:
uv run "$SCRIPT" servers
If none is running, launch one:
jupyter-lab --no-browser --port=8888 --notebook-dir=$HOME/notebooks \
--IdentityProvider.token='' --ServerApp.password='' > /tmp/jupyter.log 2>&1 &
sleep 3
Note: Token and password are disabled so the agent can connect locally. The server runs without a GUI.
When you only need a scratch REPL (no pre-existing notebook), set up a minimal notebook:
mkdir -p ~/notebooks
Then create a bare .ipynb JSON file with a single empty code cell and open a kernel session through the Jupyter REST API:
curl -s -X POST http://127.0.0.1:8888/api/sessions \
-H "Content-Type: application/json" \
-d '{"path":"scratch.ipynb","type":"notebook","name":"scratch.ipynb","kernel":{"name":"python3"}}'
Every command emits structured JSON. Always append --compact to keep token
usage low.
uv run "$SCRIPT" servers --compact
uv run "$SCRIPT" notebooks --compact
uv run "$SCRIPT" execute --path <notebook.ipynb> --code '<python code>' --compact
State is preserved between execute calls. Variables, imports, and objects all persist.
Multi-line snippets work with $'...' quoting:
uv run "$SCRIPT" execute --path scratch.ipynb --code $'import os\nfiles = os.listdir(".")\nprint(f"Found {len(files)} files")' --compact
uv run "$SCRIPT" variables --path <notebook.ipynb> list --compact
uv run "$SCRIPT" variables --path <notebook.ipynb> preview --name <varname> --compact
# View current cells
uv run "$SCRIPT" contents --path <notebook.ipynb> --compact
# Insert a new cell
uv run "$SCRIPT" edit --path <notebook.ipynb> insert \
--at-index <N> --cell-type code --source '<code>' --compact
# Replace cell source (use cell-id from contents output)
uv run "$SCRIPT" edit --path <notebook.ipynb> replace-source \
--cell-id <id> --source '<new code>' --compact
# Delete a cell
uv run "$SCRIPT" edit --path <notebook.ipynb> delete --cell-id <id> --compact
Reserve this for cases where the user explicitly requests a clean run-through, or you need to confirm the notebook executes end-to-end without errors:
uv run "$SCRIPT" restart-run-all --path <notebook.ipynb> --save-outputs --compact
The first execution after server start may time out — the kernel needs a brief window to spin up. A single retry usually resolves it.
The kernel's Python is whatever JupyterLab uses — any extra packages must be installed into that environment. Install dependencies into the JupyterLab tool environment before running code that needs them.
--compact saves a lot of tokens — always include it. Without it, JSON responses can be extremely large.
For pure REPL work, spin up a scratch.ipynb and skip cell editing
entirely. Just call execute over and over.
Flag ordering matters — subcommand flags like --path must appear
BEFORE the sub-subcommand. Example: variables --path nb.ipynb list, not
variables list --path nb.ipynb.
If no session exists yet, you must create one via the REST API (see Setup above). The tool cannot run code without an active kernel session.
Errors come back as JSON with a traceback — inspect the ename and
evalue fields to diagnose the problem.
Occasional websocket timeouts — certain operations may fail on the first attempt, particularly after a kernel restart. Try once more before escalating.
The script defaults to a 30-second timeout per execution. For longer-running
work, pass --timeout 120. Use generous timeouts (60 or higher) for initial
setup or computationally heavy operations.