Skip to content

Commit df7eff7

Browse files
committed
Update version to 0.2.1 and add CLI version flag
- Introduced a `--version` flag to the CLI for displaying the installed package version. - Updated version in `pyproject.toml` and `uv.lock` to 0.2.1. - Documented the new version flag in the CHANGELOG.md.
1 parent f64dcff commit df7eff7

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.1] - 2025-02-27
9+
10+
### Added
11+
- CLI version flag (`--version` or `-v`) to display installed package version
12+
813
## [0.2.0] - 2025-02-27
914

1015
### Added

ask2api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import mimetypes
55
import os
66
import requests
7+
from importlib.metadata import version, PackageNotFoundError
78
from urllib.parse import urlparse
89

910
API_KEY = os.getenv("OPENAI_API_KEY")
@@ -55,11 +56,22 @@ def prepare_image_content(image_path):
5556
}
5657

5758

59+
def get_version():
60+
"""Get the installed package version."""
61+
try:
62+
return version("ask2api")
63+
except PackageNotFoundError:
64+
return "dev"
65+
66+
5867
def main():
5968
parser = argparse.ArgumentParser()
6069
parser.add_argument("-p", "--prompt", required=True)
6170
parser.add_argument("-sf", "--schema-file", required=True)
6271
parser.add_argument("-i", "--image")
72+
parser.add_argument(
73+
"-v", "--version", action="version", version=f"%(prog)s {get_version()}"
74+
)
6375
args = parser.parse_args()
6476

6577
with open(args.schema_file, "r", encoding="utf-8") as f:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ask2api"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "A minimal CLI tool that turns natural language into instant APIs."
55
readme = "README.md"
66
authors = [

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)