feat(cli): Add shiny docs command for component and controller documentation lookup with autocomplete - #2466
Draft
karangattu wants to merge 7 commits into
Draft
feat(cli): Add shiny docs command for component and controller documentation lookup with autocomplete#2466karangattu wants to merge 7 commits into
karangattu wants to merge 7 commits into
Conversation
…ntation lookup with autocomplete
…er word replacement
karangattu
marked this pull request as draft
August 23, 2026 02:17
…prefix, and fuzzy matching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds the
shiny docsCLI command and theshiny-docsAgent Skill to inspect signatures, types, parameters, and docstrings directly from the terminal for Shiny functions, classes, Playwright controllers, and methods.Key Capabilities & Features
1. UI Components & Functions (Implied
shiny.prefix)You don't need to type
shiny.ui.value_box—typingui.value_boxis enough becauseshiny.is implied.Output:
2. Playwright Controllers & Methods
Inspect test controller classes along with all their available methods, or inspect a single method directly.
Output:
3. Multiple Lookups with Error-First Output
When requesting multiple items in a single command, any errors are printed first before rendering documentation for the valid items.
Output:
4. Typo & "Did You Mean" Fuzzy Matching Suggestions
If you make a typo or omit a module path,
shiny docsuses fuzzy matching to suggest close matches.5. Explicit Paths Required (No Bare Magic Lookups)
Bare names like
Accordionorvalue_boxwithout module paths are not resolved implicitly. This prevents confusion between UI components (e.g.ui.accordion) and test controllers (e.g.playwright.controller.Accordion).$ shiny docs Accordion # Error: Could not find documentation for 'Accordion'. Did you mean one of: 'playwright.controller.Accordion', 'ui.accordion', 'express.ui.accordion'?6. Machine-Readable JSON Mode (
--json)Pass
--jsonto output structured JSON data containing AST-extracted signatures, parameter lists with type annotations and defaults, return types, and docstrings.Output:
[ { "name": "shiny.ui.card", "signature": "def card(*args: TagChild, full_screen: bool = False, ...):", "type": "function", "return_type": "Tag", "parameters": [ { "name": "*args", "type": "TagChild", "default": null, "kind": "VAR_POSITIONAL" }, { "name": "full_screen", "type": "bool", "default": "False", "kind": "POSITIONAL_OR_KEYWORD" } ], "docstring": "A Bootstrap card component\n\n..." } ]7. Shell Tab Completion & Autocomplete (
--complete)Supports interactive shell tab completion (
bash,zsh,fish) and programmatic query completion with the--completeflag.Output:
8. AST-Based Signature Extraction
Signatures are parsed directly from source files using Python's
astmodule rather than reconstructed runtime representations. This guarantees accurate parameter annotations, positional-only/keyword-only markers, default values, and return types as written in the source.9. Bundled
shiny-docsAgent SkillIncludes a bundled Agent Skill in
shiny/.agents/skills/shiny-docs/SKILL.md(and.claude/skills/shiny-docs/SKILL.md) so coding agents automatically know how to queryshiny docswhen writing Shiny apps or tests.Multi-Model Evaluation: Control vs. Treatment
We tested the impact of the
shiny-docsskill across Gemini 3.7 Flash, GPT-5.6 Luna, and GLM-5.3-Flash comparing a Control group (without docs lookup) and a Treatment group (withshiny docsreference).The Benchmark Task Given to All Models
Benchmark Results: Gemini 3.7 Flash & GPT-5.6 Luna
1. Functional Area Differences
shiny docs)shiny docs)ui.value_box)icon=...,color=...(from R Shiny), causingTypeErrorat startupshowcase=ui.span(...)andtheme="teal"/theme="bg-gradient-blue-purple"render.data_frame)render.data_frame(df, grid=True), causingTypeErrorrender.DataGrid(df, selection_mode="rows").get_value(), causingAttributeErrorin test suites.expect_value()and.expect_title().should_be_open()or.is_open(), causingAttributeError.expect_open(["panel"])and.set(["panel"])@reactive.calcpipeline2. Live Performance, Latency, and Cost
Benchmark Results: GLM-5.3-Flash
1. Live Performance and Cost
shiny docs)shiny docs)2. Internal Chain-of-Thought (Reasoning Analysis)
GLM-5.3-Flash outputs internal reasoning steps in
reasoning_content:"Let me check the shiny docs page... I believe it exists with methods expect_title, expect_value... class ValueBox(UiWithVisibility)..."), exhausting its token budget before completing the code.shiny docs, the model immediately validated the signatures (ui.value_box(showcase=..., theme=...),Accordion.expect_open(),render.DataGrid(selection_mode="rows")) and produced working code without token exhaustion.3. Takeaway
Providing documentation references stops reasoning models from wasting token budgets and time trying to guess missing API parameters.