Steward is a Python CLI harness for running LLMs with a Copilot-style toolset. It is developed primarily against Azure OpenAI but also supports OpenAI-compatible hosts and a local echo provider, and was in itself bootstrapped by a bun version.
- Install:
# From GitHub
pip install git+https://github.com/rcarmo/python-steward.git
# Or clone and install locally (editable)
git clone https://github.com/rcarmo/python-steward.git
cd python-steward
python3 -m pip install -e .- Run (echo provider, default):
python3 -m steward.cli "List files in the workspace"- Run with Azure (set your env vars, options first):
STEWARD_AZURE_OPENAI_ENDPOINT=... \
STEWARD_AZURE_OPENAI_KEY=... \
STEWARD_AZURE_OPENAI_DEPLOYMENT=... \
python3 -m steward.cli --provider azure --model gpt-4o-mini "Read README and summarize"- Optional sandbox (auto mkdir + chdir):
python3 -m steward.cli --sandbox sandbox --provider azure --model gpt-4o-mini "List files"--provider <echo|openai|azure>(default:echounless overridden bySTEWARD_PROVIDERor Makefile wrapper)--model <name>(default:gpt-4o-miniunless overridden bySTEWARD_MODELor Makefile wrapper)--max-steps <n>(default from config)--timeout-ms <n>per LLM call--retries <n>LLM retries--log-json <file>/--no-log-json--quiet(suppress human logs) /--pretty(color logs)--system <file>custom system prompt--sandbox [dir]run inside/create a sandbox directory--session [id]enable session persistence with checkpoints (auto-generates ID if not specified)--instructions <file>load custom coding instructions to inject into system prompt
You can provide your own system prompt via --system; no default file is bundled.
Prefix your prompt with [[PLAN]] to enter plan mode, which instructs the agent to:
- Analyze the codebase and create a structured implementation plan
- Save the plan to the session's
plan.mdfile - Wait for explicit approval before implementing
python3 -m steward.cli --session "[[PLAN]] Add user authentication to the API"Steward can run as an MCP (Model Context Protocol) server over stdio, exposing all tools to MCP-compatible clients:
python3 -m steward.mcp # or: steward-mcpSee docs/protocols.md for configuration examples.
Steward can run as an ACP (Agent Control Protocol) agent over stdio, providing streaming, tool visibility, session management, and more:
python3 -m steward.acp # or: steward-acpSee docs/protocols.md for full ACP feature documentation.
Steward can consume tools from external MCP servers. Configure in .steward/mcp.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": { "GITHUB_TOKEN": "your-token" }
}
}
}Tools: mcp_list_servers, mcp_list_tools, mcp_call
| Tool | Description |
|---|---|
view |
View file contents with line numbers, or list directory entries (2 levels deep). Supports view_range for partial file reads. |
grep |
Ripgrep-style content search with output_mode (content/files_with_matches/count), glob filter, context flags (-A, -B, -C), -i case-insensitive, -n line numbers. |
glob |
Fast file pattern matching (e.g., **/*.ts, *.{js,jsx}). |
create |
Create new file with content; fails if file exists; auto-creates parent directories. |
edit |
String replacement in files; replaces exactly one occurrence of old_str with new_str. |
mkdir |
Create directory with automatic parent directory creation. |
apply_patch |
Apply unified diffs with validation. |
replace_string_in_file / multi_replace_string_in_file |
Alternative string replacement tools. |
| Tool | Description |
|---|---|
bash |
Shell execution with mode (sync/async), initial_wait, detach for persistent processes. Gated by STEWARD_ALLOW_EXECUTE=1. |
write_bash |
Send input to async bash sessions; supports special keys ({enter}, {up}, {down}, etc.). |
read_bash |
Read output from async bash sessions. |
stop_bash |
Terminate async bash sessions. |
list_bash |
List all active async bash sessions. |
| Tool | Description |
|---|---|
update_todo |
Markdown checklist for task tracking; persisted to .steward-todo.md. |
store_memory |
Persist facts about codebase for future tasks; stored in .steward-memory.json. |
list_memories |
Retrieve stored memories with optional filters. |
report_intent |
Report current agent intent for UI status updates. |
ask_user |
Ask user questions with optional multiple choice responses. |
| Tool | Description |
|---|---|
web_fetch |
Fetch URL as markdown or raw HTML; pagination via start_index; max_length cap (default 5000, max 20000). |
web_search |
Web search with LLM synthesis and citations (meta-tool pattern). |
| Tool | Description |
|---|---|
git_status / git_diff / git_commit / git_stash |
Git helpers for workspace/subpaths. |
| Tool | Description |
|---|---|
run_js |
QuickJS sandbox; execute code or load from workspace path; optional function calls with named params and JSON/text output; timeout/output caps; optional allowNetwork fetch helper. |
configure_python_environment / get_python_executable_details / install_python_packages |
Python env info/selection/install helpers. |
| Tool | Description |
|---|---|
list_code_usages |
ripgrep-based symbol finder. |
get_changed_files |
Git status summary grouped by state. |
workspace_summary |
Summarize top-level files/dirs and package metadata if present. |
| Tool | Description |
|---|---|
discover_skills |
Find all SKILL.md files in the workspace. |
load_skill |
Load and parse a SKILL.md file to understand tool/agent capabilities. |
mcp_list_servers |
List configured MCP servers from mcp.json. |
mcp_list_tools |
List available tools from an MCP server. |
mcp_call |
Invoke a tool on an MCP server. |
The default system prompt includes:
- Tone and style guidance (concise, direct responses)
- Parallel tool calling instructions for efficiency
- Tool-specific usage guidance
- Code change rules (minimal modifications, run tests)
- Security and privacy constraints
- Session and plan mode support
- Environment context (CWD, git root)
Custom instructions can be injected via --instructions <file>.
- Echo:
--provider echo(no credentials) - OpenAI-compatible:
--provider openaiwithSTEWARD_OPENAI_API_KEY/OPENAI_API_KEYand optionalSTEWARD_OPENAI_BASE_URL - Azure OpenAI:
--provider azurewithSTEWARD_AZURE_OPENAI_ENDPOINT,STEWARD_AZURE_OPENAI_KEY,STEWARD_AZURE_OPENAI_DEPLOYMENT, optionalSTEWARD_AZURE_OPENAI_API_VERSION(default 2024-10-01-preview)
- Path access is constrained to the current working directory (or sandbox when provided).
- The run loop stops after max steps even if the model keeps calling tools.
bashis gated bySTEWARD_ALLOW_EXECUTE=1and supports allow/deny lists, timeouts, and audit logging.
make install— pip install -e .make test— python -m pytest testsmake scenario— sample run in current workspace (uses provider/model defaults)make inception— sample run inside sandbox/ using--sandbox
- Improve logging ergonomics
- Add MCP support (stdio transport)
- Add interactive shell I/O tools
- Add session management and plan mode
- Add REPL
- Add streaming support (via ACP)
- Add sub-agent orchestration
- Additional provider shims as needed
