Skip to content

feat: CLI syntax highlighting, hints, and subcommand completion - #75

Merged
kacy merged 2 commits into
mainfrom
feat/cli-polish
Feb 10, 2026
Merged

feat: CLI syntax highlighting, hints, and subcommand completion#75
kacy merged 2 commits into
mainfrom
feat/cli-polish

Conversation

@kacy

@kacy kacy commented Feb 10, 2026

Copy link
Copy Markdown
Owner

summary

makes the CLI feel polished with three improvements:

  • syntax highlighting — known commands in bold cyan, unknown in red, quoted strings in green. re-highlights on every keystroke for real-time feedback.
  • inline hints — shows argument synopsis (dimmed) after typing a command and a space. for multi-word commands (CLUSTER, SLOWLOG, PUBSUB), shows available subcommands as a hint.
  • subcommand completion — tab-completes the second token for CLUSTER (14 subcommands), SLOWLOG (3), and PUBSUB (3). also completes local commands (help, quit, exit, clear).

what was tested

  • 47 CLI tests pass (up from 32), including:
    • 5 highlighter tests (known/unknown/local commands, empty line, quoted strings)
    • 4 hinter tests (args for known commands, subcommands for CLUSTER, unknown command, cursor position)
    • 6 subcommand metadata tests (cluster/slowlog/pubsub content, sorting, unknown parent)
  • cargo clippy --workspace -- -D warnings clean
  • manual verification: typed commands show correct colors, hints appear, tab completion works for subcommands

kacy added 2 commits February 9, 2026 20:49
add subcommands() and has_subcommands() functions to support
second-token completion and hints for multi-word commands.
- highlighter: bold/cyan for known commands, red for unknown, green
  for quoted strings. re-highlights on every keystroke.
- hinter: shows argument synopsis for known commands, subcommand list
  for CLUSTER/SLOWLOG/PUBSUB, partial subcommand completion.
- completer: extends to complete subcommands for multi-word commands
  and local commands (help, quit, exit, clear).
- hints rendered in dim text.
@kacy
kacy merged commit f6b7281 into main Feb 10, 2026
6 of 7 checks passed
@kacy
kacy deleted the feat/cli-polish branch February 10, 2026 01:52
kacy added a commit that referenced this pull request Feb 11, 2026
* feat: add subcommand metadata for CLUSTER, SLOWLOG, and PUBSUB

add subcommands() and has_subcommands() functions to support
second-token completion and hints for multi-word commands.

* feat: add syntax highlighting, inline hints, and subcommand completion

- highlighter: bold/cyan for known commands, red for unknown, green
  for quoted strings. re-highlights on every keystroke.
- hinter: shows argument synopsis for known commands, subcommand list
  for CLUSTER/SLOWLOG/PUBSUB, partial subcommand completion.
- completer: extends to complete subcommands for multi-word commands
  and local commands (help, quit, exit, clear).
- hints rendered in dim text.
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