JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q43477F
  • License MIT

Complish - Generate completion file for your CLI in fish-shell via chatGPT.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (complish) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    complish

    license release

    English | 简体中文

    Generate completion file for your CLI in fish-shell via chatGPT.

    Complish is a tool to generate fish-completion file for any type of CLI.

    The tool uses chatGPT API to parse the help page of a CLI (the text printed when executing cmd --help) and output structured information about this help page. Then generate a fish completion script, for details of fish completion, see fish-completion.

    Not using Fish shell now? I strongly recommend it! https://fishshell.com/

    Installing

    npm i -g complish

    Usage

    complish [options] [cmd]

    Environment OPENAI_API_KEY is needed first. If you have no the key, you can apply for one on OpenAI and remember to keep secret!

    export OPENAI_API_KEY=your_openai_api_key

    Example:

    Generate completion for famous file-tranfer tool croc.

    complish croc

    And you will find croc.fish in your current directory when the script finished.

    Then copy the fish script to the completions directory of fish shell for which the file can be automatically loaded. Other available directories can see here

    cp ./croc.fish ~/.config/fish/completions/
    source

    At last you will find the completion works when you press <TAB>

    Development

    Clone this repo.

    git clone https://github.com/werifu/complish.git

    I use pnpm to manage dependencies:

    Install dependencies:

    pnpm i

    Compile TypeScript code and run the compiled JavaScript:

    pnpm build
    ./dist/index.js

    or you can run it using ts-node directly:

    pnpm dev

    Contribute

    Pull requests / issues are both welcome!

    Please give me your suggestions! 😊

    TODO

    • Text clip (too long help page cannot be handled by chatGPT)
    • Reduce API calling times (bottle neck of this tool)
    • More detail arguments completion (now only using --require-parameter)