agents

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package agents provides integration with various AI coding agents. Supports Claude Code, Cursor, Cline, and other AI assistants.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Claude Code - uses ccusage for tracking
	ClaudeCode = Agent{
		Name:        "claude-code",
		DisplayName: "Claude Code",
		BinaryName:  "claude",
		ConfigPath:  "~/.claude/settings.json",
		DetectFunc:  detectClaudeCode,
		SetupFunc:   setupClaudeCode,
		StatusFunc:  statusClaudeCode,
	}

	// Cursor - VS Code fork with AI
	Cursor = Agent{
		Name:        "cursor",
		DisplayName: "Cursor",
		BinaryName:  "cursor",
		ConfigPath:  "~/.cursor/settings.json",
		DetectFunc:  detectCursor,
		SetupFunc:   setupCursor,
		StatusFunc:  statusCursor,
	}

	// Cline - VS Code extension
	Cline = Agent{
		Name:        "cline",
		DisplayName: "Cline",
		BinaryName:  "code",
		ConfigPath:  "~/.vscode/settings.json",
		DetectFunc:  detectCline,
		SetupFunc:   setupCline,
		StatusFunc:  statusCline,
	}

	// Continue - open source AI assistant
	Continue = Agent{
		Name:        "continue",
		DisplayName: "Continue",
		BinaryName:  "continue",
		ConfigPath:  "~/.continue/config.json",
		DetectFunc:  detectContinue,
		SetupFunc:   setupContinue,
		StatusFunc:  statusContinue,
	}

	// Aider - terminal-based AI pair programmer
	Aider = Agent{
		Name:        "aider",
		DisplayName: "Aider",
		BinaryName:  "aider",
		ConfigPath:  "~/.aider.conf.yml",
		DetectFunc:  detectAider,
		SetupFunc:   setupAider,
		StatusFunc:  statusAider,
	}

	// Codex CLI - OpenAI's coding agent
	CodexCLI = Agent{
		Name:        "codex-cli",
		DisplayName: "Codex CLI",
		BinaryName:  "codex",
		ConfigPath:  "~/.codex/config.json",
		DetectFunc:  detectCodexCLI,
		SetupFunc:   setupCodexCLI,
		StatusFunc:  statusCodexCLI,
	}

	// AllAgents is the list of supported agents
	AllAgents = []Agent{ClaudeCode, Cursor, Cline, Continue, Aider, CodexCLI}
)

Known agents

Functions

func GetAgentBinaryPath added in v1.2.0

func GetAgentBinaryPath(name string) string

GetAgentBinaryPath returns the path to an agent's binary

func GetDefaultShellRC added in v1.2.0

func GetDefaultShellRC() string

GetDefaultShellRC returns the default shell RC file path

func InstallInstructions

func InstallInstructions(name string) string

InstallInstructions returns installation instructions for an agent

func SetupAgent

func SetupAgent(name string) error

SetupAgent configures a specific agent for TokMan integration

Types

type Agent

type Agent struct {
	Name        string
	DisplayName string
	ConfigPath  string
	BinaryName  string
	DetectFunc  func() bool
	SetupFunc   func() error
	StatusFunc  func() (*AgentStatus, error)
}

Agent represents an AI coding agent integration

func GetAgent

func GetAgent(name string) *Agent

GetAgent returns an agent by name

type AgentStatus

type AgentStatus struct {
	Name         string `json:"name"`
	Installed    bool   `json:"installed"`
	Configured   bool   `json:"configured"`
	Version      string `json:"version,omitempty"`
	ConfigPath   string `json:"config_path,omitempty"`
	TokenUsage   int64  `json:"token_usage,omitempty"`
	LastActive   string `json:"last_active,omitempty"`
	ErrorMessage string `json:"error,omitempty"`
}

AgentStatus represents the current status of an agent integration

func DetectAll

func DetectAll() []*AgentStatus

DetectAll returns status of all known agents

Jump to

Keyboard shortcuts

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