search

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFZFInstalled

func CheckFZFInstalled() error

CheckFZFInstalled verifies that fzf is available in PATH.

func CompileCELFilter added in v0.2.0

func CompileCELFilter(expr string) (cel.Program, error)

CompileCELFilter compiles a CEL filter expression into a program.

func EvaluateFilter added in v0.2.0

func EvaluateFilter(prg cel.Program, vars map[string]any) (bool, error)

EvaluateFilter evaluates a compiled CEL program against a variable map.

func GetCurrentUser added in v0.2.0

func GetCurrentUser() (string, error)

GetCurrentUser returns the current GitHub username using gh CLI.

func NewCELEnv added in v0.2.0

func NewCELEnv() (*cel.Env, error)

NewCELEnv creates the CEL environment with search-specific variables.

Types

type Action

type Action string

Action represents an action to perform on a selected item.

const (
	ActionOpenEditor  Action = "editor"
	ActionPush        Action = "push"
	ActionViewBrowser Action = "browser"
	ActionCopyPath    Action = "copy"
	ActionPullFresh   Action = "pull"
	ActionCancel      Action = "cancel"
)

func RunActionMenu

func RunActionMenu(item *Item) (Action, error)

RunActionMenu shows a menu of actions for the selected item.

type Filters

type Filters struct {
	Repo        string // "owner/repo" format, empty = all repos
	Issues      bool
	PRs         bool
	Discussions bool
}

Filters specifies which items to include in search results.

type Item

type Item struct {
	FilePath string
	Owner    string
	Repo     string
	Number   int
	Type     string // "issue", "pr", "discussion"
	State    string // "open", "closed", "merged"
	Title    string
	URL      string
}

Item represents a searchable item from local files.

func DiscoverItems added in v0.2.0

func DiscoverItems(prg cel.Program, username string, repo string) ([]Item, error)

DiscoverItems discovers all items matching the CEL filter. If repo is empty, searches all repos. If repo is "owner/repo", only searches that repo.

func DiscoverLocalFiles

func DiscoverLocalFiles(filters Filters) ([]Item, error)

DiscoverLocalFiles walks the gh-md root directory and returns all matching items.

func RunSelector

func RunSelector(items []Item, query string) (*Item, error)

RunSelector opens fzf with the given items and returns the selected item. Returns nil if the user cancels (Esc).

Jump to

Keyboard shortcuts

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