id = "src"
name = "Sourcegraph CLI"
homepage = "https://github.com/sourcegraph/src-cli"
description = "src is a command line interface to Sourcegraph: code search, GraphQL API requests and batch changes from the terminal."
icon = "theSVG:sourcegraph"
executables = ["src"]
[dotfiles]
paths = ["~/src-config.json"]
exclude = []
secret = []
side_effect = false
[[dotfiles.secret_paths]]
file = "~/src-config.json"
match = { key_path = ["accessToken", "additionalHeaders.*"] }
[commands]
format = 1
label = "Sourcegraph CLI"
description = "Run a Sourcegraph code search from the terminal. Other src commands and credentials are left out."
quality = "ai-draft"
base = "fig:src"
parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = true, short_bundles = false }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/src.ts"
license = "MIT"
[[commands.subcommand]]
path = ["search"]
label = "Code search"
description = "Run a search query against the configured Sourcegraph instance."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/src.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "query"
label = "Query"
type = "string"
position = 0
description = "The search query."
sources = ["fig"]
[[commands.subcommand.field]]
id = "json"
label = "JSON output"
type = "boolean"
option = ["-json"]
description = "Output results as JSON."
sources = ["fig"]
[[commands.subcommand.field]]
id = "stream"
label = "Stream results"
type = "boolean"
option = ["-stream"]
description = "Consume results as a stream."
sources = ["fig"]
[[commands.subcommand.field]]
id = "less"
label = "Pipe to less"
type = "boolean"
option = ["-less"]
description = "Pipe output to less -R when on a terminal."
sources = ["fig"]
[[commands.subcommand.field]]
id = "trace"
label = "Log trace ID"
type = "boolean"
option = ["-trace"]
description = "Log the trace ID for requests."
sources = ["fig"]
[[commands.subcommand.field]]
id = "explain_json"
label = "Explain JSON schema"
type = "boolean"
option = ["-explain-json"]
description = "Explain the JSON output schema and exit."
sources = ["fig"]
[[commands.subcommand.task]]
id = "search"
label = "Search"
fields = ["query", "json", "stream"]
required = ["query"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["query", "json", "stream", "less"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["trace", "explain_json"]