zet

package
v0.0.0-...-0c5fcde Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountZettels

func CountZettels(zetDir string) (int, error)

func CreateZettel

func CreateZettel(zetDir, zetID, title string) error

func DeleteZettel

func DeleteZettel(zetDir, zetID string) error

func GenerateZettelID

func GenerateZettelID() string

func GetLastZettelID

func GetLastZettelID(zetDir string) (string, error)

func GetZettelTitle

func GetZettelTitle(zetDir, zetID string) (string, error)

func GitCommit

func GitCommit(zetDir, zetID, title string) error

func GitDeleteZettel

func GitDeleteZettel(zetDir, zetID, title string) error

func GitInit

func GitInit(path string) error

GitInit initializes a git repository at the given path

func GitInitAndCommit

func GitInitAndCommit(path, message string) error

GitInitAndCommit initializes a git repository and makes an initial commit

func IsValidZettelID

func IsValidZettelID(id string) bool

func ReadZettelContent

func ReadZettelContent(zetDir, zetID string) (string, error)

ReadZettelContent reads the full content of a zettel

func UpdateReadme

func UpdateReadme(zetDir string) error

func WriteZettelContent

func WriteZettelContent(zetDir, zetID, content string) error

WriteZettelContent writes content to a zettel

Types

type CountZettelsArgs

type CountZettelsArgs struct{}

type CountZettelsResult

type CountZettelsResult struct {
	Count int `json:"count" jsonschema:"total number of zettels"`
}

type CreateZettelArgs

type CreateZettelArgs struct {
	Title string `json:"title" jsonschema:"title for the new zettel (optional, can be empty)"`
}

type CreateZettelResult

type CreateZettelResult struct {
	ZettelID string `json:"zettel_id" jsonschema:"the ID of the created zettel"`
	Path     string `json:"path" jsonschema:"the file path of the created zettel"`
	Message  string `json:"message" jsonschema:"status message"`
}

type DeleteZettelArgs

type DeleteZettelArgs struct {
	ZettelID string `json:"zettel_id" jsonschema:"the ID of the zettel to delete"`
}

type DeleteZettelResult

type DeleteZettelResult struct {
	Message string `json:"message" jsonschema:"status message"`
}

type FindTodosArgs

type FindTodosArgs struct{}

type FindTodosResult

type FindTodosResult struct {
	Results []SearchResultInfo `json:"results" jsonschema:"list of todo items found"`
	Count   int                `json:"count" jsonschema:"total number of todos"`
}

type GetLastZettelArgs

type GetLastZettelArgs struct{}

type GetLastZettelResult

type GetLastZettelResult struct {
	ID      string `json:"id" jsonschema:"zettel ID"`
	Title   string `json:"title" jsonschema:"zettel title"`
	Content string `json:"content" jsonschema:"full content of the zettel"`
	Path    string `json:"path" jsonschema:"file path to the zettel"`
}

type GetZettelArgs

type GetZettelArgs struct {
	ZettelID string `json:"zettel_id" jsonschema:"the ID or partial ID of the zettel to retrieve"`
}

type GetZettelResult

type GetZettelResult struct {
	ID      string `json:"id" jsonschema:"zettel ID"`
	Title   string `json:"title" jsonschema:"zettel title"`
	Content string `json:"content" jsonschema:"full content of the zettel"`
	Path    string `json:"path" jsonschema:"file path to the zettel"`
}

type ListZettelsArgs

type ListZettelsArgs struct {
	Limit int `json:"limit,omitempty" jsonschema:"maximum number of zettels to return (default: all)"`
}

type ListZettelsResult

type ListZettelsResult struct {
	Zettels []ZettelInfo `json:"zettels" jsonschema:"list of zettels"`
	Count   int          `json:"count" jsonschema:"total number of zettels returned"`
}

type MCPServer

type MCPServer struct {
	// contains filtered or unexported fields
}

MCPServer wraps the MCP server with zettelkasten operations

func NewMCPServer

func NewMCPServer(zetDir string) *MCPServer

NewMCPServer creates a new MCP server for zettelkasten operations

func (*MCPServer) Run

func (s *MCPServer) Run(ctx context.Context) error

Run starts the MCP server on stdio transport

type SearchResult

type SearchResult struct {
	ZettelID string
	Title    string
	LineNum  int
	Line     string
	Path     string
}

func FindTodos

func FindTodos(zetDir string) ([]SearchResult, error)

func SearchInFile

func SearchInFile(filePath, searchTerm string) []SearchResult

func SearchZettels

func SearchZettels(zetDir, pattern string) ([]SearchResult, error)

type SearchResultInfo

type SearchResultInfo struct {
	ZettelID string `json:"zettel_id" jsonschema:"zettel ID"`
	Title    string `json:"title" jsonschema:"zettel title"`
	LineNum  int    `json:"line_num" jsonschema:"line number of the match"`
	Line     string `json:"line" jsonschema:"the matching line"`
}

type SearchTitlesArgs

type SearchTitlesArgs struct {
	Pattern string `json:"pattern" jsonschema:"search pattern for titles (case-insensitive substring match)"`
}

type SearchTitlesResult

type SearchTitlesResult struct {
	Zettels []ZettelInfo `json:"zettels" jsonschema:"list of zettels with matching titles"`
	Count   int          `json:"count" jsonschema:"total number of matches"`
}

type SearchZettelsArgs

type SearchZettelsArgs struct {
	Pattern string `json:"pattern" jsonschema:"search pattern (case-insensitive substring match)"`
}

type SearchZettelsResult

type SearchZettelsResult struct {
	Results []SearchResultInfo `json:"results" jsonschema:"list of search results"`
	Count   int                `json:"count" jsonschema:"total number of matches"`
}

type UpdateZettelArgs

type UpdateZettelArgs struct {
	ZettelID string `json:"zettel_id" jsonschema:"the ID of the zettel to update"`
	Content  string `json:"content" jsonschema:"the new content for the zettel (full replacement)"`
}

type UpdateZettelResult

type UpdateZettelResult struct {
	Message string `json:"message" jsonschema:"status message"`
}

type Zettel

type Zettel struct {
	ID    string
	Title string
	Path  string
}

func FindMatchingZettels

func FindMatchingZettels(zetDir, prefix string) ([]Zettel, error)

func ListZettels

func ListZettels(zetDir string) ([]Zettel, error)

func ListZettelsFromIndex

func ListZettelsFromIndex(zetDir string) ([]Zettel, error)

ListZettelsFromIndex reads the zettel list from the root README.md index file. This is much faster than ListZettels as it reads a single file instead of opening each zettel's README.md. Falls back to ListZettels if index is missing.

func SearchZettelTitles

func SearchZettelTitles(zetDir, pattern string) ([]Zettel, error)

type ZettelInfo

type ZettelInfo struct {
	ID    string `json:"id" jsonschema:"zettel ID (timestamp format)"`
	Title string `json:"title" jsonschema:"zettel title"`
	Path  string `json:"path" jsonschema:"file path to the zettel"`
}

Jump to

Keyboard shortcuts

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