console_menu: Console Interactive Menu

View source: R/console.R

console_menuR Documentation

Console Interactive Menu

Description

Present a numbered list of choices and return the user's selection. Styled with cli to match the console chat interface. Similar to utils::menu() but with cli formatting.

Usage

console_menu(title, choices)

Arguments

title

The question or prompt to display.

choices

Character vector of options to present.

Value

The index of the selected choice (integer), or NULL if cancelled (user enters 'q' or empty input).

Examples


if (interactive()) {
  selection <- console_menu("Which database?", c("PostgreSQL", "SQLite", "DuckDB"))
}


aisdk documentation built on May 29, 2026, 9:07 a.m.