Skip to content
Back to skills

Cli Hygiene

ASecurity

Scan CLI source for output-encoding risks, interpreter assumptions, unquoted heredoc expansion, Windows batch spawning, and hook errexit. Use for portability reviews or requested CLI hygiene checks.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 6, 2026
ai-agentspythonshellbashexpress

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add fakoli/fakoli-plugins --skill cli-hygiene --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cli Hygiene?

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

Security grade badge for Cli Hygiene
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fakoli-cli-hygiene/badge)](https://www.skillsdirectory.com/skills/fakoli-cli-hygiene)

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: cli-hygiene
description: Scan CLI source for output-encoding risks, interpreter assumptions, unquoted heredoc expansion, Windows batch spawning, and hook errexit. Use for portability reviews or requested CLI hygiene checks.
---

# CLI Hygiene

Resolve `<plugin-root>` from the loaded skill (`../..`) or host plugin-root variable. The scanner needs Python 3.10+; its Bash wrapper chooses `python3` or `python`.

```bash
python "<plugin-root>/scripts/scan_cli_hygiene.py" [PATH ...] --json
bash "<plugin-root>/scripts/scan-cli-hygiene.sh" [PATH ...]
```

No paths means the current directory. Default findings are advisory (exit 0); `--fail-on-findings` returns 1 for findings. Unreadable/missing inputs return 2 and are not a clean scan. Report limits alongside findings.

- `NON_ASCII_OUTPUT`: check the actual console/redirected encoding; some non-ASCII characters are valid in legacy codepages.
- `PYTHON3_HARDCODE`: prefer `sys.executable` for Python children or explicitly resolve an installed interpreter.
- `UNQUOTED_HEREDOC`: shell expressions expand; quote the delimiter when literal data is intended. Literal `\n` and `\t` are not inherently broken.
- `CMD_SPAWN`: inspect how batch files launch and keep user data out of shell command strings.
- `SET_E_HOOK`: both `set -euo` and `set -o errexit` enable early exit. Handle expected probe failures explicitly.

These are line-based heuristics, not a full language parser or proof of Windows compatibility. Comments and common generated directories are skipped. Run targeted native tests when available; do not claim a Windows run from this scan alone. Apply fixes when already requested. See [README](../../README.md).

Files in this skill

  • SKILL.md1.6 KB
  • agents/openai.yaml172 B

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.