Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ elfmem uses [Semantic Versioning](https://semver.org/).

---

## [0.8.0] — 2026-04-28

### Added
- **`elfmem --version` / `-V` CLI flag:** Prints installed version and exits. Version is read from package metadata (`importlib.metadata`), single source of truth in `pyproject.toml`.
- **`elfmem.__version__`:** Exported from the package root for programmatic access.

## [0.7.0] — 2026-04-28

### Added
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "elfmem"
version = "0.7.0"
version = "0.8.0"
description = "Adaptive memory for LLM agents — adaptive decay, knowledge graph, zero infrastructure"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
5 changes: 5 additions & 0 deletions src/elfmem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
s = await system.status() # health snapshot + suggested action
"""

from importlib.metadata import version as _version

from elfmem.api import MemorySystem
from elfmem.config import ElfmemConfig, LoggingConfig
from elfmem.exceptions import (
Expand Down Expand Up @@ -56,7 +58,10 @@
TokenUsage,
)

__version__ = _version("elfmem")

__all__ = [
"__version__",
# Core
"MemorySystem",
"ElfmemConfig",
Expand Down
23 changes: 23 additions & 0 deletions src/elfmem/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
" pip install 'elfmem[cli]' or uv add 'elfmem[cli]'"
) from None

from elfmem import __version__
from elfmem import project as _project
from elfmem.api import MemorySystem, format_recall_response
from elfmem.exceptions import ElfmemError
Expand All @@ -56,13 +57,35 @@
SystemStatus,
)


def _version_callback(value: bool) -> None:
if value:
print(f"elfmem {__version__}")
raise typer.Exit()


app = typer.Typer(
name="elfmem",
help="Adaptive memory for AI agents.",
no_args_is_help=True,
)


@app.callback()
def _main(
version: Annotated[
bool,
typer.Option(
"--version", "-V",
help="Show version and exit.",
callback=_version_callback,
is_eager=True,
),
] = False,
) -> None:
"""Adaptive memory for AI agents."""


# ── Shared helpers ────────────────────────────────────────────────────────────


Expand Down
Loading