Skip to main content Switch to mobile version dex-agents-pydantic-ai-cli 0.6.2 The dex-agents-pydantic-ai command: a durable Pydantic AI agent in your terminal
pip install dex-agents-pydantic-ai-cli==0.6.2 Copy PIP instructions
dex-agents-pydantic-ai-cli provides the dex-agents-pydantic-ai command. It runs a Pydantic AI agent as a durable Dex agent session and chats with it in your terminal. The shared CLI core, dex-agents-cli-core, starts or reuses dexcli dev, connects the connectors MCP server, and runs the Worker. This package only builds the agent with the Pydantic AI adapter.
The command needs Python 3.11 or later and a key for the model's provider:
export OPENAI_API_KEY=sk-... uvx --from dex-agents-pydantic-ai-cli dex-agents-pydantic-ai The first run asks the init questions and writes ~/.dex/agents/pydantic-ai.yaml. Then type a message at the > prompt. Approve or reject tool calls with y or n, and press Ctrl-D to exit. The session stays in Dex, and the command prints the --resume line that continues it. See the CLI core README for every subcommand and option, and agents/cli for the configuration file.
The provider reads its key from its standard environment variable. The package includes the OpenAI, Anthropic, and Google providers:
The command never prints or stores a key.
The model defaults to openai:gpt-5.2; set model in the file or pass --model to change it. It is a Pydantic AI model name, : , such as anthropic:claude-opus-5-5. A session's settings may change the model and the instructions; each model call uses the values of its turn. The session setting reasoning_effort may be low, medium, or high; each model call sends it as Pydantic AI's thinking model setting, which each provider maps to its own option. Without it, the model's default applies. In the terminal UI, /effort sets it, and /model also offers openai:gpt-5.2, openai:gpt-5-mini, anthropic:claude-opus-5-5, and anthropic:claude-sonnet-5-5. system_prompt replaces the default instructions. The pydantic_ai section has no options yet, and any key in it is a configuration error.
The agent's tools are the CLI core's: its local tool source and the connector tools of the connectors MCP server. Every call runs in its own Dex tool Step, with the CLI core's policy. Reads run at once, file writes and shell commands wait for approval unless the shell allow list has the command, and the file tools stay in the workspace. See the CLI core README for the local tools.
/image attaches an image file to the next message. The command gives the Pydantic AI adapter the media store of media.store, so the model sees the image, and images that tools return go to the same store. See Images.
Develop with uv 0.12.2. The package resolves dex-agents, the adapter, the CLI core, and the shared test support from this repository by path. uv.lock pins pydantic-ai-slim to the version the adapter's lock pins, and ci.sh checks that. ci.sh installs the locked dependencies, checks lint and types, and runs the tests against a private dexcli dev:
cd agents/cli/python/pydantic-ai DEXCLI=/path/to/dexcli ./ci.sh The tests run the command in a pseudo-terminal with a private home and an allow-listed environment. Pydantic AI's OpenAI provider calls the scripted Responses API of ../testing; a refused proxy stops any other request. A fake connectors MCP server serves a connector read and write. The tests cover a chat turn and --resume, read_file without approval and write_file after approval, a connector read and an approved connector write that runs once, session settings that change the model, and a key in the pydantic_ai section. A reasoning_effort in the session settings reaches the next Responses API request, and an undeclared one fails the turn. They also cover a system_prompt set in the session settings, which reaches the next model request, and a rejected file write and connector write, which never run.
LicenseRef-Sustainable-Use-1.0 View SPDX License List
Development Status 3 - Alpha
Programming Language Python :: 3
Release files for dex-agents-pydantic-ai-cli 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 17.7 kB
Release files / dex_agents_pydantic_ai_cli-0.6.2.tar.gz
Security for dex-agents-pydantic-ai-cli 0.6.2
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.
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.
Release history Release notifications | RSS feed
Dec 1, 2026 2 release files No provenance
Nov 30, 2026 2 release files No provenance
Nov 23, 2026 2 release files No provenance
Nov 22, 2026 2 release files No provenance
Nov 19, 2026 2 release files No provenance
Nov 16, 2026 2 release files No provenance
Nov 15, 2026 2 release files No provenance
Nov 14, 2026 2 release files No provenance
Nov 13, 2026 2 release files No provenance
Nov 12, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




