1.0.8 • Published 10 months ago

@gutenye/commander-completion-carapace v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

⌘ Commander Completion Carapace ⌘

Stars NPM Version License PRs Welcome

Effortlessly add intelligent autocomplete support to your Commander.js CLI app using Carapace. It works with a wide range of shells, making your CLI tools more intuitive and user-friendly.

Show your ❤️ and support by starring this project and following the author, Guten Ye!

screenrecording

🌟 Features

  • Multiple Shells Support: Works with Bash, Zsh, Fish, Nushell, and more.
  • 🚄 Blazing Fast Completion: Experience instantaneous completion with no delays.
  • 🔗 Carapace Integration: Unlock all the powerful features of Carapace, including advanced shell completions.
  • 🧑‍💻 Effortless Integration: Easily add completion support to your Commander.js based CLI app.

🚀 Getting Started

1️⃣ Install

First, make sure Carapace is installed, as it powers the completion functionality:

bun add @gutenye/commander-completion-carapace commander

2️⃣ Write Completion Code

Now, integrate completion support into your Commander.js application by adding the following code:

import { program, Option } from '@gutenye/commander-completion-carapace'

program
  .name('hello')
  .enableCompletion()

program.command('cmd1 [...files]')
  .description('Description')
  .option('--option1', 'Description')
  .completion({   // pass to carapace 
    positonalany: ['$files'] // dynamic completion
  })
  .action(() => {})

await program.installCompletion() // Creates hello.yaml Carapace spec file

program.parse()

3️⃣ Use the Completion

hello      # Will create the Carapace spec file the first time it runs
hello<Tab> # Press Tab to see completions for commands and options

🤝 Contribute

We welcome contributions! Whether it’s bug reports, feature suggestions, or pull requests, your involvement makes this project better.

How to Contribute:

  1. Fork the Repository
  2. Open a Pull Request on Github

Thank you for using Commander Completion Carapace! ✨ If you found it helpful, please ⭐️ star the project ️️⭐ on GitHub. If you encounter any issues, feel free to report an issue on Github.

Special thanks to all the contributors:

npm.io

⬆ Back to top ⬆

1.0.8

10 months ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago