Skip to main content

JupyterLite Terminal

Github Actions Status lite-badge

A terminal for JupyterLite.

a screenshot showing a terminal running in JupyterLite

Requirements

  • JupyterLite >= 0.8.0, < 0.9.0

Install

To install the extension, execute:

pip install jupyterlite-terminal

You will also need to install the JupyterLite CLI:

python -m pip install jupyterlite-core

Usage

After installing jupyterlite-core and jupyterlite-terminal, create a jupyter-lite.json file with the following content to activate the terminal extension:

{
  "jupyter-lite-schema-version": 0,
  "jupyter-config-data": {
    "terminalsAvailable": true
  }
}

Then build a new JupyterLite site:

jupyter lite build

Running commands programmatically

Besides the interactive terminal, the extension registers JupyterLab commands that run commands in a headless cockle shell: one that captures the output and exit code without opening a terminal widget. These are useful for other extensions or automation that need to run shell commands in JupyterLite.

Command Description
@jupyterlite/terminal:execute-shell Run a command and return its output and exit code
@jupyterlite/terminal:start-shell Start a reusable headless shell
@jupyterlite/terminal:shutdown-shell Shut down a headless shell by name
@jupyterlite/terminal:list-shells List the running headless shells

Run a single command (a throwaway shell is created and disposed automatically):

const result = await app.commands.execute('@jupyterlite/terminal:execute-shell', {
  code: 'echo hello'
});
console.log(result.exitCode); // 0
console.log(result.output); // hello

Pass a shellName to reuse a shell across calls so state such as the working directory persists:

const { shellName } = await app.commands.execute('@jupyterlite/terminal:start-shell');
await app.commands.execute('@jupyterlite/terminal:execute-shell', {
  code: 'cd /drive',
  shellName
});
const result = await app.commands.execute('@jupyterlite/terminal:execute-shell', {
  code: 'pwd',
  shellName
});
console.log(result.output); // /drive

Each command runs as a single cockle pipeline, so |, ; and redirections (>, >>, 2>, <) work, but &&/||, command substitution and $VAR expansion are not supported.

Version compatibility

Each jupyterlite-terminal release is built against a specific version of cockle. If you need to include imports from both jupyterlite-terminal and cockle, such as if you are implementing cockle external commands, you should ensure that you are using the correct version combination.

jupyterlite-terminal cockle jupyterlite-core Release date
1.8.0 1.9.1 >= 0.8, < 0.9 2026-11-20
1.7.1 1.8.0 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-11-02
1.7.0 1.8.0 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-09-29
1.6.2 1.7.1 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-08-10
1.6.1 1.7.0 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-08-05
1.6.0 1.7.0 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-07-17
1.5.1 1.6.0 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-06-25
1.5.0 1.6.0 >= 0.7, < 0.9, != 0.7.4, != 0.7.5 2026-06-24
1.4.1 1.5.1 >= 0.7, < 0.8, != 0.7.4, != 0.7.5 2026-05-14
1.4.0 1.5.0 >= 0.7, < 0.8, != 0.7.4, != 0.7.5 2026-05-06
1.3.1 1.4.1 >= 0.7, < 0.8, != 0.7.4 2026-03-25
1.3.0 1.4.0 >= 0.7, < 0.8 2026-03-02
1.2.0 1.3.0 >= 0.7, < 0.8 2025-12-03
1.1.0 1.2.0 >= 0.6, < 0.8 2025-10-27
1.0.1 1.0.0 >= 0.6, < 0.8 2025-09-03
1.0.0 1.0.0 >= 0.6, < 0.7 2025-08-11
0.2.2 0.1.3 >= 0.6, < 0.7 2025-06-27

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlite_terminal directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

Development deployment

To build a JupyterLite distribution with the extension installed:

cd deploy
python -m pip install -r requirements-deploy.txt
jupyter lite build --contents contents

And serve it either using:

npx static-handler _output/

or:

jupyter lite serve

To enable use of SharedArrayBuffer rather than ServiceWorker for stdin and to access the shared filesytem you will have to configure your server to add the Cross-Origin-Embedder-Policy and Cross-Origin-Opener-Policy headers. Do this using either:

npx static-handler --coi _output/

or:

jupyter lite serve --LiteBuildConfig.extra_http_headers=Cross-Origin-Embedder-Policy=require-corp --LiteBuildConfig.extra_http_headers=Cross-Origin-Opener-Policy=same-origin

To git2cpp clone remote repositories you will need to run a local CORS proxy. The easiest way to do this is to use the one from the ui-tests. In a separate operating system terminal run:

cd ui-tests
jlpm
jlpm serve:cors-proxy

and then in the JupyterLite terminal in your browser set the GIT_CORS_PROXY environment variable and try a git2cpp clone:

export GIT_CORS_PROXY=http://localhost:8881/
git clone https://github.com/jupyterlite/terminal

Building the documentation

The project documentation includes a demo deployment, and is built on every PR so that the changes can be checked manually before merging. To build the documentation and demo locally use:

micromamba create -f docs/environment-docs.yml
micromamba activate terminal-docs
pip install -v .
cd docs
make html

To serve this locally use:

cd _build/html
python -m http.server

Packaging the extension

See RELEASE

Metadata

Release files for jupyterlite-terminal 1.8.0

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

Source distribution (sdist)

Source distribution for jupyterlite-terminal 1.8.0
File Size Uploaded Provenance Actions
jupyterlite_terminal-1.8.0.tar.gz 878.2 kB With provenance Details for jupyterlite_terminal-1.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlite-terminal 1.8.0
File Interpreter ABI Platform Actions
jupyterlite_terminal-1.8.0-py3-none-any.whl Python 3 none any Details for jupyterlite_terminal-1.8.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / jupyterlite_terminal-1.8.0.tar.gz

Download URL jupyterlite_terminal-1.8.0.tar.gz
Size 878.2 kB
Tags Source
SHA-256 checksum
How to use checksums
efa07b0f77330546d6e6f28b66f7d2fb7a13c64e5df533476a614453a28d127f
BLAKE2b-256 checksum
How to use checksums
3ff382209e356aaed77fd2c608ff2d435b56ed47dd13dcd87daf6ae421a2bf69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.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 20, 2026.

Transparency log

Release files / jupyterlite_terminal-1.8.0-py3-none-any.whl

Download URL jupyterlite_terminal-1.8.0-py3-none-any.whl
Size 207.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
610a93fa36bc6c96e72bf0775fef00f2d3d7ca5e01f6850deae36b117e0a620b
BLAKE2b-256 checksum
How to use checksums
37d001a19f9aa565be19b786e505dcb1e558dd195acd1fa98bd9bd5a1d8d47ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.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 20, 2026.

Transparency log

Security for jupyterlite-terminal 1.8.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.

Full provenance

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

Select from 2 files

Attestation for jupyterlite_terminal-1.8.0.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 20, 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.

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files Full 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