Skip to main content

jtool 🧃

jtool is a tool for humans and LLM agents to interact with Juypyter notebooks and servers.

Features:

  • jtool enables any operation in the Jupyter GUI to be performed using a jtool cli command
  • jtool enables LLM agents to read, write, and analyze jupyter notebooks (see usage by LLM agents)
  • jtool enables notebook-specific grep to search through notebooks' code, outputs, and markdown
  • jtool enables easy memory usage tracking of each Jupyter server, notebook, and variable

Installation

jtool is built in Rust but can be installed via cargo, uv, or pip

cargo install jtool
uv tool install jtool
pip install jtool

Alternatively, can just use uvx run jtool to run jtool without worrying about whether it has been installed.

Example Usage

# List Jupyter servers
jtool servers

# Execute notebook cells
jtool execute-cells notebook.ipynb

# Read cells
jtool read-cells notebook.ipynb 0:5

# Edit cells
jtool edit-cell notebook.ipynb 3 --content "print('hello')"

# Show help
jtool --help

Usage by LLM Agents

jtool is designed with LLM usage in mind

Compared to MCP-based solutions, CLI tools like jtool are more token-efficient, more composable, and have lower operational complexity. jtool is also fast and robust thanks to being written in rust.

Token Efficiency

  • --max-output-lines N - prevents output explosion from large cell outputs
  • --fields - selective field extraction (only get what you need)
  • --inputs-only / --outputs-only - filter noise
  • --compact modes for summaries

Composability

  • CLI tools are much more composable than MCP servers
  • calls to jtool can be chained together in scripts or complex bash calls

Code Search and Understanding

  • jtool grep <regex>: finds code patterns across notebooks
  • jtool errors: print failures without re-execution
  • jtool imports: discover dependencies
  • summary - get quick notebook overview

Safe Execution Controls

  • --timeout SECONDS - prevent infinite loops
  • --max-output-lines - limit output size
  • Cell-level granularity (execute specific cells, not whole notebook)
  • --stream for real-time feedback

Documentation for LLM's

  • See agents/AGENTS.md for a general prompt for teaching LLM agents to use jtool.
  • See agents/claude_skills for usage of jtool documented as Claude skills.
  • See agents/prompts for example prompts for using jtool.

Syntax

jtool can use special syntax to reference servers, notebooks, and cells.

Server References

Reference servers by full URL or port:

http://localhost:8888    # Full URL
8888                     # Port only (implies localhost)

Notebook References

Multiple ways to reference notebooks:

path/to/notebook.ipynb   # Full path with .ipynb
path/to/notebook         # Path without .ipynb extension
notebook                 # Notebook name only (searches current directory)
8888:notebook            # Server:notebook (by port)
8888:path/to/notebook    # Server:path (by port)
@                        # Most recently used/modified notebook

Cell References

Reference cells by index (0-based) or execution count:

# Single cell
3                        # Cell at index 3
_5                       # Cell with execution count 5

# Cell ranges (inclusive)
:                        # All cells
:5                       # From start to index 5
10:                      # From index 10 to end
3:8                      # From index 3 to 8
-3:                      # Last 3 cells to end
:-5                      # From start to 5th from end
-10:-5                   # From 10th from end to 5th from end

# Execution count ranges
_1:_10                   # From execution count 1 to 10
_5:                      # From execution count 5 onwards
:_20                     # Up to execution count 20

Common Options

Many commands support these options for output control:

--json                    # Output as JSON
--csv                     # Output as CSV
--fields field1,field2    # Select specific fields
--head N                  # Limit to first N items
--max-output-lines N      # Limit cell output lines
--inputs-only             # Show only cell inputs
--outputs-only            # Show only cell outputs
--compact                 # Compact summary format

Command Reference

Server Management

  • servers - List all running Jupyter servers
  • add-server - Add manual server configuration
  • kernels - List running kernels
  • sessions - List active sessions
  • read-config - Read server configuration
  • edit-config - Edit server configuration

Execution

  • execute-cells - Execute notebook cells
  • execute-code - Execute code in a kernel
  • kill - Kill a Jupyter server
  • restart - Restart a kernel
  • interrupt - Interrupt a running kernel

Inspection

  • read-cells - Read cells from notebook
  • info - Show notebook info
  • summary - Show comprehensive summary
  • errors - Display error tracebacks

Editing

  • edit-cell - Edit cell content
  • insert-cell - Insert new cell
  • delete-cells - Delete cells
  • reorder-cells - Move cells
  • transfer-cells - Copy/move between notebooks
  • clear-output - Clear cell outputs

Metadata

Release files for jtool 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for jtool 0.2.0
File Interpreter ABI Platform
jtool-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
jtool-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
jtool-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 14.9 MB

Release files / jtool-0.2.0-py3-none-win_amd64.whl

Download URL jtool-0.2.0-py3-none-win_amd64.whl
Size 4.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a5e31cbdb330cf45e8d56999a582140b85ea5a1d3525a1ecabdda94f51f0fbf2
BLAKE2b-256 checksum
How to use checksums
93a0cbc0c52e10e48af0a1ecebec4b98a477e673f8d1e4ca2c2486f0574ba5b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.1

Release files / jtool-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL jtool-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f1af6b34a3f96a3e401f7d6244b6cd7193977eeef005a6d866c6b762248c3a31
BLAKE2b-256 checksum
How to use checksums
6c01a15f3e37c9ee8f79721bf2889ece31a6be3cefc95ac56fe33214a605d9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.1

Release files / jtool-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL jtool-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 4.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a3913915131bc747a69508ac6039276fdddfd77f5e32b5c50ff37778d1fe84d1
BLAKE2b-256 checksum
How to use checksums
21b2f2ae0c4103a4807eb6cb5eaff03c95d9fc67fa9d37acce810521b7019ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.1

Security for jtool 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page