prompthistory

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package prompthistory persists the user's submitted prompts so they can be recalled across sessions (Up-arrow cycling, Ctrl-R search).

Storage format: append-only JSONL at the configured path. Each line is a JSON-encoded string (the raw prompt text). Lines are written oldest-first on disk; Load returns them newest-first for convenient index-0 == most-recent navigation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(path string, prompt string) error

Append adds a single prompt to the end of the file (oldest-first on disk).

func Load

func Load(path string) ([]string, error)

Load reads all prompts from path and returns them newest-first. Returns nil (not an error) if the file does not exist. Corrupt lines are skipped silently so a bad entry never blocks the whole file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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