Add --refresh option for xts alias with source tracking #53
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.
xts alias caches files from URLs and local paths but provided no mechanism to update them when sources change. Additionally,
--listshowed cached paths instead of original sources, making it unclear where configs originated.Changes
New JSON structure for aliases.json:
{ "alias_name": { "cached_path": "/home/user/.xts/cache/file.xts", "source": "https://example.com/file.xts" } }--refreshcommand: Re-downloads from URLs or re-copies from local filesSource tracking: All aliases now store original source (URL or resolved file path) alongside cached path
Updated listing:
--listdisplays source location instead of cache path$ xts --alias --list myalias -> https://example.com/config.xtsAutomatic migration: Old format (
{"name": "/path"}) migrates to new format on first load. Migrated aliases show helpful error when refresh is attempted since original source is unknown.Helper functions:
_get_cached_path()and_get_source()abstract format differences throughout codebaseAll existing functionality preserved. Alias resolution still returns cached path for execution.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.