Skip to content

Commit 2d6cd8f

Browse files
authored
feat: --version flag (#86)
1 parent b988bfd commit 2d6cd8f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# VARIABLE DEFINITIONS
22
venv := ".venv"
33
python_version :="3.13"
4-
run := "poetry run"
4+
run := "uv run"
55
eval_path := "eval/cli.py"
66

77
venv-exists := path_exists(venv)

src/lightman_ai/cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from pathlib import Path
23

34
import click
45
from dotenv import load_dotenv
@@ -12,7 +13,17 @@
1213
logger = logging.getLogger("lightman")
1314

1415

16+
def get_version() -> str:
17+
"""Read version from VERSION file."""
18+
try:
19+
version_file = Path(__file__).resolve().parents[2] / "VERSION"
20+
return version_file.read_text().strip()
21+
except FileNotFoundError:
22+
return "unknown"
23+
24+
1525
@click.group()
26+
@click.version_option(version=get_version(), prog_name="lightman-ai")
1627
def entry_point() -> None:
1728
pass
1829

0 commit comments

Comments
 (0)