Skip to content

Conversation

@provinzkraut
Copy link
Member

What

Add a shell command to drop into an interactive console. The console namespace is preloaded with the app, and can be customised by plugins. For example, advanced-alchemy could provide its config or a SQLAlchemy session by implementing populate_repl_namespace in its CLIPlugin.

Multi-REPL support

  • stdlib REPL: python
  • stdlib asyncio REPL: python -m asyncio (requires Python >= 3.13, since earlier versions to not allow customisation of the repl startup)
  • IPython

The REPL can be selected by passing a value to --repl, e.g. litestar shell --repl=asyncio. If not value provided it will try to automatically select the best suited REPL:

  • IPython if installed
  • asyncio if >= Python 3.13
  • Default REPL as a fallback

@github-actions github-actions bot added area/dependencies This PR involves changes to the dependencies area/plugins This PR involves changes to the plugins labels Oct 3, 2025
@github-actions github-actions bot added area/private-api This PR involves changes to the privatized API size: small type/feat pr/internal labels Oct 3, 2025
@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 20.68966% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.79%. Comparing base (6ce617e) to head (8a445c3).

Files with missing lines Patch % Lines
litestar/cli/_utils.py 9.09% 10 Missing ⚠️
litestar/cli/_shell_startup.py 0.00% 6 Missing ⚠️
litestar/cli/commands/core.py 33.33% 6 Missing ⚠️
litestar/plugins/base.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4390      +/-   ##
==========================================
- Coverage   97.93%   97.79%   -0.15%     
==========================================
  Files         319      320       +1     
  Lines       15586    15614      +28     
  Branches     1726     1731       +5     
==========================================
+ Hits        15264    15269       +5     
- Misses        184      207      +23     
  Partials      138      138              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Oct 3, 2025

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies This PR involves changes to the dependencies area/plugins This PR involves changes to the plugins area/private-api This PR involves changes to the privatized API pr/internal size: small type/feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants