Conversation
There was a problem hiding this comment.
Pull request overview
Adds an interactive prompting layer to the Databao CLI (intended to enable arrow-key selection in TTYs via questionary) and updates CLI messaging to consistently refer to “Context Engine”.
Changes:
- Add
questionarydependency and introduce new CLI prompt helpers (ask_select/ask_confirm/ask_text) with label support. - Update datasource add flow and tests to use the new prompting mechanism.
- Refresh various user-facing strings (Context Engine terminology, app/ask/status messaging).
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Adds questionary runtime dependency. |
uv.lock |
Lockfile update to include questionary (and related lock churn). |
src/databao_cli/utils.py |
New prompt abstraction layer (TTY uses questionary, non-TTY uses click). |
src/databao_cli/labels.py |
Adds label mappings for nicer interactive choice titles. |
src/databao_cli/__main__.py |
Registers labels and swaps click.confirm usage to the new helper. |
src/databao_cli/commands/datasource/add_datasource_config.py |
Moves prompts to the new helpers (select/confirm/text). |
tests/test_add_datasource.py |
Attempts to adapt tests for new selection behavior. |
src/databao_cli/mcp/tools/databao_ask/agent_factory.py |
Messaging updates (“Context Engine”, punctuation tweaks). |
src/databao_cli/commands/status.py |
Messaging updates in status output. |
src/databao_cli/commands/ask.py |
Messaging updates for interactive help/unknown command text. |
src/databao_cli/commands/app.py |
Messaging updates for app startup/shutdown/errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
src/databao_cli/utils.py
Outdated
| def ask_select(message: str, choices: list[str], default: str = None) -> str: | ||
| """Select from a list. Interactive in TTY, plain text otherwise.""" |
src/databao_cli/utils.py
Outdated
| def ask_text(message: str, default: str = None) -> str: | ||
| """Text input. Interactive in TTY, plain click.prompt otherwise.""" | ||
| if is_interactive(): | ||
| return questionary.text(message, default=default or "").ask() |
| click.echo(f"{message}") | ||
| for i, choice in enumerate(choices, 1): | ||
| click.echo(f" {i}. {choice}") | ||
| value = click.prompt( | ||
| "Enter a number of value", | ||
| default=default or choices[0], | ||
| ) |
| config_type = ask_select( | ||
| "What type of datasource do you want to add?", | ||
| type=click.Choice(all_datasource_types), | ||
| default=all_datasource_types[0] if len(all_datasource_types) == 1 else None, | ||
| choices=all_datasource_types, | ||
| default=all_datasource_types[0] if len(all_datasource_types) == 0 else None, | ||
| ) |
| prompt = Mock() | ||
| prompt.ask.return_value = "parquet" | ||
| monkeypatch.setattr(add_datasource_config.questionary, "select", Mock(return_value=prompt)) | ||
|
|
| prompt.ask.return_value = "parquet" | ||
| monkeypatch.setattr(add_datasource_config.questionary, "select", Mock(return_value=prompt)) | ||
|
|
||
| inputs = [ |
src/databao_cli/utils.py
Outdated
|
|
||
| _labels: dict[str, str] = {} | ||
|
|
||
| def register_labels(labels: dict) -> None: |
(cherry picked from commit 0bbe9d9)
(cherry picked from commit a99ed93)
(cherry picked from commit d65b198)
(cherry picked from commit 24e7798)
* Edit UI texts * lint: ignore ambiguous unicode character warnings (RUF001) in Ruff configuration --------- Co-authored-by: ruslan.golov <ruslan.golov@jetbrains.com> (cherry picked from commit 23191a0)
…fix logic condition in datasource config
…ve prompt logic for required fields
… inputs in context engine CLI
RuslanGolov
left a comment
There was a problem hiding this comment.
This improvement affects the core user experience. I fixed the inspections and some bugs, but I still see them. (For example, you can't cancel entering the datasource name) I can fix this, but perhaps it's better to delegate this task to the development team. Therefore, it needs to be more carefully developed and tested. E2E tests also need to be updated.
|
I fixed most of the bugs and inspections. I'm willing to look at the e2e tests if the Dev team is ready for these changes. |
No description provided.