code: def spec_command(format, output, indent):
      """Output the OpenAPI spec to stdout or a file.
  
      Check out the docs for the detailed usage:
  
      https://apiflask.com/openapi/#the-flask-spec-command
      """
      spec_format = format or current_app.config["SPEC_FORMAT"]
      spec = current_app._get_spec(spec_format)
      output_path = output or current_app.config["LOCAL_SPEC_PATH"]
      if indent is None:
          indent = current_app.config["LOCAL_SPEC_JSON_INDENT"]
      json_indent = None if indent == 0 else indent
  
      if spec_format == "json":
          spec = json.dumps(spec, indent=json_indent)
  
      # output to stdout
      click.echo(spec)
  
      # output to local file
      if output_path:
          with open(output_path, "w") as f:
              click.echo(spec, file=f)
  
imports: import json
  import click
  from flask import current_app
  from flask.cli import with_appcontext
label_desc: Use image node_id 1 for calling a global function with example usage: spec_command(format, output, indent) without return types