project

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package project locates the agentmod project that governs a directory. A directory is inside a project when it, or one of its ancestors, contains the marker file .agentmod/agentmod.toml. The nearest marker wins, so nested projects shadow outer ones.

Index

Constants

View Source
const (
	DirName        = ".agentmod"
	ConfigFileName = "agentmod.toml"
)

Marker path components relative to a project root.

Variables

View Source
var ErrNotFound = errors.New("not inside an agentmod project (no .agentmod/agentmod.toml here or in any parent directory)")

ErrNotFound is returned by Discover when no ancestor up to the filesystem root contains .agentmod/agentmod.toml.

Functions

This section is empty.

Types

type Project

type Project struct {
	Root        string // absolute directory containing .agentmod/
	AgentmodDir string // Root/.agentmod
	ConfigPath  string // Root/.agentmod/agentmod.toml
}

Project describes a discovered agentmod project.

func Discover

func Discover(startDir string) (*Project, error)

Discover walks from startDir upward to the filesystem root and returns the nearest enclosing project. startDir may be relative; it is made absolute without resolving symlinks, so activation follows the path the user is actually in. The marker must be a regular file: a directory named agentmod.toml, or a bare .agentmod/ without the config, does not activate. Unreadable ancestors are skipped rather than treated as errors.

Jump to

Keyboard shortcuts

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