Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildUserAgent ¶
BuildUserAgent constructs the HTTP User-Agent header value for the CLI. The base format is "slack-cli/<version> (os: <goos>)". If an AI agent is detected, an " AI-Agent (name: ..., entry: ...)" suffix is appended.
Examples:
slack-cli/2.38.1 (os: darwin) slack-cli/2.38.1 (os: darwin) AI-Agent (name: claude-code, entry: cli) slack-cli/2.38.1 (os: linux) AI-Agent (name: cursor)
func EmitAgentPluginHint ¶
EmitAgentPluginHint writes the Slack plugin recommendation to a writer that should be stderr when a coding agent is detected.
Claude Code is included alongside the EmitClaudeCodePluginHint marker, since the marker shows no install prompt on some setups, such as Amazon Bedrock or with telemetry turned off.
func EmitClaudeCodePluginHint ¶
EmitClaudeCodePluginHint writes the Claude Code plugin recommendation marker to a writer that must be stderr to prompt installation without an appearance in actual outputs.
func GetAIAgentName ¶
func GetAIAgentName() string
GetAIAgentName returns the normalized name of the detected AI agent, or an empty string if no agent is detected.
Types ¶
type AIAgent ¶
AIAgent represents a detected AI coding agent that invoked the CLI.
func GetAIAgent ¶
func GetAIAgent() *AIAgent
GetAIAgent checks environment variables to determine if the CLI is being run by an AI coding agent. Returns nil if no agent is detected. Detection priority: CLAUDECODE > CODEX_CI > GEMINI_CLI > CLINE_ACTIVE > CURSOR_AGENT > OPENCODE > AGENT.