ITERUN exposes the same operations through several integration surfaces. All paths go through IterunService (interfaces/service.py).
| Surface | Entry | Use case |
|---|---|---|
| REST | python -m web.app → http://localhost:8000 |
HTTP clients, CI, remote SDK |
| CLI | iterun generate, iterun plan, … |
Shell, examples |
| SDK | from sdk import IterunClient |
Python apps (local or remote) |
| MCP | iterun-mcp |
LLM agents (Cursor, Claude Desktop) |
| Pipeline | run_pipeline() |
Full prompt → verify flow |
| Registry | iterun registry |
Service/artifact catalog |
| Runtime | --runtime pactown |
markpact + pactown (RUNTIME.md) |
Discover surfaces at runtime:
curl http://localhost:8000/api/interfacesOpenAPI docs: http://localhost:8000/docs
| Method | Path | Description |
|---|---|---|
GET |
/api/health |
Liveness probe |
GET |
/api/interfaces |
List surfaces, endpoints, MCP tools |
GET |
/api/schema |
JSON Schema for intent DSL |
| Method | Path | Description |
|---|---|---|
POST |
/api/intents/validate-yaml |
Validate YAML (is_stack in response) |
POST |
/api/intents/parse |
Parse DSL → store intent |
POST |
/api/intents/plan-yaml |
Plan from YAML (STACK → compose) |
POST |
/api/intents/generate |
LLM → YAML only |
| Method | Path | Description |
|---|---|---|
POST |
/api/pipeline/run |
generate → plan → execute? → verify? |
POST |
/api/intents/generate-and-run |
Alias for /api/pipeline/run |
Request body (POST /api/pipeline/run):
{
"prompt": "Create a shop API with gateway and users service",
"output_dir": "generated",
"execute": false,
"verify": false,
"max_iterations": 5,
"max_verify_iterations": 3,
"model": null
}| Method | Path | Description |
|---|---|---|
GET |
/api/intents |
List intents |
GET |
/api/intents/{id} |
Get intent |
DELETE |
/api/intents/{id} |
Delete |
POST |
/api/intents/{id}/plan |
Plan stored intent (compose_yaml for STACK) |
POST |
/api/intents/{id}/execute |
Run Docker / compose |
GET |
/api/containers/{id}/logs |
Container logs |
from sdk import IterunClient
# Local (in-process)
client = IterunClient()
client.health()
client.interfaces()
client.validate(open("iterun.yaml").read())
client.generate("Create a ping API")
client.run_pipeline("…", output_dir="generated", execute=True, verify=True)
client.plan_yaml(open("iterun.yaml").read(), output_dir="generated")
# Remote REST server
remote = IterunClient(base_url="http://localhost:8000")
remote.run_pipeline("Create API", execute=False)Install: pip install -e ".[mcp]"
iterun-mcp
# or: python -m iterun_mcp.server| Tool | Description |
|---|---|
iterun_interfaces |
List surfaces and endpoints |
iterun_schema |
JSON Schema for DSL |
iterun_validate_intent |
Validate YAML |
iterun_parse_yaml |
Parse to IR JSON |
iterun_plan_yaml |
Dry-run plan (+ optional output_dir) |
iterun_generate_intent |
LLM → YAML |
iterun_run_pipeline |
Full pipeline (execute, verify) |
iterun_run_intent |
Deprecated alias (no verify) |
{
"mcpServers": {
"iterun": {
"command": "iterun-mcp",
"cwd": "/path/to/iterun"
}
}
}Pełna dokumentacja: REGISTRY.md
| Method | Path | Description |
|---|---|---|
GET |
/api/registry?workspace=generated |
Odczyt iterun.registry.json |
POST |
/api/registry/refresh |
Odśwież rejestr + Backstage + OTel |
GET |
/api/registry/list |
Lista workspace’ów (pattern) |
CLI: iterun registry -o generated/
STACK intents use the same API. Responses include:
is_stack: truecompose_yaml—docker-compose.yamlcontentservice_artifacts— per-service Dockerfiles and metadata
Example: plan a stack via REST:
curl -X POST http://localhost:8000/api/intents/plan-yaml \
-H 'Content-Type: application/json' \
-d '{"content": "'"$(cat examples/17-stack-shop-gateway/iterun.yaml)"'", "output_dir": "generated"}'Zawsze z katalogu głównego repozytorium (~/github/wronai/iterun), nie z examples/*.
cd ~/github/wronai/iterun && source venv/bin/activate
pip install -e ".[ai]"
# REST (jeśli :8000 zajęty — użyj innego portu, np. 8800)
uvicorn web.app:app --reload --port 8800
curl http://localhost:8800/api/interfaces
# MCP (osobny terminal, ten sam katalog iterun/)
pip install -e ".[mcp]"
iterun-mcp
# lub: python -m iterun_mcp.server
# SDK (w pythonie / python -c, nie wklejaj do bash)
python -c "
from sdk import IterunClient
c = IterunClient()
print(c.interfaces())
"| Błąd | Przyczyna | Rozwiązanie |
|---|---|---|
address already in use :8000 |
port zajęty (np. inna usługa) | --port 8800 |
does not appear to be a Python project przy pip install -e ".[mcp]" |
jesteś w examples/… |
cd ~/github/wronai/iterun |
cannot import name 'main' from 'mcp.server' |
stary konflikt nazw (naprawiony) | pip install -e ".[mcp]" + moduł iterun_mcp |
from sdk import w bash |
Python wklejony do shella | python -c "..." lub python REPL |