Skip to main content

IPython as your terminal shell

Project description

ipyshell

IPython as your terminal shell — via terminal profile swap, not chsh.

ipyshell launches a pre-configured IPython session where PATH executables work without ! (via %rehashx), shell commands get pty-backed output recorded in history (via ipythonng, with inline images and rich markdown), and an optional AI assistant sees your recent cells — sources, outputs, images, and errors.

Install & run

pip install ipyshell
ipyshell

First run creates an IPython profile named shell and installs a startup script into it; ipyshell then execs ipython --profile=shell (extra args are passed through). Point your terminal emulator's profile at ipyshell to use it as your shell.

AI assistant

Configure in ~/.config/ipyshell/ipyshell.conf (created with commented defaults on first run):

[DEFAULT]
model = claude-sonnet-5         # any fastllm model id
# system_prompt =               # optional; overrides the built-in default
api_key_env = ANTHROPIC_API_KEY # NAME of the env var holding your key
ctx_cells = 10                  # cells of history sent as context

Then lines starting with : become chat requests with your recent shell activity as context:

[~] secret = 'banana'
[~] :what's the secret?

You can also call await chat('...') directly. The model gets a safe_python tool (sandboxed via safepyrun, with safecmd's bash available) so it can run code in your session — with guardrails against destructive operations.

If no model or API key is configured, AI is skipped silently and everything else still works.

Development

pip install -e .[dev]
python -m pytest

Version lives in ipyshell/__init__.py as __version__; releases use fastship:

ship-bump --part 2   # patch / 1 minor / 0 major
ship-gh              # GitHub release from closed issues
ship-pypi            # build + upload to PyPI

Project details


Download files

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

Source Distribution

ipyshell-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

ipyshell-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file ipyshell-0.1.0.tar.gz.

File metadata

  • Download URL: ipyshell-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ipyshell-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c80aba1845b28451f13ef6f5ae136ac3d0faf9c7466eac2f81187ead9f31108
MD5 fc00569e9dba09b73821bb07f530dfd9
BLAKE2b-256 12ec6323be423024b16eac28bd0797e1237e69ef6044bc775dcada77cd830e58

See more details on using hashes here.

File details

Details for the file ipyshell-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ipyshell-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ipyshell-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7593a9bd20ae7b406778e5f622e8fc16103ba0abaabd9ae2e7d86090618fb18
MD5 89cf553503432ee5dc1bf017f066751c
BLAKE2b-256 8c7b9f6ced4c8fecdaf53b32f68a3e06e3a71225ef14edf817d2d1ce50da1671

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