slash

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 4 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 slash defines built-in slash commands and matching helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCandidates

func AllCandidates(options CandidateOptions) []string

AllCandidates returns every visible slash completion candidate for options.

func Candidates

func Candidates(prefix string) []string

Candidates returns completion candidates for prefix.

func CandidatesWithOptions

func CandidatesWithOptions(prefix string, options CandidateOptions) []string

CandidatesWithOptions returns completion candidates using runtime context.

func FilterCandidates

func FilterCandidates(prefix string, candidates []string) []string

FilterCandidates returns sorted candidates that start with prefix.

func FilterCandidatesStable

func FilterCandidatesStable(prefix string, candidates []string) []string

FilterCandidatesStable filters candidates without changing their category order, which keeps built-ins ahead of runtime commands in interactive menus.

func MenuCandidates(options CandidateOptions) []string

MenuCandidates returns command-level entries for the interactive slash menu. Detailed argument templates remain available through AllCandidates.

func RenderHelp

func RenderHelp(w io.Writer)

RenderHelp writes a text help table for built-in slash commands.

func ResumeSupportedNames

func ResumeSupportedNames() []string

ResumeSupportedNames returns sorted names for visible resume-safe slash commands.

func Suggest

func Suggest(input string, limit int) []string

Suggest returns likely built-in slash commands for input.

func SuggestWithCandidates

func SuggestWithCandidates(input string, limit int, extraCandidates []string) []string

SuggestWithCandidates returns likely slash commands using built-ins and extra candidates.

func SupportsResume

func SupportsResume(name string) bool

SupportsResume reports whether name can run through the non-interactive resume path.

Types

type CandidateOptions

type CandidateOptions struct {
	Model            string
	ActiveSessionID  string
	RecentSessionIDs []string
	Extra            []string
}

CandidateOptions supplies runtime context for slash completion candidates.

type Spec

type Spec struct {
	Name            string
	Usage           string
	Description     string
	ResumeSupported bool
	Hidden          bool
	Disabled        bool
}

Spec describes one built-in slash command.

func DescribeCandidate

func DescribeCandidate(candidate string) (Spec, bool)

DescribeCandidate returns the built-in slash spec that explains a completion candidate. Candidates may include arguments or subcommands; only the command token is used for lookup.

func Lookup

func Lookup(name string) (Spec, bool)

Lookup returns the slash command spec matching name.

func ResumeSupportedSpecs

func ResumeSupportedSpecs() []Spec

ResumeSupportedSpecs returns visible slash commands that support --resume dispatch.

func Specs

func Specs() []Spec

Specs returns the built-in slash command registry.

Jump to

Keyboard shortcuts

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