Managing Streamlit Apps
PostHogOfficialPublished by PostHog
- Skill
- Workflow
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a comprehensive interface for creating, deploying, and maintaining Streamlit applications hosted in PostHog sandboxes. It covers the entire operational lifecycle, including initial deployment, source code management, sandbox control, and versioning. The skill ensures that developers can programmatically handle app configurations, update codebases through precise edits, and troubleshoot deployment issues, all while adhering to PostHog's security and data access models.
What it does
- Create and configure new Streamlit applications with custom CPU and memory settings.
- Deploy source code and associated assets to create versioned application releases.
- Manage sandbox states by starting, stopping, and monitoring application health.
- Perform granular code updates using edit-based patching to maintain version integrity.
- Retrieve and manage application versions, including rolling back to previous states.
- Provide direct access links for sharing applications with authorized project members.
When to use it
- When you need to deploy a new data dashboard or Streamlit app to a PostHog project.
- When you need to update existing application code or modify resource allocations.
- When an application is not running and requires a status check or a restart.
- When you need to share a specific application URL with team members.
- When you need to roll back an application to a previously stable version.
Advantages
- Enables programmatic control over the entire Streamlit app lifecycle.
- Supports safe code updates through version-controlled patching.
- Provides clear visibility into application status and error logs.
- Integrates directly with PostHog's authentication and data access permissions.
Usage examples
- “Create a new Streamlit app named Sales Dashboard with 1GB of memory.”
- The agent initializes the app in PostHog, sets the requested resource limits, and provides the URL for the new dashboard.
- “My Streamlit app is showing an error, can you check why?”
- The agent polls the application status, retrieves the last error log, and determines if it is a platform-side issue or a code-related failure.
- “Update the app.py file in my dashboard to change the chart title.”
- The agent reads the current source, applies the specific text replacement, and deploys a new version of the app.
- “Restart my app after the recent code update.”
- The agent triggers the stop and start commands to ensure the sandbox is running the latest version of the code.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/posthog/managing-streamlit-apps/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip managing-streamlit-apps.zip -d .agents/skills
Documentation by PostHog
Managing Streamlit apps
A Streamlit app is a Python data app running in an isolated sandbox inside PostHog.
Each app has immutable versions of its code; one version is active; a sandbox process serves the active version.
The full lifecycle is driven with the streamlit-apps-* MCP tools.
The happy path: create → set source → start → share
streamlit-apps-createwith aname(optionallydescription,cpu_cores0.25–8,memory_gb0.5–16, defaults 0.5 / 1). The app exists but has no code yet.streamlit-apps-set-sourcewith the completeapp.pysource as one string. Extra files ride along in the same call:filesmaps a project-relative path to text (helper modules, CSV, JSON),assetsmaps a path to base64 (Parquet, images). This creates version 1 and activates it. Write the source per thewriting-streamlit-appsskill — in particular useposthog_apps.query()for PostHog data, neverimport posthog.streamlit-apps-start. Returns immediately; the sandbox boots asynchronously.Poll
streamlit-apps-statusuntilstatusisrunning(typically well under a minute). If it lands onerror, readlast_error— see Troubleshooting below.Share the app: the
_posthogUrlreturned by create/get/start (/streamlit-apps/{short_id}) is the app's page in PostHog. That link is what you give humans. Viewers need to be logged into PostHog with access to the project (the app renders in an authenticated iframe; there is no public URL).
Whose data the app reads
The app's queries run with the data access of the person who authored the active version — set the source, and the app reads what you can read. Anyone who can view the app sees those results, so treat publishing an app as sharing that data with everyone on the project. An app whose version author has since been deleted can't start; upload a new version to fix it.
Updating code
Change an existing app in two steps, so you never ship an old copy over newer work:
streamlit-apps-get-sourcereads the active version (orversion_numberfor an older one). It returnsversion_number, a manifest of every file, and the text of each text file. Binary files appear without content. For a large app, passpaths(comma-separated) to read only the files you need.streamlit-apps-edit-sourcewithbase_versionset to thatversion_number.file_editsholds exactold→newtext replacements per file,create_filesadds new text files,delete_filesremoves files. Eacholdmust match exactly once, so include enough surrounding lines to make it unique. Files you do not touch stay byte-for-byte the same in the new version.
If the active version changed after your read, edit-source returns 409 with current_version.
This happens when another session ships a version, or when a person rolls the app back to an older version.
Read current_version again and redo your edits on it.
Do not fall back to set-source to force your copy through.
Keep streamlit-apps-set-source for a new app or a full rewrite.
It replaces every file, so pass files and assets again too; a version holds only what that call carried.
Both tools create the next version and activate it.
A running sandbox is stopped so it can't keep serving stale code — call streamlit-apps-start afterwards to serve the new version.
Versions are immutable, but not permanent: streamlit-apps-versions lists the newest 50, and non-active versions older than 30 days are deleted along with their code.
There is no rollback tool: to roll back, read the old version with streamlit-apps-get-source and set its files again with set-source.
Binary assets are not inlined there, so a rollback of an app with assets also needs a saved copy of those files.
Stopping, idling, and deleting
streamlit-apps-stopstops the sandbox; code and versions are untouched. Starting again later is cheap.Idle sandboxes are stopped automatically after a period of no activity — a stopped app is normal, not an error. Start it again when needed.
streamlit-apps-deletestops any sandbox and soft-deletes the app. Confirm with the user before deleting anything you didn't create in this conversation.
Troubleshooting
status: errorwithlast_error: "Start failed: ..."— the sandbox failed to provision or boot. Retrystreamlit-apps-startonce; if it persists, surfacelast_errorto the user (provisioning failures are usually platform-side, not app-side).Tool calls return 403 "Streamlit apps is not available." — the
streamlit-appsfeature flag is off for this organization. This is a rollout gate, not an error you can fix; tell the user.App runs but a query inside it fails — that's an app-code concern; see
writing-streamlit-apps(bridge limits: 30s execution, 256 MB memory per query).App shows old code after set-source — you skipped step "start after set-source"; the sandbox was stopped and needs a start.
Renaming and resizing
streamlit-apps-update changes an app's name, description, cpu_cores (0.25–8), or memory_gb (0.5–16); only the fields you pass change.
New sizing applies the next time the sandbox starts, so stop + start after resizing a running app.
Defaults (0.5 CPU / 1 GB) fit typical dashboard apps.
Raise memory_gb only when the app itself holds large DataFrames in memory — the 256 MB HogQL bridge query cap is server-side and does NOT change with sandbox sizing, so bigger sandboxes don't fix failing queries.
Files
- ATTRIBUTION.mdAdded by AutoGineer865 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md5.9 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "managing-streamlit-apps", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: a5d30e775d092e16e198f7b582f1f66dac2cee45
Published by: PostHog (https://github.com/PostHog)
Publisher: PostHog (https://github.com/PostHog)
Licence: MIT License (https://github.com/PostHog/skills/blob/a5d30e775d092e16e198f7b582f1f66dac2cee45/LICENSE)
Licence evidence: repository licence LICENSE
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- PostHog
- Publisher
- PostHog (Official)
- Source
- PostHog/skills · skills/omnibus/managing-streamlit-apps · commit a5d30e7
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by PostHog.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download managing-streamlit-apps.zip