All apps/The Silver Searcher

The Silver Searcher

ag

A code searching tool similar to ack, with a focus on speed.

Runs as ag|macOS, Linux, Windows|github.com

Command form

ai-draft · 2 tasks · 15 fields

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.

Opens the form; the finished command lands at your prompt, unrun
otty gui ag
Search filesExample values, fixed in this page — nothing here reaches a terminal
Basic
Pattern*
string
Paths
any
Ignore case
--ignore-case
Whole words only
--word-regexp
Literal match
--literal
Context lines
integer
Advanced
Search hidden files
--hidden
TasksEach one presets the form for one job
Search for a pattern
patternpathignore_casewordliteralcontexthidden
List files containing a pattern
patternpathfiles_with_matchesignore_casewordliteral
ParametersOnly these flags are editable in the form
Pattern
Regular expression to search for (literal text with Literal match).
string · positional 0
Paths
Files or directories to search. Defaults to the current directory.
path · positional 1 · repeatable
Ignore case
boolean
--ignore-case-i
Case sensitive
boolean
--case-sensitive-s
Whole words only
boolean
--word-regexp-w
Literal match
Do not parse the pattern as a regular expression.
boolean
--literal-Q
Invert match
boolean
--invert-match-v
List matching files only
boolean
--files-with-matches-l
Count matches per file
boolean
--count-c
Context lines
Lines to print before and after each match.
integer
--context-C
Only files whose name matches
string
-G--file-search-regex
Ignore names matching
string · repeatable
--ignore
Search hidden files
boolean
--hidden
Ignore all ignore files
Also searches binary and hidden files.
boolean
--unrestricted-u
Maximum depth
integer
--depth
SourcesEvery flag above is checked against these
fig
completion

github.com

Before it fills your prompt, Otty checks the installed ag against its version. A form that does not match your version is not offered.