streamlit-coco
Built (with love) by Devoteam Snowflake Partner, brings Snowflake CoCo into Streamlit — streaming agent UI, tool cards you can actually read, and approval gates that fit governed data apps.
You own the page. CoCo owns the session. panel() streams the transcript; copilot_rail() wraps that panel as a right-rail Copilot for multipage apps. Your app keeps st.chat_input, metrics, and forms. Approvals pause Write / Edit / Bash / SQL until someone clicks Approve once, Always allow, or Deny.
Alpha
0.1.6— API may still move. Star / watch the repo if you plan to ship on it.
Repo: github.com/lletourmy/streamlit-coco (temporary PyPI source) · Dev: streamlit-coco-dev
SDK docs: Cortex Code Agent SDK
Why this package
| Without streamlit-coco | With streamlit-coco |
|---|---|
| Wire CoCo yourself across Streamlit reruns | Session + fragment polling that keeps streaming |
| Raw JSON tool dumps | Meaningful cards (Glob, Grep, Read, Write, SQL, AskUser…) |
| Hope the agent behaves | require_approval_for + HITL UI |
| Chat-only demos | Structured callbacks into your own widgets |
Also: headless query() for scripts and CI, plus a legacy all-in-one chat() if you want built-in input.
Install
uv add "streamlit-coco[sdk]"
# or: pip install "streamlit-coco[sdk]"
From a clone (editable + tests):
make install
Prerequisites
- Python 3.10+ · Streamlit ≥ 1.53
- CoCo CLI on
PATH(cortex --version) - Authenticated Snowflake connection (
~/.snowflake/connections.tomlor equivalent) cortex-code-agent-sdk(pulled in by thesdk/devextras)
Full local setup: doc/deployment/local.md (CLI install, Snowflake connections.toml, running examples, troubleshooting).
API: doc/api.md.
Quickstart
Preferred pattern — you own the input; CoCo owns the session and output:
import streamlit as st
import streamlit_coco as st_coco
opts = st_coco.CocoOptions(
connection="analytics",
cwd=".",
allowed_tools=["Read", "Glob", "Grep"],
require_approval_for=["Edit", "Write", "Bash"],
)
env = st_coco.check_environment(connection=opts.connection)
if not st_coco.render_start_gate(opts, session_key="copilot", env=env):
st.stop()
session = st_coco.get_or_create_session(opts, key="copilot")
st_coco.panel(session=session, warm_up=True, show_status=True, run_every=0.25)
st_coco.chat_input_bar(session, placeholder="Ask CoCo…")
allowed_tools— may auto-run (enforced in Python when approvals are configured)require_approval_for— pause for Approve once · Always allow · Deny
Legacy all-in-one component (built-in input):
st_coco.chat(session=session, key="coco_chat", height=560)
Try the demos
make chat # panel + chat input + tool cards + approvals
make cwd-upload # upload files into agent cwd + chat
make approval # legacy CCv2 chat
make structured # custom structured-output panel
make headless # asyncio query() pipeline
make backlog # Product Backlog Desk (multipage business demo)
make tableau-semantic # Tableau workbooks → semantic view + RAP (screens 1–6)
Exploratory prompts: examples/testdata/prompts.json.
Backlog desk: examples/backlog_desk/README.md.
Tableau → Semantic: examples/tableau_to_semantic/README.md.
File upload: doc/features/file-upload/file-upload.md.
Patterns you’ll use often
Structured output → your widgets
output = st.container()
def render(data: dict, result: st_coco.CocoChatResult) -> None:
with output:
st.dataframe(data.get("selected_features", []))
st_coco.panel(session=session, on_structured_output=render)
Headless (no Streamlit UI)
import asyncio
import streamlit_coco as coco
async def run():
async for event in coco.query("Profile ANALYTICS.CUSTOMERS"):
if event.type == "result":
print(event.structured_output)
asyncio.run(run())
What’s inside
| Capability | Entry points |
|---|---|
| Native panel + approvals | panel(), chat_input_bar(), render_approvals() |
| Copilot rail (right-column Copilot) | copilot_rail(), transcript_view_pills() — doc/features/copilot-rail/ |
| Tool cards & AskUser / plan UI | see doc/features/tools-display/ |
| Session & options | CocoSession, CocoOptions, get_or_create_session |
| Headless events | query() |
| Legacy CCv2 | chat() |
API reference: doc/api.md.
Feature guides + release checklists: doc/features/README.md.
streamlit_coco/ # library (ui, session, permissions, tool cards, …)
examples/ # chat, approval, structured, headless demos
doc/ # PRD, roadmap, feature specs & checklists
tests/
Development
make install # uv sync --extra dev
make check # ruff + unit/smoke (ignores tests/e2e)
make e2e-install # Playwright + Chromium (once)
make e2e # UX e2e vs examples/e2e_ux_harness.py
make test-all # check + e2e + audit
make audit # pip-audit
make format # ruff format + fix
make build # sdist + wheel
make sync-release # copy tree → public clones (see doc/deployment/publish.md)
make help # all targets
CI runs lint, tests, and pip-audit on every PR to main. Full local gate: make test-all (doc/testing.md).
Releases: develop here (streamlit-coco-dev), sync + tag on lletourmy/streamlit-coco → PyPI (guide).
Docs: PRD · API · Roadmap · Training · Deployment · Changelog · AGENTS.md
License
Apache-2.0
Release files for streamlit-coco 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| streamlit_coco-0.1.6.tar.gz | 3.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlit_coco-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.7 MB
Release files / streamlit_coco-0.1.6.tar.gz
| Download URL | streamlit_coco-0.1.6.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e7c4fbe448d75e97cf35c51efdb12ac20fde0a80bf7565ef5ebb97b74794d29
|
|
BLAKE2b-256 checksum How to use checksums |
4f003538f04731d0575f3d4c7ae2c36fad40e6ec8f3f7d5c67ddce3a48256b7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency logRelease files / streamlit_coco-0.1.6-py3-none-any.whl
| Download URL | streamlit_coco-0.1.6-py3-none-any.whl |
|---|---|
| Size | 70.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6bd09ac89e905bf7f45120dbe01dacb226d20c21d3cc9da84faa78e1eb11b92
|
|
BLAKE2b-256 checksum How to use checksums |
a6bf1f8348bbb4330df0723e83f80ed871ef6322c8528a3e96f83e1ce1cfe113
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.
Transparency log