prompt

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(t Template, values map[string]string) (string, error)

Render replaces {{placeholder}} with values from the map. Returns an error if any placeholder has no corresponding value.

Types

type Template

type Template struct {
	Name         string   // filename without .md extension
	Path         string   // absolute path to the template file
	Placeholders []string // unique placeholder names (e.g., ["file"])
	Content      string   // raw template content
}

Template represents a reusable prompt template.

func Discover

func Discover(cwd string) []Template

Discover scans template directories and returns available templates. Project templates (.moa/prompts/) override global ones (~/.config/moa/prompts/) when they share the same name. Results are sorted by name.

Jump to

Keyboard shortcuts

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