plan

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package plan provides plan file selection and manipulation.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPlansFound = errors.New("no plans found")

ErrNoPlansFound is returned when no plan files exist in the plans directory.

Functions

func ExtractBranchName

func ExtractBranchName(planFile string) string

ExtractBranchName derives a branch name from a plan file path. removes the .md extension and strips any leading date prefix (e.g., "2024-01-15-").

func PromptDescription

func PromptDescription(ctx context.Context, r io.Reader, colors *progress.Colors) string

PromptDescription prompts the user to enter a plan description. returns empty string if user cancels (Ctrl+C or Ctrl+D).

Types

type Selector

type Selector struct {
	PlansDir string
	Colors   *progress.Colors
}

Selector handles plan file selection and resolution.

func NewSelector

func NewSelector(plansDir string, colors *progress.Colors) *Selector

NewSelector creates a new Selector with the given plans directory and colors.

func (*Selector) FindRecent

func (s *Selector) FindRecent(startTime time.Time) string

FindRecent finds the most recently modified plan file in the plans directory that was modified after the given start time.

func (*Selector) Select

func (s *Selector) Select(ctx context.Context, planFile string, optional bool) (string, error)

Select selects and prepares a plan file. if planFile is provided, validates it exists and returns absolute path. if planFile is empty and optional is true, returns empty string without error. if planFile is empty and optional is false, uses fzf for selection.

Jump to

Keyboard shortcuts

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