managing-streamlit-apps
Fungsinya
Skill ini memandu Anda membuat dan menjalankan aplikasi data Streamlit di dalam PostHog, dari versi pertama hingga tautan yang dapat dibagikan. Ditujukan untuk orang yang menginginkan dasbor atau alat interaktif sederhana yang dibangun di atas data PostHog mereka.
Kapan dipakai
- βSaat Anda ingin membuat aplikasi Streamlit yang menampilkan data PostHog.
- βSaat aplikasi Streamlit Anda tidak berjalan dan Anda perlu mencari tahu penyebabnya.
- βSaat Anda ingin memulai, menghentikan, atau membagikan aplikasi kepada tim Anda.
Link skill
https://github.com/PostHog/posthog/blob/master/products/streamlit_apps/skills/managing-streamlit-apps/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat aplikasi Streamlit yang menampilkan pendaftaran mingguan kami dan bagikan tautannya kepada tim saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill membuat aplikasi, mengatur sumber Python-nya, dan memulai sandbox yang menjalankannya. Setelah aplikasi ditampilkan sebagai berjalan, Anda mendapatkan tautan PostHog untuk dibagikan, dan penonton harus sudah login untuk melihatnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
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-si
Pertanyaan umum
Siapa yang dapat membuka aplikasi yang dibagikan?
Penonton harus sudah login ke PostHog untuk melihat aplikasi.
Bagaimana jika aplikasi menampilkan error?
Skill membaca error terakhir aplikasi dan membantu Anda memecahkan masalahnya.
Bisakah saya memilih berapa banyak daya komputasi yang didapat aplikasi?
Bisa. Anda mengatur CPU dan memorinya saat membuat aplikasi, dalam batas yang ditetapkan.
Detail
Deskripsi asli dari pembuat
Create, deploy, and operate Streamlit apps in PostHog via the streamlit-apps MCP tools β create an app, set its source, read and patch its code, start and stop its sandbox, poll status, list versions, delete, and share the app with humans via its PostHog URL. Use when asked to "create a streamlit app", "deploy a data app", "ship a dashboard app", "restart/stop my app", "why is my app not running", or "give me a link to the app".
repo: PostHog/posthog
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6954
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.