cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cli is the local CLI adapter for botbooter. It reads newline-delimited messages from an io.Reader and writes replies to an io.Writer, requiring no external credentials. It implements core.Adapter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(in io.Reader, out io.Writer) *core.Bot

New creates a bot that reads newline-delimited messages from in and writes replies to out. It requires no external credentials, which makes it ideal for local development and tests. When in or out is nil, os.Stdin and os.Stdout are used respectively.

The adapter is intended for trusted, local input only: whitespace-separated tokens in a message that resolve to existing local files are opened and attached (see parseMessage), so it must not be wired to untrusted input.

Because the package does not own in, the background reader blocks inside a read until the next line or EOF. If in never reaches EOF (e.g. os.Stdin), that goroutine stays blocked after Disconnect/context cancellation until more input arrives, so repeated Connect/Disconnect cycles can leak one goroutine per cycle.

Types

This section is empty.

Jump to

Keyboard shortcuts

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