agent

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package agent detects whether the Go SQL driver is being invoked by an AI coding agent by checking for well-known environment variables that agents set in their spawned shell processes.

Detection only succeeds when exactly one agent environment variable is present, to avoid ambiguous attribution when multiple agent environments overlap.

Adding a new agent requires only a new constant and a new entry in knownAgents.

References for each environment variable:

Index

Constants

View Source
const (
	Antigravity = "antigravity"
	ClaudeCode  = "claude-code"
	Cline       = "cline"
	Codex       = "codex"
	Cursor      = "cursor"
	GeminiCLI   = "gemini-cli"
	OpenCode    = "opencode"
)

Variables

This section is empty.

Functions

func Detect

func Detect() string

Detect returns the product string of the AI coding agent driving the current process, or an empty string if no agent (or multiple agents) are detected.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL