Skip to main content

Fast Jupyter notebook management tool (Rust rewrite)

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

jtool-0.2.0-py3-none-win_amd64.whl (4.9 MB view details)

Uploaded Python 3Windows x86-64

jtool-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

jtool-0.2.0-py3-none-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file jtool-0.2.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: jtool-0.2.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.1

File hashes

Hashes for jtool-0.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a5e31cbdb330cf45e8d56999a582140b85ea5a1d3525a1ecabdda94f51f0fbf2
MD5 30f0b7a1ac9df7045cc6495af1af7f53
BLAKE2b-256 93a0cbc0c52e10e48af0a1ecebec4b98a477e673f8d1e4ca2c2486f0574ba5b7

See more details on using hashes here.

File details

Details for the file jtool-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jtool-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1af6b34a3f96a3e401f7d6244b6cd7193977eeef005a6d866c6b762248c3a31
MD5 e71ea1e7d58ed70733d08332305269b4
BLAKE2b-256 6c01a15f3e37c9ee8f79721bf2889ece31a6be3cefc95ac56fe33214a605d9c0

See more details on using hashes here.

File details

Details for the file jtool-0.2.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jtool-0.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3913915131bc747a69508ac6039276fdddfd77f5e32b5c50ff37778d1fe84d1
MD5 7228623989f07ee2a4b046de0ff2f8f4
BLAKE2b-256 21b2f2ae0c4103a4807eb6cb5eaff03c95d9fc67fa9d37acce810521b7019ca2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page