bash-classify 0.1.0__tar.gz → 0.1.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.1.0 → bash_classify-0.1.1}/PKG-INFO +30 -28
- {bash_classify-0.1.0 → bash_classify-0.1.1}/README.md +29 -27
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/cli.py +26 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.claude/rules/command-database.md +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.claude-plugin/marketplace.json +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.editorconfig +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.github/workflows/ci.yml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.github/workflows/publish.yml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.gitignore +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/.python-version +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/CLAUDE.md +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/LICENSE +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/SPEC.md +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/coding-agent-plugins/claude-code/.claude-plugin/plugin.json +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/coding-agent-plugins/claude-code/hooks/classify-bash.sh +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/coding-agent-plugins/claude-code/hooks/hooks.json +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/docs/classification-guidance.md +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/pyproject.toml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/ruff.toml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/schemas/command.schema.json +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/__init__.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/__main__.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/classifier.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/apt.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/awk.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/basename.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/bash.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/brew.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/builtin.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/cargo.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/cat.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/chgrp.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/chmod.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/chown.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/column.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/comm.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/command.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/cp.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/curl.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/cut.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/date.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/df.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/diff.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/dig.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/dirname.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/docker.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/du.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/echo.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/env.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/expand.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/false.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/file.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/find.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/fmt.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/fold.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/free.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/gawk.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/git.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/go.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/grep.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/groups.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/gunzip.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/gzip.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/head.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/helm.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/hostname.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/id.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/install.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/join.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/journalctl.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/jq.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/kill.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/killall.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/kubectl.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/less.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/ln.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/ls.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/make.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/md5sum.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/mkdir.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/more.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/mv.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/netstat.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/nice.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/nl.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/node.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/nohup.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/npm.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/nslookup.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/paste.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/ping.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/pip.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/pip3.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/pkill.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/poetry.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/printenv.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/printf.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/ps.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/pwd.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/python.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/python3.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/read.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/readlink.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/realpath.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/rev.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/rm.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/rsync.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/scp.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/sed.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/seq.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/sh.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/sha1sum.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/sha256sum.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/sort.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/ss.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/ssh.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/stat.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/strace.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/sudo.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/systemctl.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/tac.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/tail.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/tar.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/tee.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/terraform.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/test.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/time.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/timeout.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/top.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/touch.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/tr.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/traceroute.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/true.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/type.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/uname.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/unexpand.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/uniq.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/unzip.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/uptime.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/uv.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/wc.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/wget.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/whereis.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/which.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/whoami.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/xargs.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/xmllint.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/yes.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/yq.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/zip.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/commands/zsh.yaml +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/database.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/matcher.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/models.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/parser.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/src/bash_classify/py.typed +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/__init__.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/conftest.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_classifier.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_cli.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_cli_serialization.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_database.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_matcher.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_models.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_parser.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_real_world.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_schema.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/tests/test_smoke.py +0 -0
- {bash_classify-0.1.0 → bash_classify-0.1.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bash-classify
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.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
|
|
@@ -61,35 +61,26 @@ $ echo 'find . -name "*.pyc" -delete' | bash-classify | jq '.classification'
|
|
|
61
61
|
"DANGEROUS"
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
## Claude Code
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
"matcher": "\"classification\": \"READONLY\"",
|
|
82
|
-
"action": "approve"
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
}
|
|
64
|
+
## Claude Code plugin
|
|
65
|
+
|
|
66
|
+
The repo includes a Claude Code plugin that auto-allows readonly bash commands via a `PreToolUse` hook. Install it as a marketplace:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# First, install the bash-classify CLI
|
|
70
|
+
uv tool install bash-classify
|
|
71
|
+
|
|
72
|
+
# Then install the plugin marketplace
|
|
73
|
+
claude plugin add /path/to/bash-classify
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or from GitHub directly:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
claude plugin add https://github.com/fprochazka/bash-classify
|
|
91
80
|
```
|
|
92
81
|
|
|
82
|
+
Once installed, any Bash tool call classified as `READONLY` is auto-approved — no permission prompt. Everything else (WRITE, DANGEROUS, UNKNOWN) still requires confirmation.
|
|
83
|
+
|
|
93
84
|
## Command database
|
|
94
85
|
|
|
95
86
|
The classification database includes 120+ command definitions covering common Unix utilities, package managers, container tools, cloud CLIs, and more.
|
|
@@ -142,6 +133,17 @@ uv run pytest
|
|
|
142
133
|
|
|
143
134
|
To add or modify command definitions, see [docs/classification-guidance.md](docs/classification-guidance.md). All YAML files in `src/bash_classify/commands/` are validated against a [JSON Schema](schemas/command.schema.json) — your IDE will provide autocomplete if it supports the `# $schema:` comment.
|
|
144
135
|
|
|
136
|
+
## Releasing
|
|
137
|
+
|
|
138
|
+
Version is derived automatically from git tags via `hatch-vcs` — no manual version bumping needed.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git tag v<version>
|
|
142
|
+
git push origin v<version>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The `publish.yml` GitHub Action builds and publishes to PyPI automatically via trusted publishing.
|
|
146
|
+
|
|
145
147
|
## License
|
|
146
148
|
|
|
147
149
|
[MIT](LICENSE)
|
|
@@ -32,35 +32,26 @@ $ echo 'find . -name "*.pyc" -delete' | bash-classify | jq '.classification'
|
|
|
32
32
|
"DANGEROUS"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
## Claude Code
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
"matcher": "\"classification\": \"READONLY\"",
|
|
53
|
-
"action": "approve"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
35
|
+
## Claude Code plugin
|
|
36
|
+
|
|
37
|
+
The repo includes a Claude Code plugin that auto-allows readonly bash commands via a `PreToolUse` hook. Install it as a marketplace:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# First, install the bash-classify CLI
|
|
41
|
+
uv tool install bash-classify
|
|
42
|
+
|
|
43
|
+
# Then install the plugin marketplace
|
|
44
|
+
claude plugin add /path/to/bash-classify
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or from GitHub directly:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
claude plugin add https://github.com/fprochazka/bash-classify
|
|
62
51
|
```
|
|
63
52
|
|
|
53
|
+
Once installed, any Bash tool call classified as `READONLY` is auto-approved — no permission prompt. Everything else (WRITE, DANGEROUS, UNKNOWN) still requires confirmation.
|
|
54
|
+
|
|
64
55
|
## Command database
|
|
65
56
|
|
|
66
57
|
The classification database includes 120+ command definitions covering common Unix utilities, package managers, container tools, cloud CLIs, and more.
|
|
@@ -113,6 +104,17 @@ uv run pytest
|
|
|
113
104
|
|
|
114
105
|
To add or modify command definitions, see [docs/classification-guidance.md](docs/classification-guidance.md). All YAML files in `src/bash_classify/commands/` are validated against a [JSON Schema](schemas/command.schema.json) — your IDE will provide autocomplete if it supports the `# $schema:` comment.
|
|
115
106
|
|
|
107
|
+
## Releasing
|
|
108
|
+
|
|
109
|
+
Version is derived automatically from git tags via `hatch-vcs` — no manual version bumping needed.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git tag v<version>
|
|
113
|
+
git push origin v<version>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The `publish.yml` GitHub Action builds and publishes to PyPI automatically via trusted publishing.
|
|
117
|
+
|
|
116
118
|
## License
|
|
117
119
|
|
|
118
120
|
[MIT](LICENSE)
|
|
@@ -95,7 +95,33 @@ def main() -> None:
|
|
|
95
95
|
1 - parse error (invalid bash syntax)
|
|
96
96
|
2 - internal error
|
|
97
97
|
"""
|
|
98
|
+
if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
|
|
99
|
+
print("Usage: bash-classify < command")
|
|
100
|
+
print(" echo 'ls -la' | bash-classify")
|
|
101
|
+
print()
|
|
102
|
+
print("Reads a bash expression from stdin, classifies it, and outputs JSON.")
|
|
103
|
+
print()
|
|
104
|
+
print("Exit codes:")
|
|
105
|
+
print(" 0 successfully classified")
|
|
106
|
+
print(" 1 empty input")
|
|
107
|
+
print(" 2 internal error")
|
|
108
|
+
sys.exit(0)
|
|
109
|
+
|
|
110
|
+
if len(sys.argv) > 1 and sys.argv[1] in ("-v", "--version"):
|
|
111
|
+
from importlib.metadata import version
|
|
112
|
+
|
|
113
|
+
print(f"bash-classify {version('bash-classify')}")
|
|
114
|
+
sys.exit(0)
|
|
115
|
+
|
|
98
116
|
try:
|
|
117
|
+
import select
|
|
118
|
+
|
|
119
|
+
# Timeout if no data arrives within 5 seconds
|
|
120
|
+
ready, _, _ = select.select([sys.stdin], [], [], 5.0)
|
|
121
|
+
if not ready:
|
|
122
|
+
print("bash-classify: timed out waiting for input on stdin (use --help for usage)", file=sys.stderr)
|
|
123
|
+
sys.exit(1)
|
|
124
|
+
|
|
99
125
|
expression = sys.stdin.read().strip()
|
|
100
126
|
if not expression:
|
|
101
127
|
sys.exit(1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bash_classify-0.1.0 → bash_classify-0.1.1}/coding-agent-plugins/claude-code/hooks/classify-bash.sh
RENAMED
|
File without changes
|
{bash_classify-0.1.0 → bash_classify-0.1.1}/coding-agent-plugins/claude-code/hooks/hooks.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|