Help us shape the future of Go! Take the 2026 Go Developer Survey

agentinit

package
v0.8.1 Latest Latest
Warning

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

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

Documentation

Overview

Package agentinit implements `locksql init <agent>` and the user-scope wiring of bare `locksql` and `locksql doctor --fix`: it holds locksql's texts (templates/) and wires them through lockkit's agentwire, which owns the file mechanics.

Init writes project files only. It never overwrites a file the human may have edited: an existing skill or rule is kept, an MCP config gets the locksql entry merged in (other servers and keys are kept), and a Markdown instructions file gets one marked section appended. Running it again changes nothing. Every path is resolved through symlinks and refused if it leaves the project.

User scope: wires agents through files under the home directory (and `claude mcp add --scope user`). Symlinks are followed: these are the human's own files, often managed as dotfiles.

Index

Constants

View Source
const (
	StatusCreated   = agentwire.StatusCreated
	StatusUpdated   = agentwire.StatusUpdated
	StatusUnchanged = agentwire.StatusUnchanged
	StatusKept      = agentwire.StatusKept
)

Action statuses.

Variables

This section is empty.

Functions

func Agents

func Agents() []string

Agents returns the supported agent names.

func Detect added in v0.1.2

func Detect(e Env) []string

Detect lists the installed agents, in Agents() order.

func PendingUser added in v0.1.2

func PendingUser(e Env, agent string) (bool, error)

PendingUser reports whether InitUser would write or run anything.

func ProjectRoot

func ProjectRoot(cwd string) string

ProjectRoot returns the directory init writes to: the nearest ancestor of cwd holding .locksql/config.toml, else the nearest one holding .git, else cwd itself.

Types

type Action

type Action = agentwire.Action

Action reports what Init did to one file.

type Env added in v0.1.2

type Env = agentwire.Env

Env is the user account init works on, and how it looks for and runs the agents' commands.

func SystemEnv added in v0.1.2

func SystemEnv() (Env, error)

SystemEnv is the current account: its home directory, environment and PATH.

type Result

type Result = agentwire.Result

Result is the outcome of Init.

func Init

func Init(root, agent string) (Result, error)

Init writes the integration files of agent into the project at root. Every change is computed and checked before the first write, so an invalid existing file or an escaping symlink leaves the project untouched.

func InitUser added in v0.1.2

func InitUser(e Env, agent string) (Result, error)

InitUser wires agent for the current account, in every project.

Jump to

Keyboard shortcuts

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