id = "ag"
name = "The Silver Searcher"
homepage = "https://github.com/ggreer/the_silver_searcher"
description = "A code searching tool similar to ack, with a focus on speed."
executables = ["ag"]
[dotfiles]
paths = ["~/.agignore"]
exclude = []
secret = []
side_effect = false
[commands]
format = 1
label = "Search files"
description = "Search a directory tree for a pattern with ag. Context, case, file selection and ignore handling are covered; output colouring, pager and file-type filters are left out."
quality = "ai-draft"
base = "fig:ag"
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/ag.ts"
license = "MIT"
[[commands.field]]
id = "pattern"
label = "Pattern"
description = "Regular expression to search for (literal text with Literal match)."
type = "string"
position = 0
sources = ["fig"]
[[commands.field]]
id = "path"
label = "Paths"
description = "Files or directories to search. Defaults to the current directory."
type = "path"
position = 1
multiple = true
path = { kind = "any", role = "input", must_exist = true }
sources = ["fig"]
[[commands.field]]
id = "ignore_case"
label = "Ignore case"
type = "boolean"
option = ["--ignore-case", "-i"]
sources = ["fig"]
[[commands.field]]
id = "case_sensitive"
label = "Case sensitive"
type = "boolean"
option = ["--case-sensitive", "-s"]
sources = ["fig"]
[[commands.field]]
id = "word"
label = "Whole words only"
type = "boolean"
option = ["--word-regexp", "-w"]
sources = ["fig"]
[[commands.field]]
id = "literal"
label = "Literal match"
description = "Do not parse the pattern as a regular expression."
type = "boolean"
option = ["--literal", "-Q"]
sources = ["fig"]
[[commands.field]]
id = "invert"
label = "Invert match"
type = "boolean"
option = ["--invert-match", "-v"]
sources = ["fig"]
[[commands.field]]
id = "files_with_matches"
label = "List matching files only"
type = "boolean"
option = ["--files-with-matches", "-l"]
sources = ["fig"]
[[commands.field]]
id = "count"
label = "Count matches per file"
type = "boolean"
option = ["--count", "-c"]
sources = ["fig"]
[[commands.field]]
id = "context"
label = "Context lines"
description = "Lines to print before and after each match."
type = "integer"
option = ["--context", "-C"]
sources = ["fig"]
[[commands.field]]
id = "file_regex"
label = "Only files whose name matches"
type = "string"
option = ["-G", "--file-search-regex"]
sources = ["fig"]
[[commands.field]]
id = "ignore"
label = "Ignore names matching"
type = "string"
option = ["--ignore"]
multiple = true
sources = ["fig"]
[[commands.field]]
id = "hidden"
label = "Search hidden files"
type = "boolean"
option = ["--hidden"]
sources = ["fig"]
[[commands.field]]
id = "unrestricted"
label = "Ignore all ignore files"
description = "Also searches binary and hidden files."
type = "boolean"
option = ["--unrestricted", "-u"]
sources = ["fig"]
[[commands.field]]
id = "depth"
label = "Maximum depth"
type = "integer"
option = ["--depth"]
sources = ["fig"]
[[commands.task]]
id = "search"
label = "Search for a pattern"
fields = ["pattern", "path", "ignore_case", "word", "literal", "context", "hidden"]
required = ["pattern"]
[[commands.task]]
id = "list-files"
label = "List files containing a pattern"
set = { files_with_matches = [true] }
lock = ["files_with_matches"]
fields = ["pattern", "path", "files_with_matches", "ignore_case", "word", "literal"]
required = ["pattern"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["pattern", "path", "ignore_case", "case_sensitive", "word", "literal", "invert", "files_with_matches", "count", "context"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["file_regex", "ignore", "hidden", "unrestricted", "depth"]