CLI — the terminal assistant¶
pydantic-deep ships its own terminal assistant: a Claude-Code-style coding agent that lives in your shell, built entirely on top of the framework you've been reading about. You run it, it reads and writes your files, runs commands, searches the web, and remembers what you're working on — all inside a rich terminal UI.
It's the same agent you'd assemble with create_deep_agent, wrapped in a Textual interface. Nothing is hidden behind a SaaS — it's your code, your machine, your model key.
Install¶
That's the whole install. The [cli] extra pulls in Textual and the TUI dependencies on top of the core framework.
One-line installer
On macOS and Linux you can also run the bootstrap script, which installs uv for you and then does the rest:
Launch it¶
From any project directory, just run the command:
The TUI opens. On the very first run it walks you through picking a provider and pasting an API key, then drops you into a chat. Type a request and watch the agent plan, edit files, and run commands live:
$ pydantic-deep
> Find the failing test in tests/ and fix it
● write_todos drafting a 3-step plan
● grep "def test_" in tests/
● read tests/test_auth.py
● edit src/auth.py (+4 -1)
● execute pytest tests/test_auth.py ✓ 1 passed
Fixed it — the token check compared against the wrong field. Tests pass now.
You wrote one sentence. The planning, file editing, shell, and todo tracking all came for free — that's the framework doing the work.
A tour of what it can do¶
The assistant is the framework's features made interactive. Here's the breadth:
- Chat with a real coding agent. Streaming responses, visible thinking, and every tool call rendered as it happens — no black box.
- Files and the shell. It reads, writes, edits, globs, and greps your project, and runs commands. Prefix a line with
!to run a shell command yourself (!git status), or drop@path/to/fileinto a prompt to pull a file's contents in. - Subagents. Big tasks get delegated to focused subagents that work in parallel, so the main thread stays clean.
- MCP servers. Connect Model Context Protocol servers to give the agent extra tools — databases, issue trackers, your own services. Manage them live with
/mcp. - Sessions. Every conversation auto-saves. Resume any past one with
/load, or manage them from the shell withpydantic-deep threads list. - Live forking. Branch a running conversation to explore an alternative without losing your place —
/forkto split,/mergeto bring a branch back. See Sessions, forking & MCP. - Attachments and images. Paste an image straight into the prompt (
/paste) and the agent sees it; reference files with@. - Themes. Four built-in color themes — switch instantly with
/theme ocean. - Memory that sticks.
/remembersaves a note across sessions;/improvereviews past sessions and proposes updates to yourAGENTS.md,SOUL.md, andMEMORY.md.
Headless too
The same agent runs non-interactively for CI, benchmarks, and scripts:
It prints the result (and usage stats with --json) and exits. See
Commands for the full run reference.
Sandbox it
Add --sandbox docker to either pydantic-deep or pydantic-deep run and
every file and shell operation executes inside a container, with your
working directory mounted at /workspace. Your code stays on disk; side
effects stay in the box.
Configure it¶
Settings live in .pydantic-deep/config.toml in your project, and the same
defaults drive both the TUI and headless runs. Change them from inside the app
with /settings, or from the shell:
API keys are stored separately in .pydantic-deep/keys.toml, managed through
the /provider command. CLI flags always win over config-file values. Full
details in Settings & themes.
Recap¶
- The CLI is a self-hosted, Claude-Code-style terminal assistant built on the very same
create_deep_agentyou've been learning. - Install it with
pip install "pydantic-deep[cli]"and launch it by runningpydantic-deepin any project. - Out of the box it gives you streaming chat, file and shell tools, subagents, MCP, auto-saved sessions, live forking, image attachments, themes, and persistent memory.
- Run the same agent headlessly with
pydantic-deep run, and sandbox either mode with--sandbox docker.
Where to go next¶
- Install & first run → — set up a provider and send your first message.
- Commands → — every slash command and
pydantic-deepsubcommand. - Keys & input → — shortcuts,
@files,!shell, multiline input. - Settings & themes → — config file, providers, themes, sandboxing.
- Sessions, forking & MCP → — save, resume, branch, and extend the assistant.