Skip to main content

Starlette-cli: make your project a cli too!

This is a starlette-app that provides a CLI with a few basic Starlette commands, and which your other apps may extend.

Example

#!/usr/bin/env python3
import apps

project = apps.Project(
    APPS=['starlette_cli']
)

app = project.starlette(
    routes=[your_route...],
    middleware=[Middleware(your_middleware...)]
)

if __name__ == '__main__':
    project.apps['cli'].entry_point()

And your Starlette script becomes an extensible CLI.

Screenshots

Help & runserver command:

runserver

Dumping urls and middlewares:

urls

Install

Install with::

pip install starlette-cli

Extend

Add a new command to the CLI with:

from starlette_cli import cli

@cli.cmd
def your_command(...):
    """Your documentation"""

Or, from within another starlette-app if you have one:

class YourApp(apps.App):
    def setup(self):
        self.project.apps['cli'].add(your_command)

Metadata

Release files for starlette-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for starlette-cli 0.1.0
File Size Uploaded
starlette-cli-0.1.0.tar.gz 2.7 kB Details

Release files / starlette-cli-0.1.0.tar.gz

Download URL starlette-cli-0.1.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9274a3222fe793509fb20874939d60207c2e5aff8005b8a0b39c8448c6996702
BLAKE2b-256 checksum
How to use checksums
627bb6e39ca141a048ca300643cb339987a274d4572bfd20fea13eb8beb0afbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page