console_input: Console Text Input

View source: R/console.R

console_inputR Documentation

Console Text Input

Description

Prompt the user for free-text input with optional default value.

Usage

console_input(prompt, default = NULL)

Arguments

prompt

The prompt message to display.

default

Optional default value shown in brackets. Returned if user presses Enter without typing.

Value

The user's input string, default if empty input and default is set, or NULL if empty input with no default.

Examples


if (interactive()) {
  name <- console_input("Project name", default = "my-project")
  api_key <- console_input("API key")
}


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