MCPcopy Index your code
hub / github.com/cli/cli / Detect

Function Detect

internal/agents/detect.go:44–46  ·  view source on GitHub ↗

Detect returns the name of the AI coding agent driving the CLI, or an empty AgentName if none is detected.

()

Source from the content-addressed store, hash-verified

42// Detect returns the name of the AI coding agent driving the CLI,
43// or an empty AgentName if none is detected.
44func Detect() AgentName {
45 return detectWith(os.LookupEnv)
46}
47
48func detectWith(lookup func(string) (string, bool)) AgentName {
49 isSet := func(key string) bool {

Callers 1

MainFunction · 0.92

Calls 1

detectWithFunction · 0.85

Tested by

no test coverage detected