useragent

package
v0.0.0-...-8b4c66e Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUserAgent

func BuildUserAgent(cliVersion string) string

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 EmitClaudeCodePluginHint

func EmitClaudeCodePluginHint(w io.Writer)

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

type AIAgent struct {
	Name  string
	Entry string
}

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 > AGENT.

Jump to

Keyboard shortcuts

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