Skip to content

v2.3.0#36

Merged
ppgranger merged 4 commits intoproductionfrom
main
Apr 12, 2026
Merged

v2.3.0#36
ppgranger merged 4 commits intoproductionfrom
main

Conversation

@ppgranger
Copy link
Copy Markdown
Owner

Token-Saver v2.3.0

Improved Command Detection

This release significantly improves token-saver's ability to detect and compress CLI output when commands are invoked through non-standard paths or wrapper runners.

Path Prefix Normalization

Commands invoked via full or relative paths are now correctly detected and compressed:

  • Absolute paths: /usr/bin/git status, /usr/local/bin/npm install
  • Virtual environments: .venv/bin/pip install, .venv/bin/pytest
  • Local binaries: ./node_modules/.bin/jest, ./vendor/bin/phpunit
  • Version managers: ~/.pyenv/shims/pip, ~/.nvm/versions/node/v18/bin/npm, ~/.cargo/bin/cargo

Wrapper Runner Support

Commands invoked through common wrapper runners are now intercepted:

Wrapper Supported Commands
npx jest, mocha, vitest, playwright, eslint, prettier, stylelint, biome, webpack, vite, esbuild, tsc, next build, turbo run
poetry run pytest, flake8, pylint, ruff, mypy
uv run pytest, flake8, pylint, ruff, mypy
pipx run pytest
bundle exec rspec, rails test, rubocop

Python Version-Specific Invocations

Python commands with version suffixes or full paths are now detected:

  • python3.11 -m pytest, python3.12 -m pip install
  • .venv/bin/python -m pytest, /usr/bin/python3 -m flake8

What Changed

  • scripts/hook_pretool.py — Added _normalize_cmd() path normalization before pattern matching
  • src/processors/base.py — Added shared PYTHON_CMD regex constant
  • src/processors/test_output.py — Added wrapper runner hook patterns and routing
  • src/processors/lint_output.py — Added wrapper runner hook patterns
  • src/processors/build_output.py — Added npx build tool patterns
  • src/processors/python_install.py — Added python -m pip install support
  • tests/test_hooks.py — 28 new tests covering all new patterns

Stats

  • 716 tests passing
  • 7 files changed, 182 insertions, 21 deletions

Add path normalization in hook_pretool.py to detect commands invoked via
full paths (.venv/bin/pip, /usr/bin/git, ./node_modules/.bin/jest).

Add hook_patterns for common wrapper runners: npx, poetry run, uv run,
pipx run, bundle exec. Add python -m pip install support.

Bump version to 2.3.0.
…ection

feat: detect commands with path prefixes and wrapper runners
@ppgranger ppgranger merged commit 0e04454 into production Apr 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant