Skip to content

CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.

fix(examples,docs): use uv run --with for example-only deps

xf gong959054d19a51
diff --git a/examples/README.md b/examples/README.md
index 57e1b74..361d508 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -43,8 +43,7 @@ when both are set.
### weather_agent.py
```bash
-pip install httpx
-uv run python examples/weather_agent.py
+uv run --with httpx python examples/weather_agent.py
```
### persistent_chat.py
@@ -104,9 +103,10 @@ Requires: `cubepi[sqlite]`
### postgres_fastapi.py
```bash
-pip install "cubepi[postgres]" fastapi "uvicorn[standard]" sse-starlette
+uv sync --extra postgres
export DATABASE_URL=postgresql://user:pass@localhost/cubepi
-uvicorn examples.postgres_fastapi:app --reload --port 8000
+uv run --with fastapi --with "uvicorn[standard]" --with sse-starlette \
+ uvicorn examples.postgres_fastapi:app --reload --port 8000
curl -N -X POST http://localhost:8000/chat/conv1/messages \
-H "content-type: application/json" \
diff --git a/website/docs/recipes/postgres-fastapi.md b/website/docs/recipes/postgres-fastapi.md
index 0eaee6e..2a26df9 100644
--- a/website/docs/recipes/postgres-fastapi.md
+++ b/website/docs/recipes/postgres-fastapi.md
@@ -254,12 +254,12 @@ A self-contained service template for this recipe is in the repository at
```bash
git clone https://github.com/cubeplexai/cubepi && cd cubepi
uv sync --extra postgres
-pip install fastapi "uvicorn[standard]" sse-starlette
export DATABASE_URL=postgresql://user:pass@localhost/cubepi
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY [+ OPENAI_BASE_URL]
-uvicorn examples.postgres_fastapi:app --reload --port 8000
+uv run --with fastapi --with "uvicorn[standard]" --with sse-starlette \
+ uvicorn examples.postgres_fastapi:app --reload --port 8000
# Test with curl:
curl -N -X POST http://localhost:8000/chat/conv1/messages \
diff --git a/website/docs/recipes/weather-agent.md b/website/docs/recipes/weather-agent.md
index a293a46..fc9c107 100644
--- a/website/docs/recipes/weather-agent.md
+++ b/website/docs/recipes/weather-agent.md
@@ -155,7 +155,7 @@ git clone https://github.com/cubeplexai/cubepi && cd cubepi
uv sync
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY [+ OPENAI_BASE_URL]
-uv run python examples/weather_agent.py
+uv run --with httpx python examples/weather_agent.py
```
## See also
diff --git a/website/versioned_docs/version-0.8/recipes/postgres-fastapi.md b/website/versioned_docs/version-0.8/recipes/postgres-fastapi.md
index 0eaee6e..2a26df9 100644
--- a/website/versioned_docs/version-0.8/recipes/postgres-fastapi.md
+++ b/website/versioned_docs/version-0.8/recipes/postgres-fastapi.md
@@ -254,12 +254,12 @@ A self-contained service template for this recipe is in the repository at
```bash
git clone https://github.com/cubeplexai/cubepi && cd cubepi
uv sync --extra postgres
-pip install fastapi "uvicorn[standard]" sse-starlette
export DATABASE_URL=postgresql://user:pass@localhost/cubepi
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY [+ OPENAI_BASE_URL]
-uvicorn examples.postgres_fastapi:app --reload --port 8000
+uv run --with fastapi --with "uvicorn[standard]" --with sse-starlette \
+ uvicorn examples.postgres_fastapi:app --reload --port 8000
# Test with curl:
curl -N -X POST http://localhost:8000/chat/conv1/messages \
diff --git a/website/versioned_docs/version-0.8/recipes/weather-agent.md b/website/versioned_docs/version-0.8/recipes/weather-agent.md
index a293a46..fc9c107 100644
--- a/website/versioned_docs/version-0.8/recipes/weather-agent.md
+++ b/website/versioned_docs/version-0.8/recipes/weather-agent.md
@@ -155,7 +155,7 @@ git clone https://github.com/cubeplexai/cubepi && cd cubepi
uv sync
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY [+ OPENAI_BASE_URL]
-uv run python examples/weather_agent.py
+uv run --with httpx python examples/weather_agent.py
```
## See also