openbq-org/openbb/build-workspace-app
Claude Code and agent skill by openbq-org/openbb
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
This guide covers the full lifecycle of building, running, and serving a custom OpenBB Workspace application from an extension project scaffolded by `openbb-cookiecutter`. It assumes the project shell already exists (see the `develop_extension` skill for scaffolding instructions).
Install
npx vskill@latest install openbq-org/openbb/build-workspace-appSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Build and Run OpenBB Workspace Applications
This guide covers the full lifecycle of building, running, and serving a custom OpenBB Workspace application from an extension project scaffolded by openbb-cookiecutter. It assumes the project shell already exists (see the develop_extension skill for scaffolding instructions).
Prerequisites
Ensure the following packages are installed in the active Python environment:
openbb-coreprovides the Router, Provider, OBBject, and Fetcher base classes.openbb-platform-apiprovides theopenbb-apiCLI for serving backends
and auto-generating widgets.json for OpenBB Workspace.
openbb-devtoolsprovidespytest, cassette recording, and QA utilities.
If you also need the Python Interface wrapper (the obb object), install the main package:
Architecture Overview
OpenBB is built on FastAPI and Pydantic. The application has two independent interfaces that share core logic and models:
- Python Interface — wraps installed routers into an
obbPython package
with auto-generated docstrings and function signatures. Requires a build step (openbb-build) to generate static assets.
- REST API — a FastAPI instance with all installed routers available via
HTTP. Import it with from openbb_core.api.rest_api import app or launch with uvicorn openbb_core.api.rest_api:app.
The application is the product of all installed extensions. With just openbb-core there are no routers or endpoints — users compose their own combinations.
Key Classes
| Class | Import | Purpose | |
|---|---|---|---|
Router | openbb_core.app.router | Subclass of fastapi.APIRouter; defines commands | |
OBBject | openbb_core.app.model.obbject | Standard response object with results, provider, warnings, extra | |
Provider | openbb_core.provider.abstract.provider | Registers fetchers for the provider interface | |
Fetcher | openbb_core.provider.abstract.fetcher | TET pipeline: Transform query → Extract data → Transform data | |
QueryParams | openbb_core.provider.abstract.query_params | Base class for input parameters | |
Data | openbb_core.provider.abstract.data | Base class for output data schemas |
Router Extensions (API Endpoints)
Router extensions are the user-facing endpoints that power the REST API, MCP, and Python Interface.
Creating a Router
The top-level API path prefix is determined by the entry point name in pyproject.toml, not the prefix argument. Only use prefix for sub-routers.
Commands appear at /my_app/... in the API and obb.my_app. in Python.
Provider Interface Endpoints
Connect a router command to one or more provider fetchers via the model name:
The four parameters and the OBBject.from_query(Query(**locals())) return are mandatory and must be used exactly as shown.
Basic GET Endpoint
Basic POST Endpoint
Decorator Parameters
@router.command accepts:
model— metamodel name linking to Provider fetchersmethods— list of HTTP methods, typically["GET"]or["POST"]examples— list ofAPIExorPythonExfor docsdeprecated— deprecation noticeno_validate— skip response validation, treat output asAnyopenapi_extra— dictionary for inlinewidget_configormcp_config
Fields of a response model marked Field(json_schema_extra={"exclude_from_api": True}) are dropped from REST API responses and kept in the Python Interface, as Chart.fig is.
Using FastAPI APIRouter Directly
Access the underlying FastAPI router via router._api_router:
From FastAPI — Converting Existing Apps
Any existing FastAPI application can become an OpenBB extension without changing code. Define the entry point in pyproject.toml pointed at the FastAPI or APIRouter instance:
Install the package and build static assets:
Known limitations:
- Authorization hooks are not injected into the Python Interface
- Request-bound dependencies or those returning None are not injected
- WebSockets are not supported in the Python Interface
- Multi-method routes (GET + POST on same path) may not generate correctly
Serving with openbb-api (Workspace Backends)
The openbb-api CLI converts a FastAPI instance into an OpenBB Workspace backend with auto-generated widget definitions.
Basic Usage
Defaults are --host 127.0.0.1 --port 6900, falling back to the next available port if already in use.
Key Arguments
| Argument | Description | |
|---|---|---|
--app | Path to Python file with a FastAPI instance | |
--name | Name of the FastAPI instance (default: app) | |
--factory | Flag if the app name is a factory function | |
--editable | Make widgets.json editable at runtime | |
--no-build | Load existing widgets.json without checking for updates | |
--exclude | JSON list of API paths to exclude from widgets | |
--widgets-json | Custom path for widgets.json | |
--apps-json | Custom path for workspace_apps.json |
All remaining arguments are passed to uvicorn.run.
Inline Widget Definitions
Widget properties can be defined inline in your code via openapi_extra:
Exclude an Endpoint from Widgets
Dropdown Parameters
Dropdowns are auto-generated from Literal types:
Column Definitions for Tables
Use Pydantic response models to auto-generate table column definitions:
Widget Types by Return Type
| Return Type | Widget Type | |
|---|---|---|
list[dict] or list[BaseModel] | Table (AgGrid) | |
str | Markdown | |
dict (with widget_config.type="chart") | Plotly Chart | |
MetricResponseModel | Metric | |
PdfResponseModel |
Response Models for Special Widgets
Plotly Chart Widget
JSON Schema Extra for Parameters
Annotate parameters with additional widget configuration:
Form Input Widget
Create an input form tied to a table:
- GET endpoint defines
widget_config.form_endpointpointing to the POST route - POST route accepts a single Pydantic model argument
OBBject Extensions (Result Post-Processing)
Extend the OBBject response with custom methods, accessible in the Python Interface.
Class Accessor (Namespaced Methods)
Register in pyproject.toml:
Callable Accessor (Property-Like)
OBBject Output Conversion Methods
Every OBBject has built-in conversion methods:
to_df()/to_dataframe()— Pandas DataFrameto_dict(orientation=...)— Python dictto_numpy()— NumPy arrayto_polars()— Polars DataFrame (requirespolarsinstalled)model_dump()— Complete object as dictmodel_dump_json()— Serialized JSON string
OBBject Plugins (Pre-Return Interceptors)
Plugins execute before the response is returned, compatible with both REST API and Python Interface. They can conditionally alter the output of any command.
WARNING: Plugins are considered potentially dangerous. The environment must be explicitly configured to allow them.
In system_settings.json:
Plugin Configuration
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingopenbb_platform/extensions/mcp_server/openbb_mcp_server/skills/build_workspace_app/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openbq-org/openbb/build-workspace-app)