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.
This commit is contained in:
+9
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user