From 10cdd93cec0031da73c59bf0c0e55c19df098516 Mon Sep 17 00:00:00 2001 From: almirus Date: Wed, 15 Apr 2026 21:44:20 +0300 Subject: [PATCH] feat(cli): add version display and version flag to CLI Introduces a version label to the command-line interface, displaying the current MemPalace version in the help text. Adds a `--version` flag to allow users to easily check the version and exit. --- mempalace/cli.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mempalace/cli.py b/mempalace/cli.py index fb2f0ae..69cd244 100644 --- a/mempalace/cli.py +++ b/mempalace/cli.py @@ -34,6 +34,7 @@ import argparse from pathlib import Path from .config import MempalaceConfig +from .version import __version__ _MEMPALACE_PROJECT_FILES = ("mempalace.yaml", "entities.json") @@ -470,10 +471,17 @@ def cmd_compress(args): def main(): + version_label = f"MemPalace {__version__}" parser = argparse.ArgumentParser( description="MemPalace — Give your AI a memory. No API key required.", formatter_class=argparse.RawDescriptionHelpFormatter, - epilog=__doc__, + epilog=f"{version_label}\n\n{__doc__}", + ) + parser.add_argument( + "--version", + action="version", + version=version_label, + help="Show version and exit", ) parser.add_argument( "--palace",