Skip to content

hide the 'complete' command #164

Open

Description

@jasonnet

Is your feature request related to a problem?

I'm noticing that when I use tab and bash and commander together,

  • the completions list the complete command
  • the (commander) help command lists complete as a command

I suspect that once a developer gets tab working, the need to expose the complete behavior is reduced and it can even be a distraction for the general user community of a given tool.

I'm not seeing a hide() operation or flag.

Describe the solution you'd like

Snooping the source code of tab, I did determine that an app can do the following:

const completion = tab(program)
{ // let's hide the newly added complete command.
  completion.commands.delete('complete')  // remove from completions
  for (let cmd of program.commands) {
    if (cmd._name==='complete') cmd._hidden = true  // hack to hide from help output
  }
}

But this is a hack. I'd like to suggest adding a .hide_complete() method to do this. Or a flag on the second parameter of the tab(program,config) command.

Thanks.

Describe alternatives you've considered

see above.

Additional context

No response

AI assistance disclosure

  • This feature request was drafted with the assistance of an AI tool.

Activity

  1. added
    enhancement
    on Nov 22, 2026
  2. shadowspawn commented on Nov 22, 2026

    @shadowspawn
    Collaborator

    The completion command won't be used by most users, but it is documenting the availability.

    With the Commander integration, you can get slightly nicer help by specifying completionCommandName to split the command for display of the bash script from the command for runtime generation of the suggestions. That allows hiding the generation command from the completion suggestions and help.

  3. jasonnet commented on Nov 22, 2026

    @jasonnet
    Author

    @shadowspawn Thanks for the prompt response.

    Yes, I'm aware that I can split the 'create' command(s) into two and that one is automatically hidden. Thanks for documenting that. And thanks for the clean source code that makes that behavior apparent.

    My thinking, and perhaps that of others, is most users will usually never use 'complete'. Yet for those same users it will clutter the output of help every time they invoke help to understand the core features of the program.... unless the programmer uses a hack like the one I mentioned.

    For those that do use completions, they will use 'complete' once. And almost never after that. So, not zero usage, but still low usage. -- Furthermore the user has hit the tab key to see what commands her can invoke, there's little point in showing him the command that he's already used to set up the completions he has just now used. The fact that he's using completions is a clue there that he has reached a phase where it's now clutter. (Yeah, there are exceptions.)

    But as you say, there is value in having users know that they can do completions. And it is probably perfectly reasonable to leave that as the default. But for some programs, that information is better placed elsewhere. That might be a README. It might be in the wiki. It might be the man/info page. Etc.

    So I'm seeing value in giving the programmer a convenient way to create the experience that seems most appropriate for his app.

    Anyway, thanks again for the prompt response. And thank you for tab. It's a pretty nice tool.

  4. shadowspawn commented on Nov 23, 2026

    @shadowspawn
    Collaborator

    I see your reasoning (and nice clear original post and explanation, thanks), but I personally think it is easiest model to just always have it there. However, I am just one contributor to tab and others may think differently! I suggest leave this issue open for at least a few months to get reactions from other tab users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions