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