flask-cli-extend


Nameflask-cli-extend JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryEnhance Flask development workflow with powerful CLI commands for inspecting application.
upload_time2025-07-18 16:54:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords flask cli command-line plugin extension
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flask-CLI-Extend

Enhance Flask development workflow with powerful CLI commands for inspecting application.

## Why this `Plugin`?

While Flask provides a robust framework for building web applications, the default CLI tools can sometimes be limited for developers who need to quickly inspect the structure and configuration of their application. This extension aims to fill that gap by providing clear, concise, and colorful outputs for commonly needed information, such as registered blueprints, URL routes, and application configurations. This helps to improve developer productivity and makes debugging and introspection easier.

## Installation

```bash
pip install flask-cli-extend
```

## Configuration

You can customize the behavior of this extension by setting the following variables in your Flask application's configuration file (e.g., `config.py`).

### `FLASK_CLI_EXTEND_TABLE_COLORS`

This variable allows you to customize the colors of the output tables.

**Type:** `list[str]`

**Default:** `["yellow", "cyan", "green", "blue", "magenta"]`

**Available colors:** `click` Supported color.

**Example:**

```python
FLASK_CLI_EXTEND_TABLE_COLORS = ["red", "blue"]
```

### `FLASK_CLI_EXTEND_SENSITIVE_CONFIG_KEYS`

This variable allows you to add to the list of sensitive keys that should be masked in the output of the `flask configs` command.

**Type:** `list[str]`

**Default:** `["SECRET", "KEY", "PASSWORD", "TOKEN"]`

**Example:**

```python
FLASK_CLI_EXTEND_SENSITIVE_CONFIG_KEYS = ["URI", "PWD"]
```

## Usage

Once installed, the new commands will be available through the `flask` command.

### `flask blueprints`

Displays information about registered Flask blueprints.

**Options:**

* `--sort`, `-s`: Sorts the blueprints by name.

**Output:**

The command outputs a table with the following columns:

* **Name**: The name of the blueprint.
* **Import Name**: The import name of the blueprint.
* **Relative Path**: The relative path to the blueprint's root.
* **URL Prefix**: The URL prefix for the blueprint.
* **Subdomain**: The subdomain for the blueprint (if any).

Example output:

```
Name      Import Name      Relative Path      URL Prefix
--------  ---------------  -----------------  ------------
main      app.main         src/app/main
api       app.api          src/app/api        /api
```

### `flask routes`

Shows all registered routes with endpoints and methods.

**Options:**

* `--sort`, `-s` {endpoint,methods,domain,rule,match}: Method to sort routes by. 'match' is the order that Flask will match routes when dispatching a request.
* `--blueprint`, `-b` TEXT: Show the routes for the blueprint.
* `--all-methods`, `-A`: Show HEAD and OPTIONS methods.

**Output:**

The command outputs a table with the following columns:

* **Endpoint**: The endpoint name.
* **Methods**: The HTTP methods allowed for the route.
* **Rule**: The URL rule.
* **Host** / **Subdomain**: The host or subdomain for the route (if any).

Example output:

```
Endpoint    Methods    Rule          Host
----------  ---------  ------------  ------
main.index  GET        /
main.about  GET        /about
api.users   GET, POST  /api/users
```

### `flask configs`

Displays application configuration parameters.

**Options:**

* `--default`, `-d`: Show default config parameters.
* `--show-sensitive`, `-S`: Show sensitive values.
* `--diff`, `-D`: Show differences between current app and default config settings.
* `--namespace`, `-n` TEXT: Show config parameters that match the specified namespace/prefix.
* `--no-namespace`, `-N` TEXT: Show config parameters excluding those that match the specified namespace/prefix.

**Output:**

The command outputs a table with the following columns:

* **Key**: The configuration key.
* **Value**: The configuration value.

Sensitive values are masked by default.

Example output:

```
Key               Value
----------------  ----------------------
DEBUG             False
SECRET_KEY        ab0*******
SQLALCHEMY_DB_URI postgresql://...
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

## License

This project is licensed under the BSD License. See the `LICENSE` file for details.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flask-cli-extend",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "flask, cli, command-line, plugin, extension",
    "author": null,
    "author_email": "curskey <curskey@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/06/5b/a1159c1349584759809e6c0a6367ba80999c16a561ec8058a9f7796654cd/flask_cli_extend-0.1.0.tar.gz",
    "platform": null,
    "description": "# Flask-CLI-Extend\n\nEnhance Flask development workflow with powerful CLI commands for inspecting application.\n\n## Why this `Plugin`?\n\nWhile Flask provides a robust framework for building web applications, the default CLI tools can sometimes be limited for developers who need to quickly inspect the structure and configuration of their application. This extension aims to fill that gap by providing clear, concise, and colorful outputs for commonly needed information, such as registered blueprints, URL routes, and application configurations. This helps to improve developer productivity and makes debugging and introspection easier.\n\n## Installation\n\n```bash\npip install flask-cli-extend\n```\n\n## Configuration\n\nYou can customize the behavior of this extension by setting the following variables in your Flask application's configuration file (e.g., `config.py`).\n\n### `FLASK_CLI_EXTEND_TABLE_COLORS`\n\nThis variable allows you to customize the colors of the output tables.\n\n**Type:** `list[str]`\n\n**Default:** `[\"yellow\", \"cyan\", \"green\", \"blue\", \"magenta\"]`\n\n**Available colors:** `click` Supported color.\n\n**Example:**\n\n```python\nFLASK_CLI_EXTEND_TABLE_COLORS = [\"red\", \"blue\"]\n```\n\n### `FLASK_CLI_EXTEND_SENSITIVE_CONFIG_KEYS`\n\nThis variable allows you to add to the list of sensitive keys that should be masked in the output of the `flask configs` command.\n\n**Type:** `list[str]`\n\n**Default:** `[\"SECRET\", \"KEY\", \"PASSWORD\", \"TOKEN\"]`\n\n**Example:**\n\n```python\nFLASK_CLI_EXTEND_SENSITIVE_CONFIG_KEYS = [\"URI\", \"PWD\"]\n```\n\n## Usage\n\nOnce installed, the new commands will be available through the `flask` command.\n\n### `flask blueprints`\n\nDisplays information about registered Flask blueprints.\n\n**Options:**\n\n* `--sort`, `-s`: Sorts the blueprints by name.\n\n**Output:**\n\nThe command outputs a table with the following columns:\n\n* **Name**: The name of the blueprint.\n* **Import Name**: The import name of the blueprint.\n* **Relative Path**: The relative path to the blueprint's root.\n* **URL Prefix**: The URL prefix for the blueprint.\n* **Subdomain**: The subdomain for the blueprint (if any).\n\nExample output:\n\n```\nName      Import Name      Relative Path      URL Prefix\n--------  ---------------  -----------------  ------------\nmain      app.main         src/app/main\napi       app.api          src/app/api        /api\n```\n\n### `flask routes`\n\nShows all registered routes with endpoints and methods.\n\n**Options:**\n\n* `--sort`, `-s` {endpoint,methods,domain,rule,match}: Method to sort routes by. 'match' is the order that Flask will match routes when dispatching a request.\n* `--blueprint`, `-b` TEXT: Show the routes for the blueprint.\n* `--all-methods`, `-A`: Show HEAD and OPTIONS methods.\n\n**Output:**\n\nThe command outputs a table with the following columns:\n\n* **Endpoint**: The endpoint name.\n* **Methods**: The HTTP methods allowed for the route.\n* **Rule**: The URL rule.\n* **Host** / **Subdomain**: The host or subdomain for the route (if any).\n\nExample output:\n\n```\nEndpoint    Methods    Rule          Host\n----------  ---------  ------------  ------\nmain.index  GET        /\nmain.about  GET        /about\napi.users   GET, POST  /api/users\n```\n\n### `flask configs`\n\nDisplays application configuration parameters.\n\n**Options:**\n\n* `--default`, `-d`: Show default config parameters.\n* `--show-sensitive`, `-S`: Show sensitive values.\n* `--diff`, `-D`: Show differences between current app and default config settings.\n* `--namespace`, `-n` TEXT: Show config parameters that match the specified namespace/prefix.\n* `--no-namespace`, `-N` TEXT: Show config parameters excluding those that match the specified namespace/prefix.\n\n**Output:**\n\nThe command outputs a table with the following columns:\n\n* **Key**: The configuration key.\n* **Value**: The configuration value.\n\nSensitive values are masked by default.\n\nExample output:\n\n```\nKey               Value\n----------------  ----------------------\nDEBUG             False\nSECRET_KEY        ab0*******\nSQLALCHEMY_DB_URI postgresql://...\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n## License\n\nThis project is licensed under the BSD License. See the `LICENSE` file for details.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Enhance Flask development workflow with powerful CLI commands for inspecting application.",
    "version": "0.1.0",
    "project_urls": {
        "Issue": "https://github.com/curskey/flask-cli-extend/issues/",
        "Source": "https://github.com/curskey/flask-cli-extend"
    },
    "split_keywords": [
        "flask",
        " cli",
        " command-line",
        " plugin",
        " extension"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "718c4e117edae9824f84de65ef43c6307d165aeb39c5061ee2d6bb94e697ee8f",
                "md5": "d475024b879118585f98e0484da3735d",
                "sha256": "7bef0872c6d46fce41a63cc2d4d5b0c59d7cff12f4cb2cec7e266dbcdb152341"
            },
            "downloads": -1,
            "filename": "flask_cli_extend-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d475024b879118585f98e0484da3735d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8554,
            "upload_time": "2025-07-18T16:54:34",
            "upload_time_iso_8601": "2025-07-18T16:54:34.622885Z",
            "url": "https://files.pythonhosted.org/packages/71/8c/4e117edae9824f84de65ef43c6307d165aeb39c5061ee2d6bb94e697ee8f/flask_cli_extend-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "065ba1159c1349584759809e6c0a6367ba80999c16a561ec8058a9f7796654cd",
                "md5": "240332b2f51cf3332c452102fdd0006c",
                "sha256": "72ffe7600be026ce7e8f8628e00703be235f1f41b67a82dd91ebdc9d27ec37d2"
            },
            "downloads": -1,
            "filename": "flask_cli_extend-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "240332b2f51cf3332c452102fdd0006c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 42689,
            "upload_time": "2025-07-18T16:54:36",
            "upload_time_iso_8601": "2025-07-18T16:54:36.057421Z",
            "url": "https://files.pythonhosted.org/packages/06/5b/a1159c1349584759809e6c0a6367ba80999c16a561ec8058a9f7796654cd/flask_cli_extend-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-18 16:54:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "curskey",
    "github_project": "flask-cli-extend",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flask-cli-extend"
}
        
Elapsed time: 3.43855s