nushell / nushell/reedline

Completion based on man page/help page and/or zsh

Open
#508 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Completions enhancement
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

The current completion system is quite poor: it is impossible to generate completion for command arguments without manually writting an extern completion for any new command. Carapace-bin and the user script repository provide some pre-made extern for some commands, but the list of supported commands is really small. In any case, it can't generate completion for tools that have not been manually added.

On the other hand, fish has a python script that parses man pages to generate automatically the completion. It would be great to have it in nushell. Here is the repo that adapts the script for bash: https://github.com/nevesnunes/sh-manpage-completions

We could also maybe parse bash/zsh completion files to get more completions for free. For instance this project has a great autocomplete functionality (no idea how it's working…), it can even complete nix packages when typing nix-shell -p vim, even as you type: https://github.com/marlonrichert/zsh-autocomplete/

References

Fish script adapted to bash: https://github.com/nevesnunes/sh-manpage-completions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, entry points, or tests are named. Start by reviewing Reedline's existing completion system, then compare the referenced fish-to-Bash man-page script and zsh completion approach. Done would require an agreed design and working automatic completion beyond manually added extern completions.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, fish, rust, zsh
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.