Giter VIP home page Giter VIP logo

kong-completion's Introduction

Tab Completion for kong

kong-completion is a drop-in library that provides tab completion for CLI apps written with kong.

It currently supports the following shells:

  • Bash
  • Zsh
  • Fish

kong-completion provides two main functionalities:

  • It makes a kong app able to intercept and respond to tab completion requests. The completions are automatically derived from kong annotations. They can optionally be enhanced or adjusted with custom predictors.
  • Since users have to manually activate the completion functionality in their shell, kong-completion provides a subcommand that instructs them how to achieve this.

Get Started

See the code of the sample app for how to use the library.

For the Completion subcommand, you can specify the following parameters in the annotation:

  • completion-shell-default
    • Whether completions should fall back to the shell’s default ones, e.g. to complete file paths.
    • Possible values: true, false
    • Default value: true
    • Usage example: completion-shell-default:"false"

In case you want to compile and run the demo app, keep in mind that completions only work for binaries in your $PATH, not for local ones (e.g. with ./ prefix).

About

kong-completion is free and open-source software, distributed under the MIT license.

This library was originally based on kongplete.

kong-completion's People

Contributors

jotaen avatar oxisto avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

oxisto

kong-completion's Issues

Feature request: Disable shell file comparative at the end of the command

Hi,

Really great that finally provided a working completion library for kong. I have a feature request / idea (maybe it is even already implemented and I didn't find it?)

Currently, after all completions are successful, if you enter tab, you still get the file completion from the shell. This is a bit unnecessary and rather confusing. I know that it is possible to turn that off, since cobra uses the ShellCompDirectiveNoFileComp to signal that no file comparison is made. Unfortunately, I do not have enough knowledge about the shell completion system to see how this is actually implemented.

Let me know if I can help in supporting this feature somehow!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.