Skip to main content

jupyter-aiterminal

AI Terminal for JupyterLab. Mixed AI and Command cells in a notebook-like workspace, saved as .agentnb files, powered by the DeepSeek Harness (DSH) Agent Client Protocol (ACP) runtime.

What it does

  • AI cells run an autonomous AI Agent powered by DSH over the Agent Client Protocol (ACP v1) on the Jupyter server. The agent reads, writes, and edits files, runs shell commands in the workspace, and renders streaming Markdown responses with collapsable execution traces.
  • Command cells run non-interactive bash with a persistent working directory and streaming output.
  • In-cell shell execution: type !<command> (e.g. !git status, !ls -lh) in any cell to run shell commands directly without switching modes.
  • Isolated execution counters: each notebook document tracks its own execution count starting from [1]:, completely isolated across tabs and documents.
  • New workspaces appear in the file browser as Untitled.agentnb. Content autosaves continuously. Closing the tab closes the document; a full Jupyter refresh restores opened tabs.

It does not include a classic SSH terminal or interactive TUI (vim / ssh / full-screen apps).

Engine

AI cells use DeepSeek Harness (DSH) through ACP v1 over stdio. The extension ships its own stdlib-only ACP transport and pins the runtime wheel deepseek-harness-runtime-bin==0.2.1rc2.

  • No Python SDK facade is required.
  • No Node.js, npm, or globally installed dsh CLI is required on the server.
  • No external packages are installed automatically at runtime.

Security warning

Command cells and AI tool calls can run arbitrary commands as the Jupyter server user. Treat access to this extension as equivalent to a shell on that machine.

  • DSH tool calls run with automated server-side approvals within the workspace sandbox, and all actions, file modifications, and bash outputs are logged transparently within the execution record inside the cell.
  • Command cells execute arbitrary bash in a long-lived shell as the user running Jupyter.
  • Any user who can authenticate to the Jupyter server can reach this extension.

Recommended precautions:

  • Never expose a Jupyter server running this extension to an untrusted network, and do not share an instance with people you would not give a shell.
  • Run it inside a container or VM you are willing to lose.
  • Keep Jupyter's own authentication enabled.

Requirements

  • Python 3.10+
  • JupyterLab 4.5 (4.x <5)
  • An OpenAI-compatible or Anthropic-compatible API

The pinned runtime wheel contains platform executables:

  • Linux: manylinux with glibc >= 2.28 (x86_64 and aarch64).
  • macOS: >= 14 (arm64 and x86_64).

The same release also publishes a Windows amd64 wheel, but Windows is not part of the current validation scope.

Install

Install the prebuilt wheel from PyPI; end users do not need Node.js or npm:

pip install jupyter-aiterminal

Restart JupyterLab (sudo systemctl restart jupyter.service for the usual single-service deployment) after install.

Uninstall:

pip uninstall jupyter-aiterminal

Older versions were installed through the Pi/Claude agent path and could require a separately installed CLI. That is no longer the current install path; see the migration note below.

Configure

Open Settings → AI Terminal and set:

Setting Meaning
API Protocol openai-completions or anthropic-messages
Base URL API root for that protocol, e.g. https://api.anthropic.com or an OpenAI-compatible relay
Model Model id passed to the provider
API Token API key / token

Base URL, Model, and API Token are required; API Protocol defaults to anthropic-messages for settings written before the selector existed. Empty required values produce a config error that points back to Settings. Changing them takes effect the next time you open AI Terminal (a new WebSocket).

The token is stored in JupyterLab user settings on the server (~/.jupyter/lab/user-settings/jupyter-aiterminal/) and is visible in the Settings UI. Do not commit that file or put a real token in a command line, log, or README.

Sessions and old workspaces

  • A DSH ACP session is durable and independent of the runtime process. Resuming a saved session id restores the conversation; restarting the runtime process does not erase the session.
  • If a saved session cannot be resumed, the extension reports the saved context as unavailable and does not silently replace it with a fresh session. Starting a new context is an explicit user action.
  • Workspaces created by older Pi/Claude-era builds still open and keep their visible cells and history. Their old agent session ids are not resumable through DSH, so they start without a linked runtime context. A bounded read-only history bridge is the intended migration path, but that migration is not released or fully verified in this branch.

Use

  1. Create an AI Terminal workspace with either entry point:
    • Open the Launcher → Other → AI Terminal to create it in the current file-browser directory.
    • In the left file browser, right-click a folder and choose AI Terminal to create it inside that folder. Right-clicking a file or blank listing space creates it in the current directory.
  2. A collision-safe Untitled.agentnb file is created and opened automatically.
  3. Type in a cell:
    • For AI Agent tasks: type your prompt or question in plain language.
    • For Shell commands: type !<command> (e.g., !pytest or !ls -lh) directly in the cell, or double-click the prompt / use the toolbar dropdown to explicitly switch to Command mode.
    • The cell input area expands dynamically to fit multiline input.
  4. Run with Shift+Enter (run and advance) or Ctrl/Cmd+Enter (run in place).
  5. Review results:
    • Execution records can be expanded/collapsed without jumping your viewport.
    • Select text in a cell to display a floating copy button; standard shortcuts (Cmd/Ctrl+C, Cmd/Ctrl+V) work as expected. In command mode, dd deletes the cell.

Command cells share one bash session per tab, so cd persists. AI cells use the server-side DSH runtime with full workspace awareness.

Deploy

  • The change is limited to the Jupyter server process (jupyter.service in the usual deployment); restart it after installing the new wheel.
  • Back up .agentnb workspaces and the server-side Jupyter settings before upgrading, and keep the previous wheel so rollback is a reinstall plus settings restore.
  • Do not put API tokens or other secrets in deployment scripts, unit files, logs, or documentation. The target host does not need this README to run the extension.

Develop

jlpm install
jlpm lint         # ESLint and Prettier check
jlpm typecheck    # TypeScript compiler check
jlpm test         # Jest frontend unit tests
pytest            # Python backend tests
python -m build   # Build distribution packages

License

BSD-3-Clause

Metadata

Release files for jupyter-aiterminal 0.8.1

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

Source distribution (sdist)

Source distribution for jupyter-aiterminal 0.8.1
File Size Uploaded Provenance Actions
jupyter_aiterminal-0.8.1.tar.gz 597.6 kB With provenance Details for jupyter_aiterminal-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-aiterminal 0.8.1
File Interpreter ABI Platform Actions
jupyter_aiterminal-0.8.1-py3-none-any.whl Python 3 none any Details for jupyter_aiterminal-0.8.1-py3-none-any.whl

Total release size: 728.0 kB

Release files / jupyter_aiterminal-0.8.1.tar.gz

Download URL jupyter_aiterminal-0.8.1.tar.gz
Size 597.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ca2e12c8d6067bebff4ca99e5a545ab880af302a9eee5cecb46c9e0cab027b37
BLAKE2b-256 checksum
How to use checksums
0328af22ad17db058504f6c6ced73b930527521f3f91a13d34bfde4ac574cf90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / jupyter_aiterminal-0.8.1-py3-none-any.whl

Download URL jupyter_aiterminal-0.8.1-py3-none-any.whl
Size 130.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4244c6b965e3a8394b91beda863f4ed68e873439fcb1e28aa50c34894bbbf60a
BLAKE2b-256 checksum
How to use checksums
ad728418ec41cf04f571515bf22c293f5ff4a27027ab579c91d317a7bca353c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for jupyter-aiterminal 0.8.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jupyter_aiterminal-0.8.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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