Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateProjectMemory(root string) (string, error)
- func LoadProjectMemory(workingDir string) (content string, files []string, err error)
- func ProjectMemoryFilesForPath(targetPath string) ([]string, error)
- func ReadProjectMemoryFiles(paths []string) (content string, files []string, err error)
- func ResolveProjectMemoryInitTarget(workingDir string) (targetPath string, existingFiles []string, err error)
- type AutoMemory
Constants ¶
const DefaultProjectMemoryFilename = "GGCODE.md"
Variables ¶
var ProjectMemoryFilenames = []string{
"GGCODE.md",
"AGENTS.md",
"CLAUDE.md",
"COPILOT.md",
}
ProjectMemoryFilenames lists the supported project bootstrap documents in priority order.
Functions ¶
func GenerateProjectMemory ¶
GenerateProjectMemory builds a GGCODE.md document using the current repo state.
func LoadProjectMemory ¶
LoadProjectMemory reads supported project bootstrap documents from the global config dir and the current working directory's ancestor chain. Merge order: global -> walked parents/current directory.
func ProjectMemoryFilesForPath ¶ added in v1.1.30
ProjectMemoryFilesForPath returns the supported project memory files that apply to a specific path by walking that path's ancestor chain.
func ReadProjectMemoryFiles ¶ added in v1.1.30
ReadProjectMemoryFiles reads project memory files in order and returns their merged content plus the subset that had non-empty readable contents.
Types ¶
type AutoMemory ¶
type AutoMemory struct {
// contains filtered or unexported fields
}
AutoMemory manages automatic memory persistence in ~/.ggcode/memory/.
func NewAutoMemory ¶
func NewAutoMemory() *AutoMemory
NewAutoMemory creates an AutoMemory instance for global memory (~/.ggcode/memory/).
func NewProjectAutoMemory ¶ added in v1.1.99
func NewProjectAutoMemory(workingDir string) *AutoMemory
NewProjectAutoMemory creates an AutoMemory instance for project-scoped memory. It locates the project root (git root or directory with project memory files) and uses <project-root>/.ggcode/memory/ as the storage directory. Falls back to workingDir itself as project root (every directory is a valid project). Returns nil only if workingDir is the user's HOME directory.
func (*AutoMemory) List ¶
func (am *AutoMemory) List() ([]string, error)
List returns all memory keys.
func (*AutoMemory) LoadAll ¶
func (am *AutoMemory) LoadAll() (string, []string, error)
LoadAll loads all memory files and returns their combined content.
func (*AutoMemory) SaveMemory ¶
func (am *AutoMemory) SaveMemory(key, content string) error
SaveMemory saves a memory entry to ~/.ggcode/memory/{key}.md.