thehardwarestore.ai

where AI agents shop for the right tools

── 99288 repos indexed ── | filtered by tag: #shell-completions
spf13/cobra ★ 44680 4918 APPLICATION

Cobra is a Go library for building command-line interfaces (CLIs). It provides a `Command` struct that represents a single command, including its name, aliases, short/long descriptions, subcommands, flags, argument validation, and lifecycle hooks (PreRun, Run, PostRun). The library integrates with `spf13/pflag` for POSIX-compliant flag parsing, supporting persistent flags, local flags, and flag groups with mutual exclusivity, required-together, and one-required constraints. Cobra also includes a built-in shell completion framework that generates dynamic completions for bash, zsh, fish, and PowerShell, and a documentation generation package that outputs man pages, Markdown, reStructuredText, and YAML from the command tree. Architecturally, the library is centered around a tree of `Command` objects, where each command can have subcommands. The root command is typically created in the application's `main()` function, and `Execute()` or `ExecuteC()` is called to run the CLI. The library uses a global mutable state for configuration options like prefix matching, case-insensitive completion, and traversal run hooks, which can be a source of subtle bugs in concurrent or library usage. Key entry points include `Command.Execute()`, `Command.AddCommand()`, `Command.Flags()`, `Command.PersistentFlags()`, and the completion generation functions like `GenBashCompletion()`. The library is heavily tested with unit tests covering argument validation, flag groups, completions, and documentation generation, and it maintains broad backward compatibility across Go versions 1.17–1.24. Cobra is designed for reuse; its argument validators (`args.go`), flag group helpers (`flag_groups.go`), and completion directives (`completions.go`) are clean, isolated patterns that can be extracted and applied to other Go projects with minimal modification. However, the core `Command` struct and its associated methods are tightly coupled and would require importing the entire cobra module. The library is widely adopted by major projects like Kubernetes, Helm, Hugo, and GitHub CLI, demonstrating its reliability and impact.

RATING: 9.7/10 MAINT: active DRIFT: low
▸ 2 reusable components found
Fission-AI/OpenSpec ★ 70983 4867 APPLICATION

OpenSpec is an AI-native spec-driven development CLI tool that provides a lightweight agreement layer between humans and AI coding assistants. It manages structured 'changes' with proposals, delta specs, designs, and tasks, supporting 30+ AI coding tools (Claude, Cursor, Devin, Copilot, etc.) by generating per-tool skills and slash commands. The CLI features a store system for cross-repo planning, an artifact graph for tracking change progress, shell completion generation, and a validation system. The codebase is well-structured with extensive test coverage, reusable components (artifact graph, markdown parser, command generation adapters, store foundation), and security-conscious patterns (atomic writes, prototype pollution guards). It is actively maintained with a large community (70k+ stars).

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 5 reusable components found
google/argh ★ 1954 102 APPLICATION

Argh is an opinionated derive-based argument parsing library for Rust, optimized for code size and conformance to Fuchsia CLI specifications. The repository is a multi-crate workspace: `argh` (public API, re-exports derive macros and provides runtime functions like `from_env`), `argh_derive` (proc-macro implementation of `FromArgs`, `FromArgValue`, and `ArgsInfo`), `argh_shared` (shared data structures for command metadata, used by both derive and completion crates), and `argh_complete` (generators for bash, zsh, fish, and nushell shell completions). The core architecture uses a derive macro to generate parsing code at compile time, producing minimal binary size. It supports switches, options (required, optional, repeating), positional arguments (including greedy/remainder), subcommands (static and dynamic), custom parsers via `FromArgValue`, default values, and extensive help/usage formatting with notes, examples, and error codes. The library is well-tested with unit tests, compile-fail UI tests, and integration tests. It is designed as a lightweight alternative to clap, prioritizing code size and compile-time speed.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 3 reusable components found
rgcr/m-cli ★ 9920 316 APPLICATION

m-cli is a macOS command-line utility that provides a unified interface for managing system settings, preferences, and services. It consists of a main dispatcher script (`m`) and over 40 plugin scripts, each handling a specific macOS subsystem (e.g., Wi-Fi, Bluetooth, display, dock, permissions). The architecture is a simple plugin-based monolith: the main script resolves the plugin path and delegates execution. Plugins follow a consistent pattern with `--help` output that is parsed by shell completion scripts to dynamically generate completions for bash, zsh, and fish. The codebase is entirely written in Bash (with one Python plugin for screen lock) and relies on macOS native commands (`defaults`, `osascript`, `systemsetup`, `diskutil`, etc.). It is well-structured, with clear separation of concerns, standardized option parsing, and a small test suite using Bats. While the plugins are tightly coupled to macOS, the overall architecture and the dynamic completion generation pattern are reusable concepts.

RATING: 8.3/10 MAINT: active DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: