Skip to content

Instantly share code, notes, and snippets.

@xpn
Created November 3, 2025 20:58
Show Gist options
  • Select an option

  • Save xpn/a43ba31a74ca3beea5b631237818eb46 to your computer and use it in GitHub Desktop.

Select an option

Save xpn/a43ba31a74ca3beea5b631237818eb46 to your computer and use it in GitHub Desktop.
safeCommandsAndArgs = {
xargs: {
safeFlags: {
"-I": "{}",
"-i": "none",
"-n": "number",
"-P": "number",
"-L": "number",
"-s": "number",
"-E": "EOF",
"-e": "EOF",
"-0": "none",
"-t": "none",
"-r": "none",
"-x": "none",
"-d": "char"
}
},
"git diff": {
safeFlags: {
"--stat": "none",
"--numstat": "none",
"--shortstat": "none",
"--dirstat": "none",
"--summary": "none",
"--patch-with-stat": "none",
"--name-only": "none",
"--name-status": "none",
"--color": "none",
"--no-color": "none",
"--word-diff": "none",
"--word-diff-regex": "string",
"--color-words": "none",
"--no-renames": "none",
"--no-ext-diff": "none",
"--check": "none",
"--ws-error-highlight": "string",
"--full-index": "none",
"--binary": "none",
"--abbrev": "number",
"--break-rewrites": "none",
"--find-renames": "none",
"--find-copies": "none",
"--find-copies-harder": "none",
"--irreversible-delete": "none",
"--diff-algorithm": "string",
"--histogram": "none",
"--patience": "none",
"--minimal": "none",
"--ignore-space-at-eol": "none",
"--ignore-space-change": "none",
"--ignore-all-space": "none",
"--ignore-blank-lines": "none",
"--inter-hunk-context": "number",
"--function-context": "none",
"--exit-code": "none",
"--quiet": "none",
"--cached": "none",
"--staged": "none",
"--pickaxe-regex": "none",
"--pickaxe-all": "none",
"--no-index": "none",
"--relative": "string",
"-p": "none",
"-u": "none",
"-s": "none",
"-M": "none",
"-C": "none",
"-B": "none",
"-D": "none",
"-l": "none",
"-S": "none",
"-G": "none",
"-O": "none",
"-R": "none"
}
},
"git log": {
safeFlags: {
"--oneline": "none",
"--stat": "none",
"--numstat": "none",
"--shortstat": "none",
"--name-only": "none",
"--name-status": "none",
"--graph": "none",
"--color": "none",
"--no-color": "none",
"--decorate": "none",
"--no-decorate": "none",
"--abbrev-commit": "none",
"--full-history": "none",
"--dense": "none",
"--sparse": "none",
"--simplify-merges": "none",
"--ancestry-path": "none",
"--date": "string",
"--relative-date": "none",
"--all": "none",
"--branches": "none",
"--tags": "none",
"--remotes": "none",
"--first-parent": "none",
"--merges": "none",
"--no-merges": "none",
"--reverse": "none",
"--walk-reflogs": "none",
"--grep": "string",
"--author": "string",
"--committer": "string",
"--since": "string",
"--after": "string",
"--until": "string",
"--before": "string",
"--max-count": "number",
"--skip": "number",
"--max-age": "number",
"--min-age": "number",
"--no-min-parents": "none",
"--no-max-parents": "none",
"--follow": "none",
"--patch": "none",
"-p": "none",
"--no-patch": "none",
"--no-ext-diff": "none",
"-s": "none",
"-n": "number"
}
},
"git show": {
safeFlags: {
"--stat": "none",
"--numstat": "none",
"--shortstat": "none",
"--name-only": "none",
"--name-status": "none",
"--color": "none",
"--no-color": "none",
"--abbrev-commit": "none",
"--oneline": "none",
"--graph": "none",
"--decorate": "none",
"--no-decorate": "none",
"--date": "string",
"--relative-date": "none",
"--word-diff": "none",
"--word-diff-regex": "string",
"--color-words": "none",
"--no-patch": "none",
"--no-ext-diff": "none",
"--patch": "none",
"--pretty": "string",
"-s": "none",
"-p": "none",
"--quiet": "none"
}
},
"git reflog": {
safeFlags: {
"--date": "string",
"--relative-date": "none",
"--all": "none",
"--branches": "none",
"--tags": "none",
"--remotes": "none",
"--grep": "string",
"--author": "string",
"--committer": "string",
"--since": "string",
"--after": "string",
"--until": "string",
"--before": "string",
"--max-count": "number",
"-n": "number",
"--oneline": "none",
"--graph": "none",
"--decorate": "none",
"--no-decorate": "none"
}
},
"git stash list": {
safeFlags: {
"--oneline": "none",
"--graph": "none",
"--decorate": "none",
"--no-decorate": "none",
"--date": "string",
"--relative-date": "none",
"--all": "none",
"--branches": "none",
"--tags": "none",
"--remotes": "none",
"--max-count": "number",
"-n": "number"
}
},
"git ls-remote": {
safeFlags: {
"--branches": "none",
"-b": "none",
"--tags": "none",
"-t": "none",
"--heads": "none",
"-h": "none",
"--refs": "none",
"--quiet": "none",
"-q": "none",
"--exit-code": "none",
"--get-url": "none",
"--symref": "none",
"--sort": "string",
"--server-option": "string",
"-o": "string"
}
},
file: {
safeFlags: {
"--brief": "none",
"-b": "none",
"--mime": "none",
"-i": "none",
"--mime-type": "none",
"--mime-encoding": "none",
"--apple": "none",
"--check-encoding": "none",
"-c": "none",
"--exclude": "string",
"--exclude-quiet": "string",
"--print0": "none",
"-0": "none",
"-f": "string",
"-F": "string",
"--separator": "string",
"--help": "none",
"--version": "none",
"-v": "none",
"--no-dereference": "none",
"-h": "none",
"--dereference": "none",
"-L": "none",
"--magic-file": "string",
"-m": "string",
"--keep-going": "none",
"-k": "none",
"--list": "none",
"-l": "none",
"--no-buffer": "none",
"-n": "none",
"--preserve-date": "none",
"-p": "none",
"--raw": "none",
"-r": "none",
"-s": "none",
"--special-files": "none",
"--uncompress": "none",
"-z": "none"
}
},
sed: {
safeFlags: {
"--expression": "string",
"-e": "string",
"--quiet": "none",
"--silent": "none",
"-n": "none",
"--regexp-extended": "none",
"-r": "none",
"--posix": "none",
"-E": "none",
"--line-length": "number",
"-l": "number",
"--zero-terminated": "none",
"-z": "none",
"--separate": "none",
"-s": "none",
"--unbuffered": "none",
"-u": "none",
"--debug": "none",
"--help": "none",
"--version": "none"
},
additionalCommandIsDangerousCallback: additionalSEDChecks
},
"pip list": {
safeFlags: {
"--outdated": "none",
"-o": "none",
"--uptodate": "none",
"-u": "none",
"--editable": "none",
"-e": "none",
"--local": "none",
"-l": "none",
"--user": "none",
"--pre": "none",
"--format": "string",
"--not-required": "none",
"--exclude-editable": "none",
"--include-editable": "none",
"--exclude": "string",
"--help": "none",
"-h": "none",
"--version": "none",
"-V": "none",
"--verbose": "none",
"-v": "none",
"--quiet": "none",
"-q": "none",
"--no-color": "none",
"--no-input": "none",
"--disable-pip-version-check": "none",
"--no-python-version-warning": "none"
}
},
sort: {
safeFlags: {
"--ignore-leading-blanks": "none",
"-b": "none",
"--dictionary-order": "none",
"-d": "none",
"--ignore-case": "none",
"-f": "none",
"--general-numeric-sort": "none",
"-g": "none",
"--human-numeric-sort": "none",
"-h": "none",
"--ignore-nonprinting": "none",
"-i": "none",
"--month-sort": "none",
"-M": "none",
"--numeric-sort": "none",
"-n": "none",
"--random-sort": "none",
"-R": "none",
"--reverse": "none",
"-r": "none",
"--sort": "string",
"--stable": "none",
"-s": "none",
"--unique": "none",
"-u": "none",
"--version-sort": "none",
"-V": "none",
"--zero-terminated": "none",
"-z": "none",
"--key": "string",
"-k": "string",
"--field-separator": "string",
"-t": "string",
"--check": "none",
"-c": "none",
"--check-char-order": "none",
"-C": "none",
"--merge": "none",
"-m": "none",
"--buffer-size": "string",
"-S": "string",
"--parallel": "number",
"--batch-size": "number",
"--help": "none",
"--version": "none"
}
},
man: {
safeFlags: {
"-a": "none",
"--all": "none",
"-d": "none",
"-f": "none",
"--whatis": "none",
"-h": "none",
"-k": "none",
"--apropos": "none",
"-l": "string",
"-w": "none",
"-S": "string",
"-s": "string"
}
},
"npm list": {
safeFlags: {
"--all": "none",
"-a": "none",
"--json": "none",
"--long": "none",
"-l": "none",
"--global": "none",
"-g": "none",
"--depth": "number",
"--omit": "string",
"--include": "string",
"--link": "none",
"--workspace": "string",
"-w": "string",
"--workspaces": "none",
"-ws": "none"
}
},
netstat: {
safeFlags: {
"-a": "none",
"-L": "none",
"-l": "none",
"-n": "none",
"-f": "string",
"-g": "none",
"-i": "none",
"-I": "string",
"-s": "none",
"-r": "none",
"-m": "none",
"-v": "none"
}
},
base64: {
safeFlags: {
"-d": "none",
"-D": "none",
"--decode": "none",
"-b": "number",
"--break": "number",
"-w": "number",
"--wrap": "number",
"-i": "string",
"--input": "string",
"--ignore-garbage": "none",
"-h": "none",
"--help": "none",
"--version": "none"
}
},
grep: {
safeFlags: {
"-e": "string",
"--regexp": "string",
"-f": "string",
"--file": "string",
"-F": "none",
"--fixed-strings": "none",
"-G": "none",
"--basic-regexp": "none",
"-E": "none",
"--extended-regexp": "none",
"-P": "none",
"--perl-regexp": "none",
"-i": "none",
"--ignore-case": "none",
"--no-ignore-case": "none",
"-v": "none",
"--invert-match": "none",
"-w": "none",
"--word-regexp": "none",
"-x": "none",
"--line-regexp": "none",
"-c": "none",
"--count": "none",
"--color": "string",
"--colour": "string",
"-L": "none",
"--files-without-match": "none",
"-l": "none",
"--files-with-matches": "none",
"-m": "number",
"--max-count": "number",
"-o": "none",
"--only-matching": "none",
"-q": "none",
"--quiet": "none",
"--silent": "none",
"-s": "none",
"--no-messages": "none",
"-b": "none",
"--byte-offset": "none",
"-H": "none",
"--with-filename": "none",
"-h": "none",
"--no-filename": "none",
"--label": "string",
"-n": "none",
"--line-number": "none",
"-T": "none",
"--initial-tab": "none",
"-u": "none",
"--unix-byte-offsets": "none",
"-Z": "none",
"--null": "none",
"-z": "none",
"--null-data": "none",
"-A": "number",
"--after-context": "number",
"-B": "number",
"--before-context": "number",
"-C": "number",
"--context": "number",
"--group-separator": "string",
"--no-group-separator": "none",
"-a": "none",
"--text": "none",
"--binary-files": "string",
"-D": "string",
"--devices": "string",
"-d": "string",
"--directories": "string",
"--exclude": "string",
"--exclude-from": "string",
"--exclude-dir": "string",
"--include": "string",
"-r": "none",
"--recursive": "none",
"-R": "none",
"--dereference-recursive": "none",
"--line-buffered": "none",
"-U": "none",
"--binary": "none",
"--help": "none",
"-V": "none",
"--version": "none"
}
},
rg: {
safeFlags: {
"-e": "string",
"--regexp": "string",
"-f": "string",
"-i": "none",
"--ignore-case": "none",
"-S": "none",
"--smart-case": "none",
"-F": "none",
"--fixed-strings": "none",
"-w": "none",
"--word-regexp": "none",
"-v": "none",
"--invert-match": "none",
"-c": "none",
"--count": "none",
"-l": "none",
"--files-with-matches": "none",
"--files-without-match": "none",
"-n": "none",
"--line-number": "none",
"-o": "none",
"--only-matching": "none",
"-A": "number",
"--after-context": "number",
"-B": "number",
"--before-context": "number",
"-C": "number",
"--context": "number",
"-H": "none",
"-h": "none",
"--heading": "none",
"--no-heading": "none",
"-q": "none",
"--quiet": "none",
"--column": "none",
"-g": "string",
"--glob": "string",
"-t": "string",
"--type": "string",
"-T": "string",
"--type-not": "string",
"--type-list": "none",
"--hidden": "none",
"--no-ignore": "none",
"-u": "none",
"-m": "number",
"--max-count": "number",
"-d": "number",
"--max-depth": "number",
"-a": "none",
"--text": "none",
"-z": "none",
"-L": "none",
"--follow": "none",
"--color": "string",
"--json": "none",
"--stats": "none",
"--help": "none",
"--version": "none",
"--debug": "none",
"--": "none"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment