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 } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/serve.ts" license = "MIT" [[commands.field]] id = "location" label = "Folder" type = "path" position = 0 path = { kind = "directory", role = "input", must_exist = true } sources = ["fig"] [[commands.field]] id = "listen" label = "Listen address" description = "Port, host/port, unix socket or Windows pipe." type = "string" option = ["-l", "--listen"] sources = ["fig"] [[commands.field]] id = "port" label = "Port" type = "string" option = ["-p"] sources = ["fig"] [[commands.field]] id = "single" label = "Single-page app" description = "Rewrite all not-found requests to index.html." type = "boolean" option = ["-s", "--single"] sources = ["fig"] [[commands.field]] id = "cors" label = "Enable CORS" type = "boolean" option = ["-C", "--cors"] sources = ["fig"] [[commands.field]] id = "no_clipboard" label = "No clipboard copy" type = "boolean" option = ["-n", "--no-clipboard"] sources = ["fig"] [[commands.field]] id = "no_compression" label = "No compression" type = "boolean" option = ["-u", "--no-compression"] sources = ["fig"] [[commands.field]] id = "symlinks" label = "Resolve symlinks" type = "boolean" option = ["-S", "--symlinks"] sources = ["fig"] [[commands.field]] id = "ssl_cert" label = "TLS certificate" type = "path" option = ["--ssl-cert"] path = { kind = "file", role = "input", must_exist = true } sources = ["fig"] [[commands.field]] id = "ssl_key" label = "TLS private key" type = "path" option = ["--ssl-key"] path = { kind = "file", role = "input", must_exist = true } sources = ["fig"] [[commands.field]] id = "debug" label = "Debug output" type = "boolean" option = ["-d", "--debug"] sources = ["fig"] [[commands.field]] id = "no_port_switching" label = "Do not switch port" type = "boolean" option = ["--no-port-switching"] sources = ["fig"] [[commands.task]] id = "serve-folder" label = "Serve a folder" fields = ["location", "port", "cors"] required = ["location"] [[commands.task]] id = "spa" label = "Serve a single-page app" set = { single = [true] } fields = ["location", "port", "single"] required = ["location"] [[commands.group]] id = "basic" label = "Basic" fields = ["location", "listen", "port", "single", "cors"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["no_clipboard", "no_compression", "symlinks", "ssl_cert", "ssl_key", "debug", "no_port_switching"]