bash-classify 0.3.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.claude-plugin/marketplace.json +1 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/PKG-INFO +1 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/SPEC.md +43 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/coding-agent-plugins/claude-code/.claude-plugin/plugin.json +1 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/docs/classification-guidance.md +44 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/schemas/command.schema.json +11 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/git.yaml +3 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gradle.yaml +34 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gradlew.yaml +34 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/mvn.yaml +30 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/mvnw.yaml +30 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/poetry.yaml +2 -0
- bash_classify-0.4.1/src/bash_classify/commands/pup.yaml +572 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/uv.yaml +2 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/database.py +10 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/matcher.py +65 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/models.py +8 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_matcher.py +75 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_models.py +7 -1
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_real_world.py +32 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.claude/rules/command-database.md +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.editorconfig +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.github/workflows/ci.yml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.github/workflows/publish.yml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.gitignore +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/.python-version +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/CLAUDE.md +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/LICENSE +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/README.md +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/coding-agent-plugins/claude-code/hooks/classify-bash.sh +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/coding-agent-plugins/claude-code/hooks/hooks.json +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/pyproject.toml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/ruff.toml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/__init__.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/__main__.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/classifier.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/cli.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/agent-browser.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/apt.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/awk.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/basename.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/bash-classify.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/bash.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/black.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/brew.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/builtin.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/cargo.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/cat.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/chgrp.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/chmod.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/chown.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/column.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/comm.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/command.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/cp.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/curl.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/cut.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/date.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/df.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/diff.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/dig.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/dirname.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/docker.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/du.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/echo.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/env.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/eslint.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/expand.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/false.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/file.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/find.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/fmt.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/fold.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/free.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gawk.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gcloud.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gh.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/glab-discussion.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/glab.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/go.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/grep.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/groups.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gunzip.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/gzip.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/hadolint.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/head.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/helm.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/hostname.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/id.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/install.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/isort.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/java.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/javac.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/join.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/journalctl.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/jq.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/kill.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/killall.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/kubectl.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/less.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ln.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ls.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/make.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/md5sum.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/mkdir.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/more.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/mv.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/mypy.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/netstat.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/nice.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/nl.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/node.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/nohup.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/npm.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/npx.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/nslookup.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/paste.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ping.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/pip.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/pip3.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/pipx.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/pkill.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/prettier.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/printenv.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/printf.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ps.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/pwd.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/pytest.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/python.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/python3.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/read.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/readlink.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/realpath.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/rev.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/rg.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/rm.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/rsync.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ruff.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/scp.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/sed.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/seq.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/sh.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/sha1sum.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/sha256sum.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/shellcheck.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/sort.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ss.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/ssh.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/stat.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/strace.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/sudo.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/systemctl.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/tac.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/tail.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/tar.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/tee.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/terraform.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/test.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/time.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/timeout.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/top.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/touch.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/tr.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/traceroute.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/true.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/tsc.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/type.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/uname.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/unexpand.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/uniq.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/unzip.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/uptime.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/wc.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/wget.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/whereis.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/which.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/whoami.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/xargs.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/xmllint.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/yarn.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/yes.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/yq.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/zip.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/commands/zsh.yaml +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/parser.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/src/bash_classify/py.typed +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/__init__.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/conftest.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_classifier.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_cli.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_cli_serialization.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_database.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_parser.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_schema.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/tests/test_smoke.py +0 -0
- {bash_classify-0.3.0 → bash_classify-0.4.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bash-classify
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Classify bash commands as READONLY, WRITE, DANGEROUS, or UNKNOWN
|
|
5
5
|
Project-URL: Homepage, https://github.com/fprochazka/bash-classify
|
|
6
6
|
Project-URL: Repository, https://github.com/fprochazka/bash-classify
|
|
@@ -345,6 +345,48 @@ The database defines which options take values, so the parser knows whether `-n
|
|
|
345
345
|
|
|
346
346
|
If the matched subcommand has `strict: true` (default), any unrecognized option makes the command `UNKNOWN`. If `strict: false`, unrecognized options are ignored (useful for commands with too many harmless flags to enumerate).
|
|
347
347
|
|
|
348
|
+
### Subcommand matching modes
|
|
349
|
+
|
|
350
|
+
The `subcommand_mode` field controls how positional arguments are matched against the subcommand dictionary. There are two modes:
|
|
351
|
+
|
|
352
|
+
#### `hierarchical` (default)
|
|
353
|
+
|
|
354
|
+
The default mode. Subcommands are matched as a greedy chain through nested subcommand dictionaries. Each matched subcommand narrows the context to its own subcommand dict.
|
|
355
|
+
|
|
356
|
+
Example: `kubectl rollout status` matches `kubectl` → `rollout` → `status`, walking the tree.
|
|
357
|
+
|
|
358
|
+
#### `match_all`
|
|
359
|
+
|
|
360
|
+
Each positional argument is matched independently against the **same** top-level subcommand dictionary. This is designed for build tools like Maven and Gradle where multiple goals/tasks appear as positional arguments in any order.
|
|
361
|
+
|
|
362
|
+
Example: `mvn clean install` matches both `clean` and `install` independently against `mvn`'s subcommand dict.
|
|
363
|
+
|
|
364
|
+
**Classification/risk aggregation in `match_all` mode:**
|
|
365
|
+
|
|
366
|
+
- The final classification is the **maximum severity** across all matched goals.
|
|
367
|
+
- The final risk is the **maximum** across all matched goals' risks.
|
|
368
|
+
- If any positional argument is **unrecognized** (not in the subcommand dict), the command's base classification and risk are included in the aggregation.
|
|
369
|
+
- If **no goals match** (no positional args or all unrecognized), the command's base classification and risk apply.
|
|
370
|
+
- Option overrides (e.g. `--dry-run`) take precedence over goal aggregation — they replace the classification as usual.
|
|
371
|
+
- The `strict` mode only applies to **options** (flags starting with `-`), not to unrecognized positional arguments. Unrecognized goals do not cause UNKNOWN classification.
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
argv: ["mvn", "-B", "clean", "deploy"]
|
|
375
|
+
|
|
376
|
+
Step 1: binary lookup → found "mvn" in database (subcommand_mode: match_all)
|
|
377
|
+
Step 2: strip global options → none
|
|
378
|
+
Step 3: subcommand matching (match_all mode)
|
|
379
|
+
- "-B" starts with "-" → passed to option classification
|
|
380
|
+
- "clean" found in subcommands → LOCAL_EFFECTS, risk LOW
|
|
381
|
+
- "deploy" found in subcommands → EXTERNAL_EFFECTS, risk MEDIUM (default)
|
|
382
|
+
- aggregate: classification = EXTERNAL_EFFECTS, risk = MEDIUM
|
|
383
|
+
Step 4: option classification
|
|
384
|
+
- "-B" is a known option (no override)
|
|
385
|
+
Step 5: classification
|
|
386
|
+
- aggregate classification: EXTERNAL_EFFECTS
|
|
387
|
+
- no option overrides → final: EXTERNAL_EFFECTS, risk: MEDIUM
|
|
388
|
+
```
|
|
389
|
+
|
|
348
390
|
## Command Database Format
|
|
349
391
|
|
|
350
392
|
YAML files, one per command or command family. Loaded from a `commands/` directory.
|
|
@@ -807,6 +849,7 @@ The `delegates_to` field defines how a command (or option like `find -exec`) han
|
|
|
807
849
|
| `subcommands` | `map` | Nested subcommand definitions (recursive structure) |
|
|
808
850
|
| `options` | `map` | Options that affect classification of this command/subcommand |
|
|
809
851
|
| `strict` | `bool` | If `true` (default), unrecognized options yield `UNKNOWN` |
|
|
852
|
+
| `subcommand_mode` | `enum` | How subcommands are matched: `hierarchical` (default, chained tree walk) or `match_all` (each positional arg matched independently) |
|
|
810
853
|
| `delegates_to` | `object` | How this command delegates execution to an inner command (see delegation modes) |
|
|
811
854
|
|
|
812
855
|
#### Option level
|
|
@@ -410,7 +410,50 @@ subcommands:
|
|
|
410
410
|
--dry-run: {takes_value: true, overrides: READONLY, risk: LOW}
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
## 9.
|
|
413
|
+
## 9. Subcommand Matching Modes
|
|
414
|
+
|
|
415
|
+
### `subcommand_mode: hierarchical` (default)
|
|
416
|
+
|
|
417
|
+
The default mode. Subcommands form a tree, and matching walks the tree greedily. This is correct for most CLI tools where subcommands are hierarchical (e.g. `kubectl rollout status`, `git stash list`).
|
|
418
|
+
|
|
419
|
+
### `subcommand_mode: match_all`
|
|
420
|
+
|
|
421
|
+
Use for build tools that accept multiple goals or tasks as positional arguments in any order. Each positional argument is matched independently against the same subcommand dictionary.
|
|
422
|
+
|
|
423
|
+
```yaml
|
|
424
|
+
# Maven accepts multiple lifecycle phases: mvn clean install
|
|
425
|
+
command: mvn
|
|
426
|
+
classification: LOCAL_EFFECTS
|
|
427
|
+
strict: false
|
|
428
|
+
subcommand_mode: match_all
|
|
429
|
+
subcommands:
|
|
430
|
+
clean:
|
|
431
|
+
classification: LOCAL_EFFECTS
|
|
432
|
+
risk: LOW
|
|
433
|
+
compile:
|
|
434
|
+
classification: LOCAL_EFFECTS
|
|
435
|
+
risk: LOW
|
|
436
|
+
install:
|
|
437
|
+
classification: LOCAL_EFFECTS
|
|
438
|
+
risk: LOW
|
|
439
|
+
deploy:
|
|
440
|
+
classification: EXTERNAL_EFFECTS
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**When to use `match_all`:**
|
|
444
|
+
|
|
445
|
+
- Build tools that accept multiple goals/tasks (Maven, Gradle)
|
|
446
|
+
- Commands where positional args are independent operations, not hierarchical nesting
|
|
447
|
+
|
|
448
|
+
**How classification works:**
|
|
449
|
+
|
|
450
|
+
- The final classification is the maximum severity across all matched goals
|
|
451
|
+
- `mvn clean install` → both LOCAL_EFFECTS → final: LOCAL_EFFECTS
|
|
452
|
+
- `mvn clean deploy` → LOCAL_EFFECTS + EXTERNAL_EFFECTS → final: EXTERNAL_EFFECTS
|
|
453
|
+
- Unrecognized goals (e.g. custom Maven plugin goals like `some-plugin:goal`) fall back to the command's base classification and risk
|
|
454
|
+
- Option overrides (e.g. `--dry-run`) still take precedence over goal aggregation
|
|
455
|
+
|
|
456
|
+
## 10. Common Patterns
|
|
414
457
|
|
|
415
458
|
| Pattern | Example | Classification |
|
|
416
459
|
|---------|---------|---------------|
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"$ref": "#/$defs/SubcommandsMap",
|
|
39
39
|
"description": "Nested subcommand definitions"
|
|
40
40
|
},
|
|
41
|
+
"subcommand_mode": {
|
|
42
|
+
"$ref": "#/$defs/SubcommandMode"
|
|
43
|
+
},
|
|
41
44
|
"delegates_to": {
|
|
42
45
|
"$ref": "#/$defs/DelegationConfig"
|
|
43
46
|
}
|
|
@@ -53,6 +56,11 @@
|
|
|
53
56
|
"enum": ["LOW", "MEDIUM", "HIGH"],
|
|
54
57
|
"description": "Risk level for a command or option override"
|
|
55
58
|
},
|
|
59
|
+
"SubcommandMode": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"enum": ["hierarchical", "match_all"],
|
|
62
|
+
"description": "How subcommands are matched: hierarchical (chained tree walk, default) or match_all (each positional arg matched independently)"
|
|
63
|
+
},
|
|
56
64
|
"DelegationConfig": {
|
|
57
65
|
"type": "object",
|
|
58
66
|
"required": ["mode"],
|
|
@@ -139,6 +147,9 @@
|
|
|
139
147
|
"type": "boolean",
|
|
140
148
|
"description": "If true (default), unrecognized options yield UNKNOWN"
|
|
141
149
|
},
|
|
150
|
+
"subcommand_mode": {
|
|
151
|
+
"$ref": "#/$defs/SubcommandMode"
|
|
152
|
+
},
|
|
142
153
|
"options": {
|
|
143
154
|
"$ref": "#/$defs/OptionsMap"
|
|
144
155
|
},
|
|
@@ -3,6 +3,40 @@ command: gradle
|
|
|
3
3
|
description: "Gradle build tool"
|
|
4
4
|
classification: LOCAL_EFFECTS
|
|
5
5
|
strict: false
|
|
6
|
+
subcommand_mode: match_all
|
|
7
|
+
subcommands:
|
|
8
|
+
clean:
|
|
9
|
+
classification: LOCAL_EFFECTS
|
|
10
|
+
risk: LOW
|
|
11
|
+
build:
|
|
12
|
+
classification: LOCAL_EFFECTS
|
|
13
|
+
risk: LOW
|
|
14
|
+
test:
|
|
15
|
+
classification: LOCAL_EFFECTS
|
|
16
|
+
risk: LOW
|
|
17
|
+
assemble:
|
|
18
|
+
classification: LOCAL_EFFECTS
|
|
19
|
+
risk: LOW
|
|
20
|
+
check:
|
|
21
|
+
classification: LOCAL_EFFECTS
|
|
22
|
+
risk: LOW
|
|
23
|
+
jar:
|
|
24
|
+
classification: LOCAL_EFFECTS
|
|
25
|
+
risk: LOW
|
|
26
|
+
classes:
|
|
27
|
+
classification: LOCAL_EFFECTS
|
|
28
|
+
risk: LOW
|
|
29
|
+
compileJava:
|
|
30
|
+
classification: LOCAL_EFFECTS
|
|
31
|
+
risk: LOW
|
|
32
|
+
compileKotlin:
|
|
33
|
+
classification: LOCAL_EFFECTS
|
|
34
|
+
risk: LOW
|
|
35
|
+
publishToMavenLocal:
|
|
36
|
+
classification: LOCAL_EFFECTS
|
|
37
|
+
risk: LOW
|
|
38
|
+
publish:
|
|
39
|
+
classification: EXTERNAL_EFFECTS
|
|
6
40
|
global_options:
|
|
7
41
|
--help: {overrides: READONLY}
|
|
8
42
|
-h: {overrides: READONLY}
|
|
@@ -3,6 +3,40 @@ command: gradlew
|
|
|
3
3
|
description: "Gradle wrapper"
|
|
4
4
|
classification: LOCAL_EFFECTS
|
|
5
5
|
strict: false
|
|
6
|
+
subcommand_mode: match_all
|
|
7
|
+
subcommands:
|
|
8
|
+
clean:
|
|
9
|
+
classification: LOCAL_EFFECTS
|
|
10
|
+
risk: LOW
|
|
11
|
+
build:
|
|
12
|
+
classification: LOCAL_EFFECTS
|
|
13
|
+
risk: LOW
|
|
14
|
+
test:
|
|
15
|
+
classification: LOCAL_EFFECTS
|
|
16
|
+
risk: LOW
|
|
17
|
+
assemble:
|
|
18
|
+
classification: LOCAL_EFFECTS
|
|
19
|
+
risk: LOW
|
|
20
|
+
check:
|
|
21
|
+
classification: LOCAL_EFFECTS
|
|
22
|
+
risk: LOW
|
|
23
|
+
jar:
|
|
24
|
+
classification: LOCAL_EFFECTS
|
|
25
|
+
risk: LOW
|
|
26
|
+
classes:
|
|
27
|
+
classification: LOCAL_EFFECTS
|
|
28
|
+
risk: LOW
|
|
29
|
+
compileJava:
|
|
30
|
+
classification: LOCAL_EFFECTS
|
|
31
|
+
risk: LOW
|
|
32
|
+
compileKotlin:
|
|
33
|
+
classification: LOCAL_EFFECTS
|
|
34
|
+
risk: LOW
|
|
35
|
+
publishToMavenLocal:
|
|
36
|
+
classification: LOCAL_EFFECTS
|
|
37
|
+
risk: LOW
|
|
38
|
+
publish:
|
|
39
|
+
classification: EXTERNAL_EFFECTS
|
|
6
40
|
global_options:
|
|
7
41
|
--help: {overrides: READONLY}
|
|
8
42
|
-h: {overrides: READONLY}
|
|
@@ -3,6 +3,36 @@ command: mvn
|
|
|
3
3
|
description: "Apache Maven build tool"
|
|
4
4
|
classification: LOCAL_EFFECTS
|
|
5
5
|
strict: false
|
|
6
|
+
subcommand_mode: match_all
|
|
7
|
+
subcommands:
|
|
8
|
+
clean:
|
|
9
|
+
classification: LOCAL_EFFECTS
|
|
10
|
+
risk: LOW
|
|
11
|
+
validate:
|
|
12
|
+
classification: READONLY
|
|
13
|
+
compile:
|
|
14
|
+
classification: LOCAL_EFFECTS
|
|
15
|
+
risk: LOW
|
|
16
|
+
test:
|
|
17
|
+
classification: LOCAL_EFFECTS
|
|
18
|
+
risk: LOW
|
|
19
|
+
test-compile:
|
|
20
|
+
classification: LOCAL_EFFECTS
|
|
21
|
+
risk: LOW
|
|
22
|
+
package:
|
|
23
|
+
classification: LOCAL_EFFECTS
|
|
24
|
+
risk: LOW
|
|
25
|
+
verify:
|
|
26
|
+
classification: LOCAL_EFFECTS
|
|
27
|
+
risk: LOW
|
|
28
|
+
install:
|
|
29
|
+
classification: LOCAL_EFFECTS
|
|
30
|
+
risk: LOW
|
|
31
|
+
site:
|
|
32
|
+
classification: LOCAL_EFFECTS
|
|
33
|
+
risk: LOW
|
|
34
|
+
deploy:
|
|
35
|
+
classification: EXTERNAL_EFFECTS
|
|
6
36
|
global_options:
|
|
7
37
|
--help: {overrides: READONLY}
|
|
8
38
|
-h: {overrides: READONLY}
|
|
@@ -3,6 +3,36 @@ command: mvnw
|
|
|
3
3
|
description: "Apache Maven wrapper"
|
|
4
4
|
classification: LOCAL_EFFECTS
|
|
5
5
|
strict: false
|
|
6
|
+
subcommand_mode: match_all
|
|
7
|
+
subcommands:
|
|
8
|
+
clean:
|
|
9
|
+
classification: LOCAL_EFFECTS
|
|
10
|
+
risk: LOW
|
|
11
|
+
validate:
|
|
12
|
+
classification: READONLY
|
|
13
|
+
compile:
|
|
14
|
+
classification: LOCAL_EFFECTS
|
|
15
|
+
risk: LOW
|
|
16
|
+
test:
|
|
17
|
+
classification: LOCAL_EFFECTS
|
|
18
|
+
risk: LOW
|
|
19
|
+
test-compile:
|
|
20
|
+
classification: LOCAL_EFFECTS
|
|
21
|
+
risk: LOW
|
|
22
|
+
package:
|
|
23
|
+
classification: LOCAL_EFFECTS
|
|
24
|
+
risk: LOW
|
|
25
|
+
verify:
|
|
26
|
+
classification: LOCAL_EFFECTS
|
|
27
|
+
risk: LOW
|
|
28
|
+
install:
|
|
29
|
+
classification: LOCAL_EFFECTS
|
|
30
|
+
risk: LOW
|
|
31
|
+
site:
|
|
32
|
+
classification: LOCAL_EFFECTS
|
|
33
|
+
risk: LOW
|
|
34
|
+
deploy:
|
|
35
|
+
classification: EXTERNAL_EFFECTS
|
|
6
36
|
global_options:
|
|
7
37
|
--help: {overrides: READONLY}
|
|
8
38
|
-h: {overrides: READONLY}
|