Skip to content

Improve /export format selection with keyboard navigation #3700

@shenyankm

Description

@shenyankm

What would you like to be added?

Add a smoother keyboard-driven completion flow for the /export command formats.

When users type /export, the completion list should expose the available export formats:

  • html
  • md
  • json
  • jsonl

Users should be able to press the up/down arrow keys to cycle through these formats, and the selected format should be inserted into the input, for example:

/export md
/export json


### Why is this needed?

The `/export` command supports multiple output formats, but selecting the desired format from the completion UI is less efficient than it could be.

A keyboard-driven selection flow makes the command easier to discover and faster to use, especially for users who rely on terminal keyboard navigation. It also reduces the chance of manually typing the wrong format and makes the export formats feel like first-class subcommands in the slash-command UX.

### Additional context

Expected behavior:

1. Type `/export`.
2. The completion list shows `html`, `md`, `json`, and `jsonl`.
3. Press Down to select the next format.
4. The input is filled as `/export md `.
5. Press Down again to cycle to `/export json `.
6. Press Enter to run the selected export command.
7. If the user presses Enter on `/export` without navigating suggestions, the existing default behavior should remain unchanged.

This enhancement is focused on the interactive CLI input experience. It does not change the export file generation logic or the supported export formats.

### Before

<img width="1280" height="1008" alt="Image" src="https://github.com/user-attachments/assets/cf8b7388-cc5b-408c-a004-28c3a2060045" />

### After

<img width="1280" height="1084" alt="Image" src="https://github.com/user-attachments/assets/f24977c7-eefe-438f-9bb8-545f841301c6" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions