File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ opencode-memory uninstall # removes shell hook from .zshrc/.bashrc
6565npm uninstall -g opencode-claude-memory
6666```
6767
68+ To print the wrapper package version:
69+
70+ ``` bash
71+ opencode-memory self -v
72+ ```
73+
6874This removes the shell hook, the CLI, and the plugin. Your saved memories in ` ~/.claude/projects/ ` are ** not** deleted.
6975
7076## 💡 Why this exists
Original file line number Diff line number Diff line change 88# Subcommands:
99# opencode-memory install — Install shell hook to ~/.zshrc or ~/.bashrc
1010# opencode-memory uninstall — Remove shell hook
11+ # opencode-memory self -v — Print the wrapper package version
1112# opencode-memory [args...] — Run opencode with post-session memory maintenance
1213#
1314# How it works:
3940
4041set -euo pipefail
4142
43+ SCRIPT_DIR=" $( CDPATH= cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd) "
44+ PACKAGE_JSON=" $SCRIPT_DIR /../package.json"
45+
46+ print_wrapper_version () {
47+ local version
48+
49+ version=$( awk -F' "' ' /^[[:space:]]*"version"[[:space:]]*:/ { print $4; exit }' " $PACKAGE_JSON " )
50+
51+ if [ -z " $version " ]; then
52+ echo " [opencode-memory] ERROR: Cannot read package version from $PACKAGE_JSON " >&2
53+ exit 1
54+ fi
55+
56+ printf ' %s\n' " $version "
57+ }
58+
4259# ============================================================================
4360# Shell Hook Management
4461# ============================================================================
@@ -138,6 +155,14 @@ case "${1:-}" in
138155 uninstall_hook
139156 exit 0
140157 ;;
158+ self)
159+ case " ${2:- } " in
160+ -v|--version|version)
161+ print_wrapper_version
162+ exit 0
163+ ;;
164+ esac
165+ ;;
141166esac
142167
143168# ============================================================================
You can’t perform that action at this time.
0 commit comments