feat(cli): add interactive prompts and table rendering to CliFramework #240

Closed
opened 2026-05-31 14:21:27 +00:00 by jmiller · 1 comment
Owner

Problem

CliFramework has confirm() for yes/no prompts but lacks:

  • input() - free-text input with default values
  • select() / choice() - pick from a list
  • table() - ASCII table rendering for structured output
  • spinner - indeterminate progress for long operations

Tools that need interactive input currently use raw fgets(STDIN) or readline().

Proposal

Add methods to CliFramework:

// Free text input
$name = $this->input('Repository name', 'default-value');

// Selection from list
$choice = $this->select('Platform', ['joomla', 'dolibarr', 'generic']);

// Table output
$this->table(['Name', 'Status', 'Version'], $rows);

// Spinner for long operations
$this->withSpinner('Deploying...', function() { ... });

Acceptance Criteria

  • input() method with default value support
  • select() method with numbered choices
  • table() method with column alignment
  • Graceful fallback in non-interactive (piped) mode
## Problem CliFramework has confirm() for yes/no prompts but lacks: - input() - free-text input with default values - select() / choice() - pick from a list - table() - ASCII table rendering for structured output - spinner - indeterminate progress for long operations Tools that need interactive input currently use raw fgets(STDIN) or readline(). ## Proposal Add methods to CliFramework: ```php // Free text input $name = $this->input('Repository name', 'default-value'); // Selection from list $choice = $this->select('Platform', ['joomla', 'dolibarr', 'generic']); // Table output $this->table(['Name', 'Status', 'Version'], $rows); // Spinner for long operations $this->withSpinner('Deploying...', function() { ... }); ``` ## Acceptance Criteria - [ ] input() method with default value support - [ ] select() method with numbered choices - [ ] table() method with column alignment - [ ] Graceful fallback in non-interactive (piped) mode
jmiller added the phppriority: low labels 2026-05-31 14:21:27 +00:00
Author
Owner

Branch created: feature/240-feat-cli-add-interactive-prompts-and-tab

git fetch origin
git checkout feature/240-feat-cli-add-interactive-prompts-and-tab
Branch created: [`feature/240-feat-cli-add-interactive-prompts-and-tab`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/240-feat-cli-add-interactive-prompts-and-tab) ```bash git fetch origin git checkout feature/240-feat-cli-add-interactive-prompts-and-tab ```
Sign in to join this conversation.
No labels php priority: low
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/moko-platform#240