litestar-plugins

Compose and author Litestar plugins using plugin protocols and app setup wiring.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/renjianguo666/litecms --skill litestar-plugins-renjianguo666
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: litestar-plugins
Source: https://github.com/renjianguo666/litecms/tree/main/.agents/skills/litestar-plugins
Command: npx skills add https://github.com/renjianguo666/litecms --skill litestar-plugins-renjianguo666

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Wiring Litestar plugins and authoring custom plugin protocols involves lifecycle hooks, app config mutation, and first-party ecosystem choices that are easy to get wrong or scatter across modules. ## Core Features & Use Cases - Plugin Composition: Register first-party plugins like Granian, SAQ, Vite, MCP, and SQLAlchemy in the Litestar app plugin list with settings-backed configuration. - Custom Plugin Authoring: Implement InitPluginProtocol and CLIPluginProtocol with on_app_init hooks, state sharing, and dependency provision. - Use Case: When building a Litestar app that needs a task queue, database, and frontend integration, use this Skill to wire SAQPlugin, SQLAlchemyPlugin, and VitePlugin together in one readable app setup. ## Quick Start Ask the AI to wire a Litestar app with the SAQ and SQLAlchemy plugins using settings-backed configuration.

Frequently Asked Questions about litestar-plugins

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

FAQPage Schema
How do I add plugins to a Litestar app?

Pass plugin instances to the plugins list in the Litestar constructor, such as Litestar(plugins=[SQLAlchemyPlugin(config=...)]). Keep plugin configuration near app setup and back environment-specific values with a settings module.

How do I write a custom Litestar plugin?

Implement InitPluginProtocol with an on_app_init method that receives and returns the AppConfig. Mutate app_config to register routes, middleware, dependencies, or state, and expose the plugin via app_config.state for typed dependency injection.

What first-party plugins exist for Litestar?

First-party plugins include litestar-granian for the ASGI server, litestar-saq for task queues, litestar-vite for frontend integration, litestar-mcp for MCP tooling, litestar-email for email backends, and advanced-alchemy for SQLAlchemy repository patterns.

When should I use a Litestar plugin instead of middleware?

Use a plugin when you need lifecycle hooks, CLI integration, or reusable framework integration across apps. Prefer a plain provider or middleware when you only need request-scoped behavior without app initialization changes.

How do Litestar plugins share state with route handlers?

Plugins typically store themselves in app_config.state and register a Provide dependency. Handlers then declare the plugin as a typed parameter, and Litestar injects the shared instance at request time.