vibe.cli.utils

Shared CLI utilities for VIBE.

Contains color definitions and other common CLI functionality.

ReadlineHelper

Helper for setting up readline with history and tab completion.

Provides consistent readline behavior across CLI tools with: - Persistent command history - Tab completion for commands - Proper cleanup on exit

Usage

helper = ReadlineHelper("review_playground", ["list", "classify", "quit"]) helper.setup()

... interactive loop ...

__init__

__init__(history_name: str, commands: list[str] | None = None, history_length: int = 500) -> None

Initialize readline helper.

Parameters:
  • history_name (str) –

    Name for the history file (stored in .vibe_data/{name}_history)

  • commands (list[str] | None, default: None ) –

    Optional list of commands for tab completion

  • history_length (int, default: 500 ) –

    Maximum history entries to keep

setup

setup() -> None

Set up readline with history and tab completion.

print_colored

print_colored(color: str, message: str) -> None

Print a colored message to stdout.

print_status

print_status(prefix: str, color: str, message: str, details: list[str] | None = None) -> None

Print a colored status message to stdout.

Parameters:
  • prefix (str) –

    Text prefix (e.g., ">>", "OK", "ERROR", "--")

  • color (str) –

    Color name from COLORS dict

  • message (str) –

    Main message text

  • details (list[str] | None, default: None ) –

    Optional list of detail lines

print_plain

print_plain(color: str, message: str, details: list[str] | None = None) -> None

Print a colored message without prefix.

print_progress

print_progress(message: str, color: str = 'dim') -> None

Print a progress message that overwrites the current line.

Use print_progress_done() or print() to move to the next line when done.

print_progress_done

print_progress_done(message: str = '', color: str = 'green') -> None

Complete a progress line and move to next line.

Parameters:
  • message (str, default: '' ) –

    Optional final message to show (replaces progress text)

  • color (str, default: 'green' ) –

    Color for the final message

print_header

print_header(title: str) -> None

Print a section header.

get_vibe_data_dir

get_vibe_data_dir() -> Path

Get the .vibe_data directory, creating it if necessary.

Returns the path to .vibe_data/ in the current working directory.