# CLI 工具 --- Flask 提供CLI 库来运行Command 的内容。 示例代码: ```py import click @app.cli.command("hello") @click.option("--name", default="World") def hello_command(name): click.echo(f"Hello, {name}!") def test_hello_command(runner): result = runner.invoke(args="hello") assert "World" in result.output result = runner.invoke(args=["hello", "--name", "Flask"]) assert "Flask" in result.output ``` 其中,@click.option 使用来申明方法的参数格式。而def 所编写的则是方法。