Agent skill · laurigates
typer-cli-completion
Generate Typer/Click shell completions from a non-shell parent, bypassing shellingham. Use when `--install-completion` prints "Shell None is not supported", or when generating them in CI or Docker.
What it needs
About 3k tokens when loaded.
What this skill does
Typer/Click CLI Completion: Bypass shellingham Python CLIs built on [Typer] (and [Click] under it) ship --install-completion and --show-completion, which rely on shellingham to detect the parent shell. shellingham walks the parent process tree (/proc/$PPID/comm-style), not $SHELL. When the parent is anything other than a known shell, detection raises ShellDetectionFailure and Typer prints: Setting $SHELL=/bin/zsh does not help. shellingham ignores the env var by design — the point is to detect the real running shell, not to trust what the environment claims. When the failure mode bites Parent process Outcome --- --- Your interactive zsh / bash Works — shellingham detects the shell An agent runtime (Claude Code, a node host) Fails — node isn't a shell GitHub Actions runner Fails — bash -e from Runner.Worker doesn't always classify Docker entrypoint (sh -c …) Often fails — depends on the entrypoint chain A uv-installed tool invoked as a subprocess from Python Fails — parent is python A dotfiles manager running a completion generator (chezmoi apply) Fails — parent is chezmoi The common shape: anything that generates completions non-interactively. That is precisely when you want to generate them — at install time, in a container build, from a dotfiles apply — so the happy path is the one case that does not need the feature. The fix: an explicit completion <shell> subcommand Take the shell name as an argument and call Click's completion machinery directly: After this lands, generation works from any parent process: completevar is the env var Click reads at completion time to dispatch the runtime callback. Use the conventional Click form: <PROGNAME>COMPLETE, with - replaced by , uppercased. Getting it wrong fails silently — the script installs and simply never completes. Wiring to a completion registry A dotfiles-style registry that iterates a tool → command table and writes ~/.zfunc/<tool> needs one line per CLI once the subcommand exists. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills laurigates/typer-cli-completion