{
  "id": "serve",
  "name": "serve",
  "description": "Static file serving and directory listing.",
  "executables": [
    "serve"
  ],
  "commands": {
    "format": 1,
    "label": "Serve a folder",
    "description": "Start a static web server for a folder. TLS passphrase and config file options are left out.",
    "quality": "ai-draft",
    "base": "fig:serve",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/serve.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "location",
        "label": "Folder",
        "type": "path",
        "position": 0,
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "listen",
        "label": "Listen address",
        "description": "Port, host/port, unix socket or Windows pipe.",
        "type": "string",
        "option": [
          "-l",
          "--listen"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "port",
        "label": "Port",
        "type": "string",
        "option": [
          "-p"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "single",
        "label": "Single-page app",
        "description": "Rewrite all not-found requests to index.html.",
        "type": "boolean",
        "option": [
          "-s",
          "--single"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "cors",
        "label": "Enable CORS",
        "type": "boolean",
        "option": [
          "-C",
          "--cors"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_clipboard",
        "label": "No clipboard copy",
        "type": "boolean",
        "option": [
          "-n",
          "--no-clipboard"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_compression",
        "label": "No compression",
        "type": "boolean",
        "option": [
          "-u",
          "--no-compression"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "symlinks",
        "label": "Resolve symlinks",
        "type": "boolean",
        "option": [
          "-S",
          "--symlinks"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "ssl_cert",
        "label": "TLS certificate",
        "type": "path",
        "option": [
          "--ssl-cert"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "ssl_key",
        "label": "TLS private key",
        "type": "path",
        "option": [
          "--ssl-key"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "debug",
        "label": "Debug output",
        "type": "boolean",
        "option": [
          "-d",
          "--debug"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_port_switching",
        "label": "Do not switch port",
        "type": "boolean",
        "option": [
          "--no-port-switching"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "serve-folder",
        "label": "Serve a folder",
        "fields": [
          "location",
          "port",
          "cors"
        ],
        "required": [
          "location"
        ]
      },
      {
        "id": "spa",
        "label": "Serve a single-page app",
        "set": {
          "single": [
            true
          ]
        },
        "fields": [
          "location",
          "port",
          "single"
        ],
        "required": [
          "location"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "location",
          "listen",
          "port",
          "single",
          "cors"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "no_clipboard",
          "no_compression",
          "symlinks",
          "ssl_cert",
          "ssl_key",
          "debug",
          "no_port_switching"
        ]
      }
    ]
  }
}
