maton function search
maton function search <query> [flags]
Search functions. The query argument carries its own mode syntax, and the mode decides what is searched:
stripe refund ranked name, description, and search text by
lexical relevance. Does not read code.
"def handler(" literal code, as a fixed string. Only \" and \\
are unescaped inside the quotes.
/def\s+handler/ regex code, as a regular expression. A bad
pattern comes back as a 400.
The delimiters are parsed by the server, so quote them for your shell rather than stripping them.
--case and --context apply to the two code modes only; the ranked mode
ignores them. --case yes means case-sensitive and --case no means
case-insensitive; the default auto is smartcase, i.e. case-sensitive
exactly when the pattern contains an uppercase letter.
Results are not paginated. Raising --limit is the only way to see more,
and the server caps it at 100. A truncated result means more functions
matched than were returned; it does not report recall limits applied while
scanning, which are invisible to clients.
Options
-
--case <string> - Case sensitivity for code searches: {auto|yes|no}
-
--context <int> (default 0) - Lines of context around each code hit
-q,--jq <expression>- Filter JSON output using a jq expression
-
--json <fields> - Output JSON with the specified fields
-L,--limit <int> (default 0)- Maximum results, 0 for the server default of 25 (the server caps this at 100)
-
--owner <string> - Whose functions to search: {SELF|ALL}
-t,--template <string>- Format JSON output using a Go template; see "maton help formatting"
-
--visibility <string> - Filter by visibility: {PRIVATE|PUBLIC|UNLISTED}
Options inherited from parent commands
-p,--profile <string>- Profile to use for this invocation (overrides the active profile; also reads MATON_PROFILE)
JSON Fields
account_id, created_at, description, function_id, hit_count, hits, name, network_policy, runtime, star_count, updated_at, url, version, view_count, visibility
Examples
# Ranked search over names and descriptions
$ maton function search 'stripe refund'
# Literal code search, with two lines of context
$ maton function search '"def handler("' --context 2
# Regex code search across the public corpus
$ maton function search '/def\s+handler/' --owner ALL