skillfed

pyrepl

A library for building flexible command line interfaces

pyrepl v0.11.5 1.1M downloads/30d#4,404 on PyPI5
Permissive license MIT X11 style Active released

What it is and what it does

pyrepl is a readline replacement written entirely in Python, designed to provide a more interactive command-line editing experience than the standard readline library. It offers multi-line editing, incremental history search, completion with option display, and a substantial set of emacs-mode keybindings. The package includes no global state, allowing multiple independent readers to coexist without history interference, and is built to integrate into application event loops without hogging control.

The library ships with a `pythoni` script that provides an enhanced Python top-level REPL. It has been actively developed since 2010 and is currently maintained, supporting Python 3.8 through 3.12 across Windows and POSIX systems.

Use it for:

  • Building custom Python REPLs or interactive shells with readline-like editing and history
  • Integrating line-editing capabilities into CLI applications without external readline dependencies
  • Creating multi-line command editors with emacs keybindings in pure Python environments
  • Running Python interactively with enhanced editing via the included pythoni script
  • Embedding multiple independent command readers in a single application

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyrepl is a pure-Python readline-like library that provides interactive command-line editing with history, completion, and emacs-mode keybindings for building flexible CLI interfaces.

Yes, if you need readline-like editing in a pure-Python CLI tool or REPL. Low install friction, no dependencies, permissive license, and active maintenance make it a straightforward choice. The lack of external system dependencies is a significant advantage for portability. Not necessary if you are satisfied with standard readline or if you need features the fact sheet does not document.

Install

pyrepl on PyPI

pip

pip install pyrepl

uv

uv add pyrepl

poetry

poetry add pyrepl

Installing pyrepl

Before you install

Low friction install with no runtime dependencies. Actively maintained as of 2026-08-02, with recent release activity. Supports Python 3.8 through 3.12.

License in practice

MIT X11 style permissive license allows use in most projects without significant restriction.

Quickstart

pip install pyrepl

from pyrepl.console import InteractiveConsole
console = InteractiveConsole()
console.interact()

Requires Python 3.8 or newer.

Verify before relying

  • Exact scope of readline emacs-mode keybindings supported (description says 'fairly large subset' but does not enumerate)
  • Whether the package integrates into existing event loops or requires its own control flow
  • Performance characteristics with large histories or completion datasets

Package facts

License MIT X11 style (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 12 days since the last release
Last repo commit
First released
Downloads 1,076,274/month — #4,404 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyrepl-0.11.5-py3-none-any.whl

Keywords: readline, shell

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Utilities

Tags

readline alternative pythoninteractive command line editingpython repl with historyterminal input libraryemacs keybindings clicommand completion pythonline editing pure python
cli-interactionrepl-enhancement

More Utilities packages