feat: add version management, update notification and token-saver CLI - #7
Merged
Merged
Conversation
- Single source of truth for version in src/__init__.py (v1.0.1) - GitHub API update check at session start (fail-open, 3s timeout) - CLI command: token-saver version|stats|update - bin/token-saver executable + Windows .cmd wrapper - Installer stamps version into plugin.json/gemini-extension.json - install_cli/uninstall_cli for PATH integration (~/.local/bin)
Bump version to 1.0.1. Update all GitHub URLs, descriptions, and comments to use token-saver consistently.
The project was renamed from "token-saving" to "token-saver" with the introduction of the CLI (v1.0.1). The installer now detects and removes old "token-saving" directories and hooks before installing, so nothing is left behind under the former name.
- bin/token-saver: find src/ in plugin install dirs when repo is deleted - cli.py: git merge --ff-only instead of checkout (no detached HEAD) - cli.py: detect installed targets instead of hardcoding --target both - cli.py: tarball overlay only known dirs (preserve .git, local config) - cli.py: clear HTTP 404 message when no GitHub releases exist - version_check.py: guard empty tag_name, reduce timeout to 2s - install.py: run legacy migration on uninstall too - Add tests/test_installers.py (15 tests: migration, stamping, CLI) - Add edge case tests for empty/None version strings
Install core files to ~/.token-saver/ so the CLI and update command work independently of which platform target was chosen. This ensures token-saver continues to function after the repo/zip is deleted. - Add install_core()/uninstall_core() and CORE_FILES to installers/common.py - Update bin/token-saver to search repo -> ~/.token-saver/ -> plugin dirs - Make _detect_installed_targets() Windows-aware with %APPDATA% paths - Update install.py to call install_core() and uninstall_core() - Update README with CLI docs, project structure, and test counts - Add 3 new tests for core install/uninstall behavior
- Fix uninstall_core leaving empty parent dirs (os.walk stale dirnames) - Fix _parse_version crash on pre-release tags (e.g. "1.0.0-beta") - Fix migrate_from_legacy crash on malformed settings.json hooks - Reduce version check HTTP timeout from 2s to 1s for safer hook margin - Add error handling around version comparison in cmd_update - Add tests for pre-release parsing, dir cleanup, malformed settings
- Quote hook command paths for directories with spaces (Claude + Gemini) - Fix install_files/install_cli overwriting through existing symlinks when switching from --link to copy mode (corrupted source files) - Try both v-prefixed and bare tag names in tarball download URL - Use 10s HTTP timeout for interactive CLI update (vs 1s for hooks) - Add test for symlink-to-copy transition safety
- Add data_dir() to src/__init__.py as single source of truth for the data directory path (%APPDATA%/token-saver on Windows, ~/.token-saver on Unix) - Update config.py, tracker.py, hook_pretool.py, and wrap.py to use data_dir() instead of hardcoding ~/.token-saver - Fix hook_pretool.py using python3 on Windows where only python exists - Fix test_default_values failing when TOKEN_SAVER_DEBUG is set in env
ppgranger
added a commit
that referenced
this pull request
Feb 21, 2026
feat: add version management, update notification and token-saver CLI
ppgranger
added a commit
that referenced
this pull request
Mar 10, 2026
feat: add version management, update notification and token-saver CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Why
How
Checklist
ruff check .passesruff format --check .passespython3 -m pytest tests/ -vpasses (all 207+ tests)