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
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 complishUsage
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_keyExample:
Generate completion for famous file-tranfer tool croc.
complish crocAnd 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/
sourceAt last you will find the completion works when you press <TAB>

Development
Clone this repo.
git clone https://github.com/werifu/complish.gitI use pnpm to manage dependencies:
Install dependencies:
pnpm iCompile TypeScript code and run the compiled JavaScript:
pnpm build
./dist/index.jsor you can run it using ts-node directly:
pnpm devContribute
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)