Skip to content

feat: add version management, update notification and token-saver CLI - #7

Merged
ppgranger merged 8 commits into
mainfrom
feat/version-management-cli
Feb 20, 2026
Merged

ppgranger merged 8 commits into
mainfrom
feat/version-management-cli

Conversation

@ppgranger

Copy link
Copy Markdown
Owner
  • 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)

What

Why

How

Checklist

  • ruff check . passes
  • ruff format --check . passes
  • python3 -m pytest tests/ -v passes (all 207+ tests)
  • New code has tests
  • No secrets or credentials in the diff

- 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
ppgranger merged commit f3729b3 into main Feb 20, 2026
4 checks passed
@ppgranger
ppgranger deleted the feat/version-management-cli branch February 20, 2026 13:38
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
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