Skip to content

feat(cli): add quick access commands to interactive shell help#2659

Open
Devesh36 wants to merge 2 commits into
Tracer-Cloud:mainfrom
Devesh36:cli/newrec
Open

feat(cli): add quick access commands to interactive shell help#2659
Devesh36 wants to merge 2 commits into
Tracer-Cloud:mainfrom
Devesh36:cli/newrec

Conversation

@Devesh36
Copy link
Copy Markdown
Collaborator

This pull request adds a "Quick Access" feature to the interactive shell's help and tab-completion system, making the most important slash commands more visible and accessible to users. It introduces a prioritized list of commands that are shown first when the user types / and updates the help output to include a dedicated "Quick Access" section.

Enhancements to command discoverability and completion:

Quick Access commands and help display

  • Introduced a QUICK_ACCESS_COMMANDS list to define the most important slash commands for quick access, and exposed it in the module's public API. [1] [2]
  • Added a _quick_access_section() function and updated the help sections to include a new "Quick Access" section at the top of the help output, highlighting these commands. [1] [2]

Tab-completion improvements

  • Updated the shell completer so that when the user types a bare /, the quick access commands are shown first in the completion list, followed by the rest of the available slash commands. This uses a precomputed frozenset for efficiency. [1] [2] [3]
  • Refactored completion code to use a helper function _slash_completion for consistency and maintainability. [1] [2]
Screenshot 2026-05-29 at 6 21 18 PM

@github-actions
Copy link
Copy Markdown
Contributor

Greptile code review

This repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md.

Run a review — add a PR comment with:

@greptile review

Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5.

Optional: automate with the greploop skill.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR adds a "Quick Access" section to the interactive shell's help output and tab-completion, surfacing the seven most-used slash commands (/investigate, /integrations, /model, /health, /watch, /status, /help) at the top of both /help all and bare-/ completions.

  • help.py: Introduces QUICK_ACCESS_COMMANDS, the _quick_access_section() builder, and updates _help_sections() to exempt the Quick Access section from the deduplication pass, so canonical sections (Investigation, Integrations & Models, etc.) retain their full command lists.
  • prompt_surface.py: Adds _slash_completion() helper to reduce duplication, precomputes _QUICK_ACCESS_SET as a frozenset at import time, and special-cases the bare-/ trigger to yield quick-access commands first then all remaining commands.

Confidence Score: 5/5

Safe to merge — changes are additive UI/UX improvements to help display and tab-completion with no mutations to command execution logic.

The dedup concern raised in the previous review thread has been correctly addressed: Quick Access is now exempted from the seen set, so canonical sections retain their full command lists. The bare-/ completion arithmetic is correct, the frozenset is precomputed once at import time, and all missing-command cases are handled gracefully. No execution paths, routing logic, or data persistence are touched.

No files require special attention.

Important Files Changed

Filename Overview
app/cli/interactive_shell/command_registry/help.py Adds QUICK_ACCESS_COMMANDS constant, _quick_access_section() builder, and fixes the dedup pass so Quick Access no longer evicts commands from their canonical sections — the previous thread's concern is correctly resolved.
app/cli/interactive_shell/prompting/prompt_surface.py Adds _slash_completion() helper and _QUICK_ACCESS_SET frozenset; refactors bare-/ completion to prioritize quick-access commands with correct start_position=-1 arithmetic.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User types in shell"] --> B{Starts with /? }
    B -- No --> C["Bare-alias completion\n(sorted BARE_COMMAND_ALIASES)"]
    B -- Yes --> D{parts == 1 &\nno trailing space?}
    D -- No --> E["Subcommand / path completion"]
    D -- Yes --> F{needle == '/' exactly?}
    F -- Yes --> G["Yield QUICK_ACCESS_COMMANDS\n(in order, start_position=-1)"]
    G --> H["Yield remaining SLASH_COMMANDS\n(not in _QUICK_ACCESS_SET)"]
    F -- No --> I["Prefix-match all SLASH_COMMANDS\n(start_position=-len needle)"]
Loading

Reviews (2): Last reviewed commit: "enhance help sections by preserving "Qui..." | Re-trigger Greptile

Comment thread app/cli/interactive_shell/command_registry/help.py
@Devesh36
Copy link
Copy Markdown
Collaborator Author

@greptile-apps review again

@Davidson3556
Copy link
Copy Markdown
Contributor

well done ,this is good
@Devesh36

Copy link
Copy Markdown
Collaborator

@muddlebee muddlebee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants