run-shiny

Launches Shiny apps in Posit Workbench VS Code sessions with correct proxy URL configuration.

13|6|Updated Aug 9, 2026
One-click install
npx skills add https://github.com/kaipingyang/CDISC_training --skill run-shiny-kaipingyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-shiny
Source: https://github.com/kaipingyang/CDISC_training/tree/main/.claude/skills/run-shiny
Command: npx skills add https://github.com/kaipingyang/CDISC_training --skill run-shiny-kaipingyang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running a Shiny app inside a Posit Workbench VS Code session fails when accessed through the reverse proxy, because the default 127.0.0.1 binding and malformed proxy URLs (with %5C encoding) make the app unreachable. This Skill automates the environment checks and launch commands needed to expose the app correctly. ## Core Features & Use Cases - Environment Detection: Automatically locates app.R by absolute path, detects renv projects, and identifies whether the project is an R package requiring devtools::load_all(). - Correct Launch Commands: Generates the right shiny::runApp() invocation with host = "0.0.0.0" and a chosen port, combined with setwd() and renv::load() when needed. - Proxy URL Guidance: Walks through VS Code PORTS panel forwarding and fixes the %5C backslash encoding issue, recommending Simple Browser for in-editor preview. - Use Case: A clinical data scientist developing a Shiny app in a Posit Workbench session asks to run the app, and receives a ready-to-paste R command plus the correct external URL such as https://host/u/<workspace>/proxy/8080/. ## Quick Start Run my Shiny app in this Posit Workbench session and give me the working proxy URL to open it.

Frequently Asked Questions about run-shiny

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Shiny app in Posit Workbench VS Code?

Call shiny::runApp() with host = "0.0.0.0" and an explicit port, then forward that port via the VS Code PORTS panel. Open the app with Simple Browser or fix the proxy URL by replacing %5C with forward slashes.

Why does my Shiny app show page not found in Posit Workbench?

The app is likely bound to the default 127.0.0.1, which the reverse proxy cannot reach. Restart it with host = "0.0.0.0" so the forwarded port exposes the app externally.

Should I use renv::activate() or renv::load() before running a Shiny app?

Use setwd() followed by renv::load() in the same session, because renv::activate() requires an R session restart to take effect. renv::load() mounts the project library immediately without restarting.

How do I load an R package project before running its Shiny app?

Use devtools::load_all() with the project's absolute path, which always loads the latest code from disk. This avoids repeated R CMD INSTALL cycles and ensures installed-but-stale versions are not used.

Why does the forwarded port URL contain %5C and return 404?

The PORTS panel sometimes encodes backslashes as %5C in the generated proxy URL, which the server rejects. Replace every %5C with a forward slash, or right-click the port and choose Open in Simple Browser to bypass the issue.