Optique 0.6.0: Shell completion support for type-safe CLI parsers

https://hackers.pub/@hongminhee/2025/optique-060

Optique 0.6.0: Shell completion support for type-safe CLI parsers

Optique 0.6.0 introduces intelligent shell completion to type-safe command-line applications, supporting Bash, zsh, fish, PowerShell, and Nushell. Unlike traditional CLI frameworks, Optique leverages the same parser structure for both argument parsing and completion, eliminating duplicate definitions and ensuring synchronization. Setting up completion is straightforward, with users generating and sourcing a completion script for their shell. The system works automatically with all Optique parser types, offering context-aware suggestions, including file system completion and custom logic for domain-specific value parsers. Additionally, the release enhances command documentation with separate brief, description, and footer texts, and introduces a `commandLine()` message term for clearer command-line examples in help text. Existing Optique users can easily migrate by adding a `completion` option to their `run()` configuration. This release aims to make Optique-based CLIs more user-friendly without sacrificing type safety and composability, providing sophisticated runtime features while maintaining compile-time guarantees.

Hackers' Pub

Did you know that you can now install shell tab completion rules for every ronin command?

ronin completion --install

#ronin #roninrb #protip #tabcompletion #shellcompletion

What would be a good defacto directory for gems to store their shell completion files?
#ruby #shellcompletion #bashcompletion #rubygems
completions
45.5%
completions.d
27.3%
data/completions
0%
data/completions.d
27.3%
Poll ended at .
Released command_kit-completion 0.1.0. Automatically generates shell completion rules for a command_kit CLI app.
https://github.com/postmodern/command_kit-completion#readme
#ruby #command_kit #bashcompletion #shellcompletion #cli
GitHub - postmodern/command_kit-completion: Generate shell completions for command_kit commands

Generate shell completions for command_kit commands - GitHub - postmodern/command_kit-completion: Generate shell completions for command_kit commands

GitHub

How would/should a Ruby CLI install it's own custom shell completion rules? A global option that prints the completion script out? A global option that attempts to install the completion script into the correct shell directory, based on shell and whether the user is root or not. Or maybe a sub-command that prints and/or installs the shell completion script?

I kind of wish rubygems had support for installing custom completion rules.
#ruby #shellcompletion #bashcompletion