Metadata-Version: 2.4
Name: ipyshell
Version: 0.1.0
Summary: IPython as your terminal shell
Author: ipyshell contributors
License: Apache-2.0
Project-URL: Homepage, https://github.com/AnswerDotAI/ipyshell
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ipython
Requires-Dist: ipythonng
Requires-Dist: kittytgp
Requires-Dist: python-fastllm
Requires-Dist: rich
Requires-Dist: safecmd
Requires-Dist: safepyrun
Requires-Dist: fastcore
Provides-Extra: dev
Requires-Dist: fastship; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# 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](https://github.com/AnswerDotAI/ipythonng), with inline
images and rich markdown), and an optional AI assistant sees your recent cells —
sources, outputs, images, and errors.

## Install & run

```bash
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):

```ini
[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:

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

You can also call `await chat('...')` directly. The model gets a `safe_python`
tool (sandboxed via [safepyrun](https://github.com/AnswerDotAI/safepyrun), with
[safecmd](https://github.com/AnswerDotAI/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

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

Version lives in `ipyshell/__init__.py` as `__version__`; releases use
[fastship](https://github.com/AnswerDotAI/fastship):

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