command¶
panel_flowdash.command
¶
Command-line interface for panel-flowdash.
__version__ = importlib.metadata.version(__name__)
module-attribute
¶
Serve
¶
Bases: Serve
Serve a flowdash dashboard application from a project directory.
args = (('directory', Argument(metavar='DIRECTORY', help='Path to the project directory containing page/component modules.')), ('--db-path', Argument(action='store', type=str, default=None, help='Path to the SQLite database file. Defaults to <directory>/assets.db, or an existing <directory>/dashboards.db. Ignored by projects whose __init__.py defines `store`.')), ('--package', Argument(action='store', type=str, default=None, help='Import the project as this installed or importable package, naming modules <package>.<Section>.<name>, instead of adding DIRECTORY to sys.path. The package must resolve to DIRECTORY.')), ('--project', Argument(action='store', metavar='FILE', type=str, default=None, help='The project file whose sections configure the app, relative to the working directory. Defaults to flowdash.yaml in DIRECTORY.')), ('--component-library', Argument(action='append', metavar='MODULE', default=None, help='Offer the components of an installed library, e.g. my_library, or module:attribute for a mapping of component id to component. Repeat it for several libraries; they are added to `component_libraries` in __init__.py.')), ('--agent-model', Argument(action='append', metavar='ID[=LABEL]', default=None, help='A model the assistant may use, as pydantic-ai names it, e.g. openai:<model>, optionally with a label: openai:<model>=Fast. Repeat it, or separate models with commas, to let people pick between several; the first is the default. Overrides `agent_model`, `agent_models` and an `agent` model string in __init__.py.')), ('--title', Argument(action='store', type=str, default=None, help="Application title shown in the browser tab. Overrides `title` in __init__.py; defaults to 'FlowDash'.")), ('--home-dashboard', Argument(action='store', type=str, default=None, help='Dashboard (id or title) to show on the homepage. Overrides `home_dashboard` in __init__.py. When unset, the homepage shows the dashboard grid.')), ('--nav-variant', Argument(action='store', type=str, default=None, choices=('rail', 'left', 'right', 'menubar'), help="How to render navigation: 'rail' (navigation rail and breadcrumb), 'left' or 'right' (docked drawer on that side) or 'menubar' (in the page header). Overrides `nav_variant` in __init__.py; defaults to 'rail'.")), ('--admin-link', Argument(action='store_true', default=False, help='Print a link that adds one admin even when the project already has admins. By default the link is printed, and works, only while it has none.')), *((name, arg) for name, arg in _PanelServe.args if name not in _EXCLUDED_ARGS))
class-attribute
instance-attribute
¶
help = 'Launch the FlowDash dashboard server from a project directory.'
class-attribute
instance-attribute
¶
name = 'serve'
class-attribute
instance-attribute
¶
customize_applications(args, applications)
¶
customize_kwargs(args, server_kwargs)
¶
customize_server(server)
¶
invoke(args)
¶
main(args=None)
¶
Entry point for the panel-flowdash CLI.
serve
¶
The flowdash serve subcommand.
PROJECT_OPTIONS = ('add_data', 'admin_hidden_sections', 'admin_link', 'admin_section_redirects', 'agent', 'agent_approval_rules', 'agent_authorize', 'agent_model', 'agent_model_settings', 'agent_models', 'agent_sensitive_components', 'agent_starters', 'breakpoints', 'chats', 'component_libraries', 'configure_layout', 'controls_position', 'data_chips', 'editor_class', 'editor_options', 'header_layout', 'home', 'home_dashboard', 'include_builtin_components', 'mcp_secret_env_vars', 'mcp_servers', 'mcp_stdio_commands', 'mcp_stdio_env', 'nav_variant', 'notifications', 'page_options', 'propagate_failures', 'sections', 'settings_class', 'suggest_questions', 'title', 'tool_authorize', 'trusted_proxies')
module-attribute
¶
log = logging.getLogger(__name__)
module-attribute
¶
Serve
¶
Bases: Serve
Serve a flowdash dashboard application from a project directory.
args = (('directory', Argument(metavar='DIRECTORY', help='Path to the project directory containing page/component modules.')), ('--db-path', Argument(action='store', type=str, default=None, help='Path to the SQLite database file. Defaults to <directory>/assets.db, or an existing <directory>/dashboards.db. Ignored by projects whose __init__.py defines `store`.')), ('--package', Argument(action='store', type=str, default=None, help='Import the project as this installed or importable package, naming modules <package>.<Section>.<name>, instead of adding DIRECTORY to sys.path. The package must resolve to DIRECTORY.')), ('--project', Argument(action='store', metavar='FILE', type=str, default=None, help='The project file whose sections configure the app, relative to the working directory. Defaults to flowdash.yaml in DIRECTORY.')), ('--component-library', Argument(action='append', metavar='MODULE', default=None, help='Offer the components of an installed library, e.g. my_library, or module:attribute for a mapping of component id to component. Repeat it for several libraries; they are added to `component_libraries` in __init__.py.')), ('--agent-model', Argument(action='append', metavar='ID[=LABEL]', default=None, help='A model the assistant may use, as pydantic-ai names it, e.g. openai:<model>, optionally with a label: openai:<model>=Fast. Repeat it, or separate models with commas, to let people pick between several; the first is the default. Overrides `agent_model`, `agent_models` and an `agent` model string in __init__.py.')), ('--title', Argument(action='store', type=str, default=None, help="Application title shown in the browser tab. Overrides `title` in __init__.py; defaults to 'FlowDash'.")), ('--home-dashboard', Argument(action='store', type=str, default=None, help='Dashboard (id or title) to show on the homepage. Overrides `home_dashboard` in __init__.py. When unset, the homepage shows the dashboard grid.')), ('--nav-variant', Argument(action='store', type=str, default=None, choices=('rail', 'left', 'right', 'menubar'), help="How to render navigation: 'rail' (navigation rail and breadcrumb), 'left' or 'right' (docked drawer on that side) or 'menubar' (in the page header). Overrides `nav_variant` in __init__.py; defaults to 'rail'.")), ('--admin-link', Argument(action='store_true', default=False, help='Print a link that adds one admin even when the project already has admins. By default the link is printed, and works, only while it has none.')), *((name, arg) for name, arg in _PanelServe.args if name not in _EXCLUDED_ARGS))
class-attribute
instance-attribute
¶
help = 'Launch the FlowDash dashboard server from a project directory.'
class-attribute
instance-attribute
¶
name = 'serve'
class-attribute
instance-attribute
¶
customize_applications(args, applications)
¶
customize_kwargs(args, server_kwargs)
¶
customize_server(server)
¶
invoke(args)
¶
server_base_url(address, port, *, ssl=False, prefix='')
¶
Return the URL a browser on this machine opens to reach the server.
port is the bound port, so --port 0 shows the one the OS picked.
A wildcard address becomes localhost and an IPv6 address is
bracketed. Without a port (a unix socket) only prefix is returned.