Add --version option to gpt-copy CLI command#33
Merged
simone-viozzi merged 2 commits intomainfrom Aug 3, 2025
Merged
Conversation
Co-authored-by: simone-viozzi <19674168+simone-viozzi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] add --version option
Add --version option to gpt-copy CLI command
Aug 3, 2025
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.
This PR adds support for the
--versionoption to the gpt-copy CLI tool. Previously, runninggpt-copy --versionwould result in an error:After this change, the command now works as expected:
Implementation Details
The implementation uses Click's built-in
@click.version_option()decorator withimportlib.metadatato dynamically retrieve the version from the package metadata. This ensures the version displayed is always consistent with what's defined inpyproject.tomlwithout requiring manual synchronization.Changes made:
importlib.metadataimport tosrc/gpt_copy/gpt_copy.py@click.version_option(version=importlib.metadata.version("gpt_copy"))decorator to the main CLI commandtests/test_version_option.pyto verify the functionalityThe
--versionoption is now properly displayed in the help output and follows standard CLI conventions by printing the version and exiting with code 0.Fixes #32.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
openaipublic.blob.core.windows.net/usr/bin/python /tmp/tmph0kzzq5h.py /tmp/tmpe1effsan --tokens(dns block)/usr/bin/python /tmp/tmpjdzgbc4i.py /tmp/tmpvqwhr3wq --tokens --top-n 2(dns block)/usr/bin/python /tmp/tmpkon9knoy.py /tmp/tmpwbps19jd --tokens --include *.py(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.