Observed since 20 Oct, 23:22 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agent-shell-py
A lightweight abstraction for executing CLI coding agents headlessly
execute, stream, health_check, and
list_models API across every agent; swap the backend without changing consuming code.AgentResponse (raises AgentExecutionError on a failed run),
or async-iterate normalized StreamEvents with optional thinking/reasoning.session_id.cost and output_tokens (reasoning included)
regardless of how each CLI reports them.bash, edit, read, web_search, web_fetch) translated to each CLI's own tool names.asyncio, zero runtime dependencies, Python 3.12+.uv add agent-shell-py
or with pip:
pip install agent-shell-py
The repository includes reusable skills that teach coding agents how to use AgentShell:
invoking-cli-agents — invoke, stream, resume, and restrict CLI agents.delegating-code-review — delegate an independent code review through AgentShell.Install them interactively with the Vercel Skills CLI:
npx skills add ScottRBK/agent-shell
Or install both skills globally for every coding agent supported by AgentShell:
npx skills add ScottRBK/agent-shell --global \
--skill '*' \
--agent claude-code opencode github-copilot codex pi cursor grok \
--yes
Install only the core AgentShell skill with:
npx skills add ScottRBK/agent-shell --skill invoking-cli-agents
The skills provide agent instructions. Install agent-shell-py and the chosen coding-agent CLIs
separately.
from agent_shell.shell import AgentShell
from agent_shell.models.agent import AgentType
shell = AgentShell(agent_type=AgentType.CLAUDE_CODE)
response = await shell.execute(
cwd="/path/to/project",
prompt="Can you tell me about this project?",
allowed_tools=["Read", "Glob", "Grep"],
model="sonnet",
)
print(response.response)
print(f"Cost: ${response.cost:.4f}")
print(f"Output tokens: {response.output_tokens}") # billed output, reasoning included
print(f"Session: {response.session_id}")
# Resume the conversation using the session_id
follow_up = await shell.execute(
cwd="/path/to/project",
prompt="Now refactor the auth module based on your findings",
allowed_tools=["Read", "Edit", "Bash"],
model="sonnet",
session_id=response.session_id,
)
output_tokensis a cost measure: the billed output-token count, which includes reasoning tokens (they are billed at the output rate). It is reported consistently across all adapters.
See more examples for isolation and execution hosts, failure handling, streaming, model discovery, health checks, tool restrictions, MCP servers, packages, and logging.
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
bdist_wheel · 118.84 KB · Python py3
sdist · 779.29 KB · Python source
Observed since 20 Oct, 23:22 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:47e6a0c8eeadbe375c4ffcfa2b67f616a8ed88eb87214e715f87ed7baabc33c9