Skip to content

[Feature/interactive cli] - adding interactive CLI for first time users and easy setup #10 - #11

Open
LazyKaddu wants to merge 6 commits into
FireHead90544:mainfrom
LazyKaddu:feature/interactive-cli
Open

LazyKaddu wants to merge 6 commits into
FireHead90544:mainfrom
LazyKaddu:feature/interactive-cli

Conversation

@LazyKaddu

Copy link
Copy Markdown

Interactive CLI Menus and Setup Improvements

Overview

This change upgrades the CLI experience by replacing legacy text-based prompts with keyboard-navigable questionary menus. The improvements cover both the initial setup flow and core command-generation actions while preserving the existing non-interactive CLI workflow.

1. Replaced Legacy Prompts with Keyboard-Navigable Menus

Added Dependency

  • Added questionary to requirements.txt.
  • Enables interactive terminal prompts with arrow-key navigation and improved input handling.

Improved Setup Flow

Updated how/how.py to replace Typer's basic prompts with questionary:

  • LLM provider selection now uses a keyboard-navigable dropdown menu.
  • API key input uses questionary.
  • Model and endpoint inputs use questionary.
  • Standardized text, password, and selection prompts across the setup flow.

Users can now navigate provider selections using the ↑ / ↓ arrow keys instead of manually entering or selecting values.

2. Upgraded Action Menus

Updated how/actions.py to provide a more consistent interactive experience after generating shell commands.

Interactive Action Menu

The available actions:

  • Execute
  • Copy
  • Modify
  • Abort

are now presented through a questionary selection menu instead of requiring users to manually type a letter.

Execution Confirmations

Replaced typer.confirm() with questionary.confirm() for:

  • Confirming command execution.
  • Deciding whether to continue after a command execution failure.

Inline Command Modification

Command modification now uses questionary.text() instead of the previous fallback text prompt.

Safety Guardrail

The destructive-action safety confirmation remains a manual text-entry prompt intentionally. This ensures that high-risk actions require an explicit confirmation rather than being accidentally accepted through a simple selection.

3. Backward Compatibility and Test Coverage

Non-Interactive CLI Support

Existing non-interactive setup flags remain fully supported, including:

  • --provider
  • --api-key
  • Other existing setup parameters

This ensures that scripted and automated setup workflows continue to work without requiring interactive input.

New CLI Tests

Added tests/test_cli.py to verify the non-interactive setup path and ensure that CLI flags and supplied parameters are correctly respected.

Updated Existing Tests

Updated mocks in tests/test_actions.py to correctly patch the new questionary interactions instead of the previous Typer/Rich prompts.

Also fixed a Windows-specific issue in tests/test_context.py by mocking the system platform during the relevant test.

4. Documentation Updates

Updated README.md to mention the new keyboard-navigable setup menu, helping first-time users understand that provider selection can be performed using the arrow keys.

Summary

This update modernizes the CLI interaction model while maintaining compatibility with existing automation workflows. It provides a more consistent terminal UI, improves command-generation actions, preserves destructive-action safeguards, and adds test coverage for both interactive and non-interactive behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant