yai

command module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 2 Imported by: 0

README

yai

yai is a CLI that sends a prompt (and optional stdin) to an LLM and streams the response. Refactored from charmbracelet/mods.

Use it for:

  • Summarizing command output
  • Generating structured text (Markdown, JSON, YAML) in pipelines
  • Iterating on a prompt while keeping a local conversation history

Quick start

  1. Install
go install github.com/dotcommander/yai@latest
  1. Configure
export OPENAI_API_KEY=... # or configure another provider
yai --settings            # creates/edits ~/.config/yai/yai.yml
  1. First successful run
git status | yai "summarize what changed"

Docs: docs/README.md

Acknowledgments

yai is a refactored fork of mods by Charmbracelet. The original project and its excellent Bubble Tea TUI framework made yai possible. Licensed under MIT — see LICENSE.

Documentation

Overview

Package main provides the yai CLI.

Directories

Path Synopsis
internal
agent
Package agent contains yai's core (non-UI) logic.
Package agent contains yai's core (non-UI) logic.
cmd
Package cmd implements the Cobra CLI router and subcommands.
Package cmd implements the Cobra CLI router and subcommands.
config
Package config loads and validates configuration from YAML/env and provides helpers for loading role/system messages.
Package config loads and validates configuration from YAML/env and provides helpers for loading role/system messages.
errs
Package errs contains user-facing error wrappers and helpers.
Package errs contains user-facing error wrappers and helpers.
fantasybridge
Package fantasybridge converts yai protocol messages to/from Fantasy types.
Package fantasybridge converts yai protocol messages to/from Fantasy types.
mcp
Package mcp integrates Model Context Protocol servers.
Package mcp integrates Model Context Protocol servers.
present
Package present contains terminal rendering helpers and shared styles.
Package present contains terminal rendering helpers and shared styles.
proto
Package proto shared protocol.
Package proto shared protocol.
storage
Package storage manages persisted conversation metadata.
Package storage manages persisted conversation metadata.
storage/cache
Package cache provides a simple in-file cache implementation.
Package cache provides a simple in-file cache implementation.
stream
Package stream provides interfaces for streaming conversations.
Package stream provides interfaces for streaming conversations.
tui
Package tui implements the Bubble Tea UI for streaming completions.
Package tui implements the Bubble Tea UI for streaming completions.

Jump to

Keyboard shortcuts

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