cli

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNotionUUID added in v0.4.0

func ExtractNotionUUID(s string) (string, bool)

ExtractNotionUUID finds exactly 32 hex digits in a string and returns the canonical UUID format (8-4-4-4-12).

func GetClient

func GetClient() (*mcp.Client, error)

func IsEmoji added in v0.3.0

func IsEmoji(r rune) bool

IsEmoji returns true if the rune is an emoji character.

func LooksLikeID added in v0.3.0

func LooksLikeID(s string) bool

LooksLikeID returns true if the string is a valid Notion UUID (32 or 36 hex chars).

func RequireClient

func RequireClient() (*mcp.Client, error)

func RequireOfficialAPIClient added in v0.6.0

func RequireOfficialAPIClient(overrides config.APIOverrides) (*api.Client, error)

func ResolveDatabaseID added in v0.5.0

func ResolveDatabaseID(ctx context.Context, client *mcp.Client, input string) (string, error)

ResolveDatabaseID resolves any database reference (URL, ID, or name) to a database ID. Like ResolvePageID but filters for databases/data sources.

func ResolvePageID added in v0.3.0

func ResolvePageID(ctx context.Context, client *mcp.Client, input string) (string, error)

ResolvePageID resolves any page reference (URL, ID, or name) to a page ID. For URLs, it extracts the embedded UUID. For names, it searches and requires an exact unique match.

func SetAccessToken

func SetAccessToken(token string)

func SetFrontmatterID added in v0.4.0

func SetFrontmatterID(content string, notionID string) string

SetFrontmatterID returns the content with notion-id set in frontmatter. If frontmatter already exists, it updates or adds the notion-id field. If no frontmatter exists, it prepends a new frontmatter block.

Types

type Frontmatter added in v0.4.0

type Frontmatter struct {
	NotionID string
}

func ParseFrontmatter added in v0.4.0

func ParseFrontmatter(content string) (Frontmatter, string)

ParseFrontmatter extracts frontmatter and body from a markdown string. Returns the parsed frontmatter (if any) and the body without frontmatter.

type OfficialAPIConfig added in v0.6.0

type OfficialAPIConfig struct {
	Config         config.Config
	ConfigPath     string
	APITokenSource string
	HasConfigToken bool
}

func LoadOfficialAPIConfig added in v0.6.0

func LoadOfficialAPIConfig(overrides config.APIOverrides) (*OfficialAPIConfig, error)

type PageRef added in v0.3.0

type PageRef struct {
	Kind PageRefKind
	Raw  string
	ID   string // canonical UUID if Kind==RefID
}

func ParsePageRef added in v0.3.0

func ParsePageRef(s string) PageRef

ParsePageRef classifies an input string as a URL, ID, or name.

type PageRefKind added in v0.3.0

type PageRefKind int
const (
	RefID PageRefKind = iota
	RefURL
	RefName
)

Jump to

Keyboard shortcuts

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