install

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package install registers the codegraph MCP server into the AI coding agents found on the machine. The "main" agents (Claude Code, Codex, opencode) are auto-registered — via their own add-CLI where one exists (safe: the agent owns its config format), or a careful config-file merge where it doesn't. Anything else is covered by a generic manual snippet (GenericManual).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaudeCommand

func ClaudeCommand(bin string) []string

ClaudeCommand is the `claude mcp add` invocation: user scope (any repo), stdio transport, no repo arg (the server reads $CLAUDE_PROJECT_DIR at runtime).

func CodexCommand

func CodexCommand(bin string) []string

CodexCommand is the `codex mcp add` invocation. Codex stores it in ~/.codex/config.toml (user scope), so it applies to any repo.

func GenericManual

func GenericManual(bin string) string

GenericManual is the fallback for any agent codegraph doesn't auto-register: the stdio server command to wire into that agent's MCP config.

Types

type Agent

type Agent struct {
	Name    string
	Detect  func() bool             // is this agent installed on the machine?
	Install func(bin string) error  // auto-register; nil = manual only
	Manual  func(bin string) string // paste-ready fallback instructions
}

Agent is one AI coding agent codegraph can register itself with.

func Agents

func Agents() []Agent

Agents is the built-in registry. The server is registered with no repo-path arg — it resolves the repo from $CLAUDE_PROJECT_DIR or its working directory at launch, so a single (user-scoped) registration serves any repo the agent opens.

type Outcome

type Outcome struct {
	Agent     string
	Installed bool
	Err       error
	Manual    string // set when the user must act (no auto path, or it failed)
}

Outcome reports what happened for one detected agent.

func Run

func Run(agents []Agent, bin string) []Outcome

Run registers codegraph (the binary at bin) into every detected agent. Undetected agents are skipped. A detected agent with an Install is auto-registered; if it has none, or its Install fails, its manual instructions are returned so the user can finish by hand.

Jump to

Keyboard shortcuts

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