Home / Function/ list_commands() — flask Function Reference

list_commands() — flask Function Reference

Architecture documentation for the list_commands() function in cli.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  d828f6fc_89be_5a05_5589_42611ae7786a["list_commands()"]
  ee9fbc8f_42bd_3ef5_a80f_72abfe054c0b["FlaskGroup"]
  d828f6fc_89be_5a05_5589_42611ae7786a -->|defined in| ee9fbc8f_42bd_3ef5_a80f_72abfe054c0b
  67dea11c_5c94_6773_8a63_f280d0830338["_load_plugin_commands()"]
  d828f6fc_89be_5a05_5589_42611ae7786a -->|calls| 67dea11c_5c94_6773_8a63_f280d0830338
  6cabef6b_f1ce_76af_5916_c4e9a439548c["load_app()"]
  d828f6fc_89be_5a05_5589_42611ae7786a -->|calls| 6cabef6b_f1ce_76af_5916_c4e9a439548c
  style d828f6fc_89be_5a05_5589_42611ae7786a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/cli.py lines 636–655

    def list_commands(self, ctx: click.Context) -> list[str]:
        self._load_plugin_commands()
        # Start with the built-in and plugin commands.
        rv = set(super().list_commands(ctx))
        info = ctx.ensure_object(ScriptInfo)

        # Add commands provided by the app, showing an error and
        # continuing if the app couldn't be loaded.
        try:
            rv.update(info.load_app().cli.list_commands(ctx))
        except NoAppException as e:
            # When an app couldn't be loaded, show the error message
            # without the traceback.
            click.secho(f"Error: {e.format_message()}\n", err=True, fg="red")
        except Exception:
            # When any other errors occurred during loading, show the
            # full traceback.
            click.secho(f"{traceback.format_exc()}\n", err=True, fg="red")

        return sorted(rv)

Subdomains

Defined In

Frequently Asked Questions

What does list_commands() do?
list_commands() is a function in the flask codebase, defined in src/flask/cli.py.
Where is list_commands() defined?
list_commands() is defined in src/flask/cli.py at line 636.
What does list_commands() call?
list_commands() calls 2 function(s): _load_plugin_commands, load_app.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free