Skip to content
Back to skills

Shell Completions And Config

ASecurity

Generate shell completions (bash/zsh/fish/PowerShell) from the parser and design config-file discovery + env-var conventions (XDG, TOOL_* prefixes). Use when adding tab completion or a config/env layer to a CLI.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
ai-agentspythonrustgoshellbashnode

Works with

  • cli

Security analysis

A100/100

Scanned September 23, 2026

npx -y skills add mcorbett51090/RavenClaude --skill shell-completions-and-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shell Completions And Config?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shell Completions And Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mcorbett51090-shell-completions-and-config/badge)](https://www.skillsdirectory.com/skills/mcorbett51090-shell-completions-and-config)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shell-completions-and-config
description: "Generate shell completions (bash/zsh/fish/PowerShell) from the parser and design config-file discovery + env-var conventions (XDG, TOOL_* prefixes). Use when adding tab completion or a config/env layer to a CLI."
---

# Shell Completions & Config

## Completions — generate, don't hand-write

Every idiomatic parser can emit completion scripts; never maintain them by hand (they rot the moment a flag changes):

| Parser | Completion generation |
|---|---|
| Cobra (Go) | `cmd.GenBashCompletion` / built-in `completion` subcommand (bash/zsh/fish/pwsh) |
| clap (Rust) | `clap_complete` |
| Click/Typer (Python) | built-in completion install |
| oclif (Node) | `@oclif/plugin-autocomplete` |

Ship a `tool completion <shell>` subcommand (or package the scripts in the release) so users can wire `bash`, `zsh`, `fish`, and `PowerShell`.

## Config-file discovery

Follow the **XDG Base Directory** convention on Linux/macOS:

- User config: `$XDG_CONFIG_HOME/<tool>/config.<ext>` → fallback `~/.config/<tool>/config.<ext>`.
- Project config: a `.<tool>rc` / `<tool>.toml` discovered by walking up from the cwd.
- On Windows use the platform equivalent (`%APPDATA%`).

Prefer one documented format (TOML/YAML/JSON); document the search path in `--help`.

## Env-var conventions

- Prefix every env var with the tool name: `TOOL_TIMEOUT`, `TOOL_CONFIG`.
- Env vars sit **below flags, above config files** in precedence (see the config-precedence prior in [`../../knowledge/cli-tooling-decision-trees.md`](../../knowledge/cli-tooling-decision-trees.md)).
- Honor the cross-tool standards you don't own: `NO_COLOR`, `FORCE_COLOR`, `XDG_*`, `PAGER`, `EDITOR`.

Resolve flags + env + files into **one config object** early, and make `--help` state where settings come from.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…