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 (~/.ggcode/) and the current working directory only. No parent directory traversal is performed — this prevents loading memory from unrelated ancestor workspaces (e.g. modelmeta loading ggcode's memory just because they share a parent directory).
func ProjectMemoryFilesForPath ¶ added in v1.1.30
ProjectMemoryFilesForPath returns the supported project memory files that exist in the directory containing the given path (no parent walk).
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. Uses <workingDir>/.ggcode/memory/ directly — no parent directory traversal. 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.