repl

package
v0.194.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0, MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package repl implements the interactive read-eval-print loop for yaah.

In v0.1 the REPL is a plain bufio.Scanner over stdin/stdout with ANSI escape codes for color. When the TUI lands in v0.2, the input loop swaps to bubbletea but the history and slash-command logic stay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendHistory

func AppendHistory(entry string) error

AppendHistory appends a single entry to the history file, one per line. If the file exceeds maxHistoryBytes after the write, it is rotated: only the most recent entries fitting within maxHistoryBytes are kept.

func Banner(version string) string

Banner returns the startup splash screen for the REPL.

func Bold

func Bold(text string) string

func Cyan

func Cyan(text string) string

func Dim

func Dim(text string) string

func InitNoColor

func InitNoColor()

func Prompt

func Prompt() string

func SlashAgentArg added in v0.153.0

func SlashAgentArg(input string) string

SlashAgentArg extracts the persona name from an /agent input line, "" for the bare command. ParseSlashCommand must have returned CmdAgent for the input.

func SlashModeArg added in v0.164.0

func SlashModeArg(input string) string

SlashModeArg extracts the mode word from a /mode input line, "" for the bare command. ParseSlashCommand must have returned CmdMode for the input.

Types

type SlashCommand

type SlashCommand int

SlashCommand represents a recognized slash command from user input.

const (
	CmdNone SlashCommand = iota
	CmdExit
	CmdClear
	CmdHelp
	CmdCompact
	CmdReloadRoles
	CmdLogin
	CmdLogout
	CmdAgents
	CmdAgent
	CmdMode
)

func ParseSlashCommand

func ParseSlashCommand(input string) SlashCommand

ParseSlashCommand checks if input is a recognized slash command. Returns CmdNone for regular text input and unrecognized commands.

Jump to

Keyboard shortcuts

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