id = "file" name = "file" homepage = "https://github.com/file/file" executables = ["file"] [dotfiles] # The file utility's official source checks `$HOME/.magic.mgc` first, then # `$HOME/.magic`; if `.magic` is a directory it loads `.magic/magic.mgc`. # https://github.com/file/file/blob/master/src/magic.c paths = [ "~/.magic.mgc", "~/.magic", "~/.magic/magic.mgc", ] exclude = [] secret = [] # The magic database is read for each invocation; `file` does not stay resident. side_effect = false [commands] format = 1 label = "Identify file type" description = "Determine the type of one or more files. Debugging, magic-file compilation and parameter limits are left out." quality = "ai-draft" base = "fig:file" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/file.ts" license = "MIT" [[commands.field]] id = "files" label = "Files" type = "path" position = 0 multiple = true path = { kind = "any", role = "input", must_exist = true } sources = ["fig"] [[commands.field]] id = "brief" label = "Brief output" description = "Do not prepend filenames to output lines." type = "boolean" option = ["--brief", "-b"] sources = ["fig"] [[commands.field]] id = "mime" label = "MIME type output" type = "boolean" option = ["--mime", "-I"] sources = ["fig"] [[commands.field]] id = "extension" label = "Print valid extensions" type = "boolean" option = ["--extension"] sources = ["fig"] [[commands.field]] id = "keep_going" label = "Keep going after first match" type = "boolean" option = ["--keep-going", "-k"] sources = ["fig"] [[commands.field]] id = "dereference" label = "Follow symlinks" type = "boolean" option = ["--dereference", "-L"] sources = ["fig"] [[commands.field]] id = "no_dereference" label = "Do not follow symlinks" type = "boolean" option = ["--no-dereference", "-h"] sources = ["fig"] [[commands.field]] id = "separator" label = "Filename separator" type = "string" option = ["--separator", "-F"] sources = ["fig"] [[commands.field]] id = "files_from" label = "Read file names from" type = "path" option = ["--files-from", "-f"] path = { kind = "file", role = "input", must_exist = true } sources = ["fig"] [[commands.field]] id = "magic_file" label = "Magic file list" type = "string" option = ["--magic-file", "-m"] sources = ["fig"] [[commands.task]] id = "identify" label = "Identify files" fields = ["files", "brief"] required = ["files"] [[commands.task]] id = "mime-type" label = "Show MIME type" set = { mime = [true], brief = [true] } fields = ["files", "mime", "brief"] required = ["files"] [[commands.group]] id = "basic" label = "Basic" fields = ["files", "brief", "mime", "extension"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["keep_going", "dereference", "no_dereference", "separator", "files_from", "magic_file"]