Skip to main content

PyKernel

PyPI version Python License: MIT Downloads

A hackable Python REPL with first-class command support.

Install

pip install pykernel-cli

Usage

pykernel
# or
python -m pykernel

Type /help to see all commands.

Flags

Flag Description
--ver Show the current version
--dev Show plugin dev reference

Commands

Core

Command Aliases Description
/help [command] /? /commands List commands or describe one
/exit /quit /q Exit the kernel
/clear /cls Clear the terminal screen
/history [n] /hist Show last n inputs (default 20)
/run <file.py> Execute a Python file
/reset Clear the execution namespace
/alias <new> <target> Create an alias for a command

Inspector

Command Aliases Description
/vars /ls /env List variables in the namespace
/who <name> Show detailed info about a variable
/doc <name> Show a variable's docstring
/source <name> /src Show source code of a function/class
/del <name> /rm Delete a variable
/timeit <expr> Time an expression

Shell

Command Aliases Description
/sh <cmd> /! Run a shell command (output stored in _out)
/cd <path> Change working directory
/pwd Print working directory
/ls [path] List directory contents

Snippets

Command Description
/snip save <name> Save last history entry as a snippet
/snip write <name> Create a snippet in $EDITOR
/snip list List all saved snippets
/snip show <name> Print a snippet's source
/snip run <name> Execute a snippet
/snip edit <name> Edit a snippet in $EDITOR
/snip del <name> Delete a snippet

Plugins

Drop a .py file with a register(registry) function into ~/.pykernel/plugins/:

def register(reg):
    @reg.command("hello", help="Say hello")
    def cmd_hello(ctx, *args):
        ctx.print("Hello!")

Plugins load automatically on startup. Run pykernel --dev for the full plugin dev reference.

Config

Edit ~/.pykernel/config.toml:

[kernel]
prompt = ">>> "
theme  = "dark"   # dark | light | none

Troubleshooting

pykernel command not found on Windows?

Run with python -m pykernel instead, or add Python's Scripts folder to your PATH: C:\Users\<you>\AppData\Local\Programs\Python\Python3xx\Scripts\

License

MIT

Metadata

Release files for pykernel-cli 1.4.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 pykernel-cli 1.4.0
File Size Uploaded Provenance Actions
pykernel_cli-1.4.0.tar.gz 19.2 kB Without provenance Details for pykernel_cli-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pykernel-cli 1.4.0
File Interpreter ABI Platform Actions
pykernel_cli-1.4.0-py3-none-any.whl Python 3 none any Details for pykernel_cli-1.4.0-py3-none-any.whl

Total release size: 40.8 kB

Release files / pykernel_cli-1.4.0.tar.gz

Download URL pykernel_cli-1.4.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
92bd267eb3ff6a957fa6b7040b08b358cbe557f25c44dc91457edafdba560296
BLAKE2b-256 checksum
How to use checksums
ca3ae6006ebadeb1d3ef758d79d8da1eb0525d1a9c6d4e2911906f7c13a2e33e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / pykernel_cli-1.4.0-py3-none-any.whl

Download URL pykernel_cli-1.4.0-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
428e4f3772fa2490138b8945a94ed2a67576952283973b2c73855b9748bb9fd6
BLAKE2b-256 checksum
How to use checksums
ba4bedec5d4a334dbe6a0a020e71404cfc2930f1a02970c0d3ea26138919f9d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for pykernel-cli 1.4.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.

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